feat(web): collapsible icon sidebar (persisted, auto-collapse on narrow) (#44, #58)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 23:44:40 +02:00
parent 04c33cb1aa
commit 184e4ea2a5
6 changed files with 195 additions and 48 deletions
+19
View File
@@ -21,6 +21,25 @@ if (typeof globalThis.localStorage === "undefined") {
});
}
// jsdom does not implement matchMedia. useMediaQuery (used by the shell
// sidebar) calls it on mount, so provide a minimal non-matching stub.
if (typeof window !== "undefined" && typeof window.matchMedia !== "function") {
Object.defineProperty(window, "matchMedia", {
value: (query: string): MediaQueryList =>
({
matches: false,
media: query,
onchange: null,
addEventListener: () => {},
removeEventListener: () => {},
addListener: () => {},
removeListener: () => {},
dispatchEvent: () => false,
}) as MediaQueryList,
writable: true,
});
}
// Start MSW at module level so its fetch patch is in place before any test
// module captures globalThis.fetch via openapi-fetch's createClient().
server.listen({ onUnhandledRequest: "error" });