Repository navigation
fix(ui): follow the UI scale in card menu, hints and plugin cards; finish the Russian canvas hints - #198
Conversation
…e UI scale
Some UI chrome kept fixed pixel sizes, so Settings -> Appearance -> UI
scale (0.85-1.25) did not reach it:
- The terminal card's options menu (Don't restore this window, plugin
card actions) had a 12px font and pixel paddings while the card header
around it scaled.
- The canvas shortcut-hints panel looked the same at 0.85 and 1.25.
- In Settings -> Plugins the plugin description scaled with the settings
panel, but the permission list, the contribution rows ("App on
canvas"), the plugin title, author, version, buttons, module and
native-hook lists kept fixed 9-17px sizes, so at 1.25 one card mixed
large and small text.
The menu and the hints panel now take their font size from
calc(Npx * var(--ui-scale, 1)) and size their paddings, gaps, radii and
minimum widths in em; the hints icon is sized in em too. The plugin
settings font sizes use the same calc. At scale 1.0 every size is the
same as before. UI_CONTRACT names the menu and the hints panel among the
chrome that follows --ui-scale.
The title bar is left as is: its height is shared with the native
window chrome (macOS traffic-light position, the startup page) and with
every viewport-bound overlay through --titlebar-height.
…like the reference
The Russian canvas hints and Settings still showed English: the
wheel/pinch hint, the hard-coded "Shift + drag" key cap in the hints
panel and the shortcut reference, the canvas navigation override
description ("wheel, pinch и drag ... Drag колёсиком") and the
Settings > Canvas wheel capture strings and Off/On/Key labels.
- Translate them, reusing the existing on/off keys and adding
shortcutShiftDrag and canvasWheelCaptureKey; the hints use one word for
the drag gesture ("перетаскивание"). The group-selection label no
longer repeats its key cap (ru/en). A test checks that these ru strings
hold no Latin words besides key names.
- The wheel/pinch and navigation override rows in Settings > Keyboard
shortcuts wrap instead of cutting their longer Russian labels off.
- The hints panel showed raw bindings ("Alt+ArrowUp") while the shortcut
reference showed "Alt+↑". Both use one formatter now. It maps key by
key, so on macOS "Meta+Comma" reads "Command+," instead of the
reference's ",nd+Comma" (the Comma key was replaced inside "Command").
The strings stay in the shared string table, where the settings search
looks them up by key.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@coderabbitai full review |
Action performed
|
|
Code review is complete at This PR changes UI scale, layout, and visible text. It remains open pending the owner's hands-on visual acceptance; no merge approval is implied by the automated results. |
Split out of #159 and rebased on current main (2367505): fixes 6 and 7 of #159, unchanged in substance; where main's newer code required it, the change is adapted to it, as noted below. Small and independent; it does not depend on the other parts of #159.
1. Parts of the UI ignored the UI scale (fix 6 of #159)
Problem. At Settings → Appearance → UI scale 0.85 or 1.25, these stayed at 1.0:
To reproduce, set the scale to 1.25 and open each.
Cause. Their rules used fixed
pxsizes instead of--ui-scale.Fix. The menu and the hints panel take their font size from
calc(Npx * var(--ui-scale, 1))and size their paddings, gaps, radii and minimum widths inem; the hints icon is sized inemtoo. The plugin card's font sizes use the samecalc. At scale 1.0 every size is the same as before.docs/UI_CONTRACT.mdnames the menu and the hints panel among the chrome that follows--ui-scale. The title bar is left as is: its height is shared with the native window chrome and every viewport-bound overlay through--titlebar-height.Test. New
tests/ui-scale-chrome.test.mjs(3 tests). On 2367505 without the fix all 3 fail; with it they pass.2. Untranslated text in the Russian canvas hints and wheel settings; wrong key caps (fix 7 of #159)
Problem. With the app in Russian:
Cause. Missing
rustrings, no wrapping on those labels, and raw key names in the hints panel; the reference's formatter replaced "Comma" inside "Command".Fix.
canvasWheelCaptureKey; the drag key cap is a newshortcutShiftDragkey, and the hints use one word for the gesture ("перетаскивание"). The group-selection label no longer repeats its key cap (ru/en).displayShortcutBinding. It maps key by key, so "Meta+Comma" reads "Command+," on macOS and "Alt+ArrowUp" reads "Alt+↑".The strings stay in the shared string table: the settings search on main looks them up by key, and this keeps its results in sync with the Settings labels.
Test. New
tests/ru-shortcut-hints-i18n.test.mjs(7 tests): the ru hint, reference and canvas wheel/navigation strings hold no Latin words besides key names; no hard-coded option labels or gesture words in key caps; one word for the drag gesture; the shared formatter; the wrapping rule. On 2367505 without the fix all 7 fail; with it they pass.Verification
npm run build(typecheck) andnpm run audit:secrets: pass.tests/renderer-bundle-splitting.test.mjsdoes (production, minified), is 1,050,530 bytes against 1,050,054 on main (+476 bytes, the Russian text; budget 1,100,000).renderer-bundle-splittingpasses.Summary by CodeRabbit