feat(web): view transitions on route changes; content enter animation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
635fd66d04
commit
d607938630
5 files changed
+165
-4
No files matched your search
@@ -19,3 +19,16 @@ test("features.ts imports only browser entries, by package name", () => {
|
||||
for (const s of specs) expect(s === "@stc/contracts" || /^@stc\/feature-[a-z]+\/web$/.test(s)).toBe(true);
|
||||
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