Skip to content

fix(ui): follow the UI scale in card menu, hints and plugin cards; finish the Russian canvas hints - #198

Merged
howdeploy merged 2 commits into
howdeploy:mainfrom
BIackFIame:pr159/ui-scale-ru
Nov 2, 2026
Merged

howdeploy merged 2 commits into
howdeploy:mainfrom
BIackFIame:pr159/ui-scale-ru

Conversation

@BIackFIame

@BIackFIame BIackFIame commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • the terminal card's options menu ("Don't restore this window", plugin card actions);
  • the canvas shortcut-hints panel;
  • the plugin card in Settings → Plugins: only its description scaled; the title, author, version, permission list, contribution rows ("App on canvas"), module and native-hook lists kept fixed 9–17 px sizes, so at 1.25 one card mixed large and small text.

To reproduce, set the scale to 1.25 and open each.

Cause. Their rules used fixed px sizes 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 in em; the hints icon is sized in em too. The plugin card's font sizes use the same calc. At scale 1.0 every size is the same as before. docs/UI_CONTRACT.md 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 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:

  • the canvas hints, the wheel/pinch settings and the navigation override description were partly English ("Перехват wheel/pinch", "Off оставляет обычный wheel/pinch focused input-виджету…", "wheel, pinch и drag … Drag колёсиком"), the capture mode buttons read Off / On / Key, and the hints panel and the shortcut reference showed a hard-coded "Shift + drag";
  • long labels in the canvas navigation rows of Settings → Keyboard shortcuts were cut off;
  • the hints panel showed raw bindings ("Alt+ArrowUp") while the shortcut reference showed "Alt+↑", and the reference showed ",nd+Comma" on macOS for Meta+Comma.

Cause. Missing ru strings, no wrapping on those labels, and raw key names in the hints panel; the reference's formatter replaced "Comma" inside "Command".

Fix.

  • The strings are translated. The capture modes reuse the existing on/off keys and a new canvasWheelCaptureKey; the drag key cap is a new shortcutShiftDrag key, and the hints use one word for the gesture ("перетаскивание"). The group-selection label no longer repeats its key cap (ru/en).
  • The canvas navigation rows wrap instead of cutting their labels off.
  • The hints panel and the shortcut reference share one formatter, 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) and npm run audit:secrets: pass.
  • Full suite: 2699 tests, 2693 pass, 0 fail, 6 skipped (main: 2689 tests, 2683 pass, 0 fail, 6 skipped).
  • Renderer: the eager (startup) bundle, measured the way tests/renderer-bundle-splitting.test.mjs does (production, minified), is 1,050,530 bytes against 1,050,054 on main (+476 bytes, the Russian text; budget 1,100,000). renderer-bundle-splitting passes.

Summary by CodeRabbit

  • Improvements
    • Shortcut hints now use clearer, platform-appropriate key labels and localized text.
    • Canvas wheel-capture options and related settings are localized in English and Russian.
    • Shortcut hints, plugin settings, and menu elements better follow the UI scale setting; long shortcut labels can wrap.
  • Tests
    • Added checks for shortcut translations, key formatting, label wrapping, and UI scaling.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T21:37:19.145954Z 4478ba0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f72e247-f41a-4e64-aa97-a9c5e13c6d05
Commits

Reviewing files that changed from the base of the PR and between 2367505 and 4478ba0.

Files selected for processing: 9
  • docs/UI_CONTRACT.md
  • src/renderer/src/components/ShortcutReference.tsx
  • src/renderer/src/features/settings/SettingsPanel.tsx
  • src/renderer/src/features/workspace/WorkspaceCanvas.tsx
  • src/renderer/src/lib/i18n.ts
  • src/renderer/src/lib/shortcuts.ts
  • src/renderer/src/styles/app.css
  • tests/ru-shortcut-hints-i18n.test.mjs
  • tests/ui-scale-chrome.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

Shortcut hints and canvas settings now use shared shortcut formatting and localized labels. Selected UI chrome and plugin settings now scale with --ui-scale.

Changes: Shortcut presentation and localization

Layer / File(s) Summary
Format and display shortcut bindings
src/renderer/src/lib/shortcuts.ts, src/renderer/src/components/ShortcutReference.tsx, src/renderer/src/features/workspace/WorkspaceCanvas.tsx, tests/ru-shortcut-hints-i18n.test.mjs
A shared formatter displays platform-specific modifier names, commas, and arrow keys. Shortcut reference and workspace hints use the formatter.
Localize shortcut hints and capture settings
src/renderer/src/features/settings/SettingsPanel.tsx, src/renderer/src/lib/i18n.ts, src/renderer/src/components/ShortcutReference.tsx, src/renderer/src/styles/app.css, tests/ru-shortcut-hints-i18n.test.mjs
Wheel-capture choices and shortcut hint text use translations. Settings labels wrap, and tests check the translations and source usage.

UI-scale sizing

Layer / File(s) Summary
Scale chrome and plugin settings dimensions
docs/UI_CONTRACT.md, src/renderer/src/styles/app.css, tests/ui-scale-chrome.test.mjs
The UI contract includes the shortcut-hints panel and terminal-card menu in --ui-scale sizing. CSS scales dimensions for those elements and font sizes for plugin settings. Tests check the scaled declarations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: howdeploy

Merge Risk: Minimal · up to 4478b

No merge-blocking issue was identified in the shortcut localization or UI scaling changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is related to the main changes. It names the UI scale fix for the card menu, hints, and plugin cards, which is the main theme in the summary and objectives. It also names the Russian canvas …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title is related to the main changes. It names the UI scale fix for the card menu, hints, and plugin cards, which is the main theme in the summary and objectives. It also names the Russian canvas hints work, which the summary and objectives describe as a second part of the change. The title is long and combines two topics, but it is accurate and specific enough for a teammate to identify the primary change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 7 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

howdeploy commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Code review is complete at 4478ba0. CodeRabbit reported no actionable findings. In a clean integration checkout with #197, the 17 targeted Node 22 tests, typecheck, and production build passed. The complete non-visual Node 22 suite also finished: 2,699 tests, 2,689 passed, 10 skipped, 0 failed.

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.

@howdeploy
howdeploy merged commit c5731f4 into howdeploy:main Nov 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants