feat: show real neighboring pages during back and forward swipes

This commit is contained in:
randogoth 2026-10-11 11:05:03 +03:00
parent 4e07c9a305
commit c104c2026b
7 changed files with 283 additions and 71 deletions

View file

@ -31,6 +31,15 @@ class SubmitForm extends FetchCommand {
final Map<String, String> fields;
}
/// Parses a page's source without touching the network; used to prepare the
/// neighboring pages that swipes reveal.
class ParseSource extends FetchCommand {
const ParseSource({required this.url, required this.source});
final String url;
final String source;
}
sealed class FetchResult {
const FetchResult();
}
@ -94,6 +103,7 @@ class FetchHandler with Handler<FetchCommand, FetchResult> {
await _fetchPage(url, etag, lastModified, cachedSource),
SubmitForm(:final url, :final method, :final fields) =>
await _submitForm(url, method, fields),
ParseSource(:final url, :final source) => _parse(source, url),
};
}