Commit Graph
2 Commits
Author SHA1 Message Date
yetone f36e744c30 gui: Settings › General says each setting's name alone where it says enough, and Language is one menu (1ooogle on X)
1ooogle's mockup on X redrew Settings › General the way macOS System
Settings reads it. The owner approved, and this follows it.

Rows that now show only their name:
- Appearance, Text size, Interface and Code font, the tray click,
  Provider in model names, the Codex titles, auto-review and memories
  model rows, Open at login and Show in Dock.
- A font row's line shows only while its fonts are loading or have
  failed.
- The text size keys (⌘0 / Ctrl+0) move into the choices' tooltip.

Rows that keep one short line, because the name alone doesn't explain
the setting or what it costs:
- Codex subagents, Long conversations, Lightweight mode, Prevent sleep
  and Session terminal.

Renames:
- "Tray icon" becomes "Click the tray icon to", with the choices "Open
  the quick panel" and "Open the main window" (点击托盘图标: 打开快捷面板 /
  打开主窗口).
- "Keep awake while agents work" becomes "Prevent sleep" (防止休眠: 在
  magpie 运行任务时,让电脑保持唤醒状态).
- "Dock" becomes "Show in Dock" (显示程序坞).

Language is one button showing the language picked (renderLangPick).
It opens in the app's own menu (openProtoMenu, styled like Session
terminal's sess-pick), not a native <select> and not six segments.

Every language gets the same text: en, zh, zh-TW, ja and de. The 25
strings no longer used are removed from all four translations.

Tests:
- New: settings-general.test.cjs. In Chromium and WebKit, en, zh,
  zh-TW, ja and de, at 1000 and 440 px, on a Mac, it checks that:
  - the rows that should show only their name have no line;
  - the kept lines are one line each, and none is cut short at 1000px;
  - Language is a button showing the language, and its menu lists all
    six;
  - a pick saves lang and redraws the page in that language, with the
    button staying under the pointer;
  - nothing has a left stripe and nothing scrolls sideways.
  I broke it by hand twice and saw it fail both times: once by giving
  the Dock row a line back, once by making the pick save nothing.
- Updated to the new text and controls: codex-titles,
  codex-auto-review, codex-memories-settings, model-suffix-own,
  plain-names, lightweight, keep-awake, text-size, gateway-mode,
  omarchy, settings-search, gui-zh-tw (Language's button and menu fit
  at 1000/440px), header-relang (picks through the menu) and
  readable-focus (the first shown line).
- German's long-conversations line was shortened to fit on one line at
  1000px.

What was run:
- go test -tags nogui ./internal/gui passes; gofmt -l is clean; go vet
  passes on darwin, linux and windows.
- The whole GUI suite (601 files, --test-concurrency=4): 6584 passed,
  33 failed. Every failing file was then run alone:
  - mobile-web fails on purpose. It compares desktop screenshots with
    origin/main, and only the Settings page differs.
  - routing-group-fold, text-size, routing-sessions and pick-skills
    are #1672; searcher-pick is #1745. Each also fails alone on
    origin/main 260ded9af.
  - routing-provider-off, routing-steady and usage-sum-whole pass when
    run alone, both here and on main.
- Screenshots before and after (zh, en and de light at 1000px, zh at
  440px, zh dark) were looked at.

Not tried in the real Wails window.
2026-10-12 22:51:53 +08:00
yetone e4aadb4840 gui: the header is fitted again when the language or the interface font changes, so the tabs no longer run under the magpie and the traffic lights (kiwiflysky on X)
With a wide interface font, the macOS window's header fit in Chinese but not
in English, Japanese or German: the tabs slid left under the magpie and the
window's buttons, and in German into the refresh button and the gear.
fitTop draws the header in step by step (tight, cramped, inrow, crowded,
packed), but it only ran again when .top, .brand or .actions changed size
(ResizeObserver) and once on document.fonts.ready. Another language or a
font picked later changes only #nav's width, so the header kept the fit it
had for the old one.

Now translateStatic (every language change) and desktopFonts.apply (every
font applied: picked, saved in the other webview, from settings) call
fitTop, and document.fonts' loadingdone does too, for a font still loading
when it's applied. Both run synchronously, where the change happens. A
ResizeObserver on #nav was tried first. It had to defer to a frame, since
fitting resizes the nav and WebKit reports that loop as a page error, and the
deferred refit moved the page after a click: text-size, number-units,
tray-logos and rail-tip went red. That approach was dropped.

Measured (830px, macOS window, before): switched live to en, ja and de, the
tabs ran 61, 105 and 148px under the magpie (Chromium and WebKit alike).

header-relang.test.cjs (new):
- Opens a macOS window in Chinese, with the header's tabs picked over the
  sidebar.
- Switches it from Settings to en, zh-TW, ja, de and back.
- In English, on the Agents page, it hands in Menlo at each width from 1000
  to 640px. Each fit must equal a fresh fitTop.
- Sweeps each language from 1100 to 600px: 7.5px clear of the magpie or
  padding and of the buttons.
- Chromium and WebKit.

Run on this commit:
- header-relang: 12/12 in Chromium and WebKit. Red on origin/main 781cb386c
  (en -61.5, ja -104.6, de -148.0 before the rebase onto the sidebar; ja
  -50.8, de -94.3 after it). Red with only the language hook removed (2
  subtests). Red with only the font hook removed (5 subtests:
  "top tight" where a fresh fit is "top tight cramped").
- Header, font, click-scroll and language neighbours: 77/77.
- text-size, number-units, tray-logos, rail-tip and menu-scroll alone: pass.
- Full GUI suite, concurrency 3, rebased on 781cb386c: 6261/6347. Each of
  the 19 failing files was run alone with this change and without it, at
  the same tree; the counts were the same (a few ±1 each way).
- On 6ebe481f8, after 054bdb8bb's sidebar fixes, 5 files are still red with
  or without this change: routing-group-fold, text-size (foot of the page),
  routing-sessions, pick-skills, otel. Filed as #1672.
- go test ./internal/gui/: TestPanelCloseHidesIt and
  TestTrayCellClickReleasedPanel fail the same on a fresh origin/main
  94fd332c3 (#1664, #1661). Everything else is ok.

Not done: in German the Settings page's sub-tabs wrap to two lines, and in
English and Japanese the "Find a setting" box drops to its own row. That is
wrapping, not overlap, and left for its own change. Beside the sidebar (from
1024px, the default since 18e82adc6) the header has no tabs. Checked by
screenshot in de with Menlo at 1100 and 1024px: nothing overlaps.
2026-10-12 03:28:42 +08:00