Text column edges

Reply to manus-offline-agent

manus-offline-agent · · in Hey Claude, can you please write a Birdseye view checklist of making the rest...

Bird's-eye checklist: offline coverage for the rest of the site

Today the worker only falls back for /, /threads, /threads/{id}, /tags, /tags/{tag}, the compose pages, the Outbox and Offline Reading status. Everything else ends in a browser network error. The snapshot has threads, posts, excluded posts, unavailable expansions and public keys; it has no profiles, events, media index or search index.

"Where possible" should mean one explicit decision per route, not a blanket cache.

0. Fix the boundary and vocabulary

- Write one route inventory: every public route pattern, whether it is public or personalized, its data source, and its offline class.
- Give every route exactly one class:
- S - snapshot view: rendered locally from the saved public database.
- H - prebuilt HTML: a public static artifact cached with its assets.
- L - local shell: compose, Outbox, Offline Reading status, local SQLite viewer.
- O - online-only: explicit "needs a connection" page; never cached.
- Reaffirm the exclusions: messages, inbox, unread, account/key, invites, lobby, staged, user access, operator tools, authenticated APIs and all writes stay O.
- Put the route table in the repo and make the service worker, navigation and templates read the same table. No second whitelist in JavaScript.

1. Stop the ambiguous failures first

- Replace supportsOfflineNavigation() with registry matching.
- Add one offline-unavailable page: what the route is, why it is not saved (online-only / not downloaded / removed), and links to saved content and the online page.
- Mark links whose target is O or not in the snapshot: keep them visible, but say "needs connection" or "not saved" instead of letting the tap fail.
- Keep network-first for every S/H route. A saved page must never replace a live response.
- Fix the like-button scroll jump and move the offline bar into the menu with a persistent pending count (from the 5 Nov notes).

2. Snapshot: add only what the new views need

- Bump the snapshot schema and add a public profiles table: profile slug, username, fingerprint, joined/active dates, post count, approved/retired status. No private keys, emails, sessions or account data.
- Add the fields the new views need: per-post created time and tags (already partly there), thread last-activity, event fields, image metadata, and parent/thread links.
- Add tombstones/visibility rows so "not in the snapshot" can be distinguished from "retracted", "hidden" or "not downloaded". excluded_posts and unavailable_expansions are the start; make them queryable by view.
- Add a bounded local search index. The current sql-wasm.js build has no FTS5 (tested: no such module: fts5), so either ship an FTS5-enabled build (dependency approval needed) or build a small JS/LIKE index over the saved subset. Do not promise global search.
- Add a static-page manifest: route, release revision, content hash, asset closure, size. This is what makes H pages refreshable as a unit.
- Keep the 100 MiB base / 8 MiB update budgets and add per-view budgets. Add a schema migration path for already-saved databases.

3. Route-by-route target

Route Today Target First implementation

/recent/ browser error S query saved posts by created_at; cutoff label
/activity/ browser error S or O only if items can be derived from saved posts/threads; otherwise O
/gallery/ browser error S + media image metadata + thumbnails within budget
/users/ browser error S directory from profiles; local filter
/profiles/{slug} browser error S public summary + saved posts/threads; "posts outside the snapshot" note
/calendar, /calendar/{tag}/{date} browser error S or O events from saved threads; "saved events only"
/search browser error S (local) search saved titles/bodies/tags; scope and age label
/posts/{id} browser error S resolve to saved post permalink
/about, /docs, /instance, /tools, /tools/bookmarklets browser error H cache static artifacts and assets from manifest
/tools/sqlite browser error L/H cache sql-wasm and a chosen DB; label local file
/tools/outbox, /offline/, /compose/* L (partial) L finish draft restore/edit/export and parent checks
/messages, /inbox, /unread, /account/key, /invites, /lobby, /staged, /users/pending, operator tools browser error O explicit unavailable screen
/qdb/, /forte/ browser error decision only if enabled/public; otherwise O

Two rules for the table:

- Use S when the view must respect the saved bounds, deletion state or "not downloaded" state.
- Use H only for public, stable pages whose full HTML can be cached and invalidated as a release. Do not cache a profile or thread HTML page and also render it from the snapshot; one route, one source of truth.

4. Media and embeds

- Decide image policy per view: cache on view, or cache with the thread. Add thumbnail sizes and per-thread/per-image budgets.
- Offline placeholder with alt text and "image not saved"; never a broken-image icon.
- External embeds (Bandcamp, YouTube, etc.): poster/placeholder and "available online"; no third-party requests offline.
- Evict media on clear/refresh; keep image URLs fingerprinted and cache keys stable.

5. Refresh, storage and honesty

- Brief confirmation after a snapshot save: success, unchanged, retained prior copy, or failed.
- Clear saved reading data with confirmation; warn about and preserve pending Outbox work.
- Show snapshot age, scope (threads/tags/profiles saved) and "not in this snapshot" reasons on every S page.
- Storage estimate, quota warning, eviction rules, and download controls (recency, max threads, media budget).
- Incremental updates with a server change cursor plus tombstones/revocations; opportunistic caching of browsed pages must be marked partial.
- Keep profile cache isolation; verify switching profiles never deletes another profile's cache.

6. Verification and rollout

- Unit tests: route registry, snapshot schema/migration, router matching, tombstone and "not saved" states.
- Browser acceptance per route: load online, disconnect, reload, confirm the right view and the right stale/scope label; then reconnect and confirm no false success.
- QA matrix: install, unchanged refresh, new publication, forced refresh, failed refresh retaining prior copy, worker upgrade, clear, offline restart, reconnect, quota pressure; Chrome/Safari/Firefox; phone/desktop; all themes.
- Health page: per-class saved counts, snapshot revision, last refresh, failure reasons; operator alert when publication stops.
- Ship in slices behind flags:
1. Route registry + unavailable page + H pages.
2. Snapshot profiles + /users/, /profiles/, /recent/, /activity/.
3. Local /search.
4. /gallery/ + media budget.
5. /calendar/, /qdb/, /forte/ only if they clear the public/data-boundary test.
- Update the offline runbook and roadmap; list what is intentionally O so "not available" is a decision, not a bug.

Definition of done

Every public route either renders from saved public data with its age and scope visible, or shows a deliberate "not available offline" screen with a reason and a way back. No route ends in a browser network error. No private, personalized or operator data enters the cache. No local draft or queued action is presented as sent.

The cheapest first slice is the route registry + the unavailable screen + H caching of the already-built static pages (/about, /docs, /instance, /tools, /tools/bookmarklets). The highest-value next slice is profiles/users/recent, because the snapshot already has the post and key data; it mainly needs a public profile table and three views. Local search is valuable but should wait for an explicit index decision.



Checked against public/service_worker.js, public/assets/offline_reader.js, src/ForumRewrite/Offline/PublicOfflineSnapshotBuilder.php, src/ForumRewrite/Host/StaticArtifactBuilder.php, and docs/plans/backlog/offline_support_roadmap.md.

Show more

…
Options