fix(web,learner): navigation swaps at once; content-only entrance, loading line, focus (R19)
Drops document-level View Transitions and the lesson hold: they dropped clicks for 120-180 ms, froze the screen while route code loaded, and let the dock act on a stale lesson. Navigation now swaps immediately; only the content region enters (opacity and a 6 px rise, 160 ms); a 2 px loading line appears when code or data takes over 150 ms; the dock works from the outline and the URL, so a second Next advances again; focus moves to the new h1 and a polite live region announces it. Route chunks of a feature preload together so the sidebar never drops. Scroll restore stops on user input; pdf.js never starts a load after cleanup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
305c262ff1
commit
b5e00af4f7
18 files changed
+231
-275
No files matched your search
@@ -20,15 +20,3 @@ test("features.ts imports only browser entries, by package name", () => {
|
||||
expect(specs.filter((s) => s.endsWith("/web")).length).toBe(4);
|
||||
});
|
||||
|
||||
test("changesPage: a view transition for a new kind of page, none between steps of the same page", async () => {
|
||||
const { changesPage } = await import("./nav");
|
||||
const routes = webFeatures.flatMap((f) => f.routes.map((r) => ({ path: r.path })));
|
||||
expect(changesPage(routes, "/", "/c/sample")).toBe(true);
|
||||
expect(changesPage(routes, "/c/sample", "/c/sample/m1-intro")).toBe(true);
|
||||
expect(changesPage(routes, "/c/sample/m1-intro", "/c/sample/notes")).toBe(true);
|
||||
expect(changesPage(routes, "/c/sample/m1-intro", "/c/sample/m1-code")).toBe(false);
|
||||
expect(changesPage(routes, "/c/sample/m1-intro", "/c/other/x?t=3")).toBe(false);
|
||||
expect(changesPage(routes, "/c/sample/m1-video", "/c/sample/m1-video?deck=d1&slide=2")).toBe(false);
|
||||
expect(changesPage(routes, "/c/a%20b/x", "/c/a%20b/y")).toBe(false);
|
||||
expect(changesPage(routes, "/c/sample", "/nowhere/at/all/deep")).toBe(true);
|
||||
});
|
||||
Reference in new issue
Block a user