From 3c0fced848df3eb0ead9d9b899a33066854e77ce Mon Sep 17 00:00:00 2001
From: AAA <35992542+TNTcraftHIM@users.noreply.github.com>
Date: Sun, 1 Nov 2026 09:30:11 -0400
Subject: [PATCH] fix(ui): keep narrow headers in one row with overflow options
---
docs/standards/visual-language.md | 5 +-
src/client/components/living/Header.tsx | 102 +++++++++++++++++-------
src/client/locales/en.ts | 1 +
src/client/locales/zh.ts | 1 +
src/client/styles.css | 38 +++++----
5 files changed, 101 insertions(+), 46 deletions(-)
diff --git a/docs/standards/visual-language.md b/docs/standards/visual-language.md
index 954038145..f355fd363 100644
--- a/docs/standards/visual-language.md
+++ b/docs/standards/visual-language.md
@@ -101,8 +101,9 @@ of a circle. Header utilities share compact alignment and icon scale with the
language track. Low-frequency help stays unframed and quiet; it need not carry
the outline or shadow of direct settings. Narrow layouts shorten captions or
spacing before changing that hierarchy.
-Keep App, language, theme and help together; narrow room headers place connection
-status beside the brand above this utility group instead of wrapping each action.
+Keep desktop App, language, theme and help together on the right. Narrow headers
+retain one row with the brand/back action, signaling dots, App and More; language,
+theme and help share that attached disclosure without duplicating their controls.
`segmented-control.css` owns the sliding treatment for language, mode selection,
tabs and native radio groups. Consumers supply selection and layout; they must
not duplicate the selected colours or press animation. Language choices keep
diff --git a/src/client/components/living/Header.tsx b/src/client/components/living/Header.tsx
index 0867644e9..e94efcb1e 100644
--- a/src/client/components/living/Header.tsx
+++ b/src/client/components/living/Header.tsx
@@ -1,5 +1,5 @@
// App header: brand mark, LED connection state, language selection and theme.
-import { useId, useRef, useState, useSyncExternalStore, type ComponentProps } from "react";
+import { useId, useLayoutEffect, useRef, useState, useSyncExternalStore, type ComponentProps } from "react";
import { createPortal } from "react-dom";
import { browserDebugEnabled, debugError, downloadBrowserDebug, withBrowserDebug } from "../../lib/debug";
import { BrandMark } from "./BrandMark";
@@ -85,15 +85,35 @@ const webVersion = import.meta.env.VITE_PIIK_VERSION ?? "development";
const webRelease = /^v\d+\.\d+\.\d+$/.test(webVersion)
? `https://github.com/TNTcraftHIM/Piik/releases/tag/${webVersion}` : null;
-function BrowserHelpMenu() {
+function BrowserHelpContent({ active }: { active: boolean }) {
const { lang, vis, t } = useCopy();
+ const guide = useProjectLink(`/docs/${lang === "zh" ? "zh/" : ""}troubleshooting.html`,
+ `https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/troubleshooting${lang === "zh" ? ".zh-CN" : ""}.md`, active);
+ return