fix: Beute-Editor fängt den Fokus, SVG-Icon im Kopf
- Auf /colonies/[id]/hive bekommen Sprunglink, Seitenleiste, Kopf, Offline-Band, untere Navigation und „+ Neu“ das Attribut inert; der erste Tab landet auf „Zurück“ im Editor (vorher Stopp 34). - metadata.icons verlinkt /icon.svg neben favicon.ico und apple-icon. - Tests: alle THEME_COLORS gleich dem jeweiligen --background, ausdrücklich gewähltes Dunkel färbt die theme-color. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
ce68729233
commit
6ac9eef93b
11 files changed
+221
-9
No files matched your search
@@ -140,6 +140,25 @@ describe("useAppearance", () => {
|
||||
expect(document.documentElement).toHaveClass("dark");
|
||||
});
|
||||
|
||||
it("picking dark sets every theme-color meta to the dark page colour, and back", () => {
|
||||
const metas = ["light", "dark"].map((scheme) => {
|
||||
const meta = document.createElement("meta");
|
||||
meta.name = "theme-color";
|
||||
meta.media = `(prefers-color-scheme: ${scheme})`;
|
||||
document.head.append(meta);
|
||||
return meta;
|
||||
});
|
||||
const { result } = renderHook(() => useAppearance());
|
||||
// Earlier tests leave a sun choice in the module's per-visit fallback.
|
||||
act(() => result.current.setContrast("normal"));
|
||||
|
||||
act(() => result.current.setTheme("dark"));
|
||||
expect(metas.map((meta) => meta.content)).toEqual(["#1a120d", "#1a120d"]);
|
||||
|
||||
act(() => result.current.setTheme("light"));
|
||||
expect(metas.map((meta) => meta.content)).toEqual(["#f9f4ea", "#f9f4ea"]);
|
||||
});
|
||||
|
||||
it("a motion change reaches useEffectiveMotionLevel in the same tab", () => {
|
||||
const effective = renderHook(() => useEffectiveMotionLevel());
|
||||
const appearance = renderHook(() => useAppearance());
|
||||
|
||||
Reference in new issue
Block a user