Repository navigation
desktop: add interface scaling setting - #9666
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d34d5124bc
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a699f832f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e032f3ca7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
LeoBorcherding
left a comment
There was a problem hiding this comment.
Review
At f7bea0d8c5. Codex converged across five rounds, the two P1s got real fixes, and the calc() rewrite of the mac chrome vars is value-preserving at 100%: 110 + 78 = 188, 24 + 34 = 58, matching the old literals. The capability test is a good guard, deleting core:webview:allow-set-webview-zoom now fails a test rather than breaking zoom at runtime.
One thing I'd change before this lands.
25% has no way back. There's no keyboard reset in the diff or on main, so at 0.25 zoom the Settings row you'd use to undo it renders at about 3.5px, and the value is device-local in localStorage. Chrome and VS Code both allow 25%, but both ship Cmd/Ctrl+0. Either raise the floor to something still readable or add a reset accelerator. Your call which, the accelerator is more useful.
Nit, no action needed: in nativeDropPointToCss, Windows reads devicePixelRatio live while macOS and GTK read the cached getAppliedInterfaceZoom(). That's correct, page zoom isn't readable from JS and devicePixelRatio on macOS carries a backing-scale factor NSView points don't have. Worth a comment saying so, so nobody later "fixes" both paths onto devicePixelRatio.
CI is clean. The one red is main's own: Repo tests (CPU) failed on main through 08-25 (45a371ce0, 76e05ba7f, bbcba92a6, 96a0900f4) and this run is from 07:10 that day. Green on main's last 14 completed runs. Merge main and it clears.
LeoBorcherding
left a comment
There was a problem hiding this comment.
Full pass over the diff. Consolidating everything into one checklist so it supersedes my earlier review, nothing there is dropped.
Clean: the Appearance reorg renders every row exactly once, all 12 locales are properly translated rather than English fallbacks, and the reset-all key wiring in general-tab.tsx is correct and test-asserted.
P2: 25% has no way back
INTERFACE_SCALE_RANGE.min is 25 and there's no keyboard reset in the diff or on main. At 0.25, the Settings row you'd use to undo it renders around 3.5px, and the value is device-local in localStorage, so recovery means clearing app data. Chrome and VS Code both allow 25% but both ship Cmd/Ctrl+0.
Either raise the floor to something still readable or add a reset accelerator. Your pick, the accelerator is more useful.
P2: 34 and 78 exist three times with nothing binding them
interface-scale-runtime.ts:5-6 divides by the literals, provider.tsx:468-470 repeats them as CSS fallbacks (var(--studio-native-titlebar-height, 34px)), and interface-scale.test.ts hardcodes 34 / 0.35 as its expectation. Change the mac titlebar height in one place and the other two silently disagree at any zoom but 100%. mac-titlebar-optical-alignment.test.ts only asserts the string in provider.tsx, so nothing fails.
Export both from interface-scale-runtime.ts and build the var(..., Npx) fallbacks from them. That makes the drift impossible rather than tested-around.
P3: native-drop-position.ts:6-7 lost the specifics
The rewrite dropped ScreenToClient device pixels, NSView points and widget coordinates. Those were what let a reader check the math against the platform docs, and they are the reason the two branches of this function are allowed to differ. It is also now the only lowercase comment in the file, ten lines above physicalPerCssPx's capitalized one that the diff leaves alone.
Keeping the old sentence and appending the zoom caveat covers both cases.
P3: native-training-dataset-drop.test.ts:114 deleted the regression it documents
Gone: "scaling those halved every hit test on a HiDPI display and the zone never matched." That is why the test exists. The test body is unchanged in this diff, so the hunk only subtracts. Adding "at 100% zoom" to the old comment would have covered the new behaviour without losing the history.
NIT: the new drop tests never exercise the default argument
Both new cases pass 0.5 explicitly as the third arg, so webviewZoom = getAppliedInterfaceZoom() is never run. That default is the seam between the scale store and the drop path, and it would keep passing if it were wired to the wrong getter. One case without the third argument would close it.
Do not change
The platform split in nativeDropPointToCss is right. Windows reads devicePixelRatio live, macOS and GTK read the cached zoom, and that asymmetry is forced: page zoom is not readable from JS, and devicePixelRatio on macOS carries a backing-scale factor NSView points do not have. Worth a comment saying so, but do not collapse both paths onto devicePixelRatio.
Serialization in applyInterfaceScale is also correct as written. Rapid changes coalesce to the last value because the queued task reads requestedInterfaceScale at run time rather than capture time.
Happy to push any of the above myself if you would rather not, just say which.
…first paint Review follow-ups. The floor moves 25 -> 50. Chrome and VS Code allow 25% but both ship Cmd/Ctrl+0, and there is no reset accelerator here or on main, so at 0.25 the Settings row you would use to undo it renders around 3.5px and the value is device-local in localStorage. A comment says to drop it back to 25 once the accelerator lands. 34 and 78 existed in three places with nothing binding them: interface-scale-runtime.ts divided by the literals, provider.tsx repeated them as CSS fallbacks, and interface-scale.test.ts hardcoded 34 / 0.35. The runtime now exports both the numbers and the var(...) strings built from them, provider.tsx imports those, and the test asserts the fallback is built from the constant rather than retyped. Changing the titlebar height in one place can no longer leave a stale divisor at any scale but 100%. applyInterfaceScale is now wrapped for startup. It was the only thing gating first paint on the Tauri IPC bridge, and a rejection was caught while a hang was not, so a wedged bridge meant a permanently blank window rather than a slow one. Past a 1s deadline the app renders at 100% and the effect in provider.tsx applies the real scale when the bridge answers. Two tests, one with a setZoom that never resolves. The comment on nativeDropPointToCss lost ScreenToClient device pixels, NSView points and widget coordinates in the rewrite. Those are why the two branches are allowed to differ, so they are back, with the zoom caveat appended and a note not to collapse both paths onto devicePixelRatio. Same for the deleted regression note on native-training-dataset-drop.test.ts:114. The new drop tests all passed the zoom explicitly, so the default argument, which is the seam between the scale store and the drop path, never ran. One case now omits it. 4826 frontend tests pass, typecheck, build, i18n:check:strict clean, and provider.tsx gains no new eslint findings.
|
Pushed The 25% call went to the floor, not the accelerator. 34 and 78 are now bound in one place. There was a third copy neither of us counted:
The default argument is exercised now. Every new drop case passed the zoom explicitly, so the New, not in my earlier pass: first paint was gated on the Tauri IPC bridge with no timeout. Two mechanical notes. The first import I wrote tripped Verification: 4,826 frontend tests pass at Correcting myself on CI. I said above that merging main would clear the one red. That is no longer true. Those came in with #9803 and #9830. So do not merge main to clear a red yet, it swaps one main-owned failure for a different one. Worth waiting for main to go green. @codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ants Repo tests (CPU) has been red on this branch since f7bea0d and the log had expired, so nobody had seen why. Two failures, both the same cause: test_desktop_reliability_frontend_contract.py reads px values straight out of provider.tsx, and the calc() rewrite replaced the literals it greps for. test_collapsed_tauri_keeps_history_arrows_and_adds_new_chat_by_model_picker asserted the literal string '"--studio-collapsed-chat-controls-inset": "188px"'. It now resolves the block and asserts the number is 188, scoped to the mac block because the custom titlebar sets the same var to 12px. test_tauri_collapse_removes_the_icon_rail_but_web_keeps_it went through _chrome_style_blocks, whose regex only captured "--var": "literal" pairs, so --studio-desktop-titlebar-height read as absent once it became an identifier and the offset + button <= titlebar assertion had nothing to compare. The helper now also takes templates and identifiers, resolving the latter out of interface-scale-runtime.ts so the 34 stays in one place. _px understands var(--x, Npx) and calc(Apx + var(--x, Bpx)) as their 100% values, with a docstring saying that is the only scale a static read can see. Formatting via scripts/run_ruff_format.py. 36 of 36 in that file pass locally.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
At The full-app screenshot below uses a simulated desktop lifecycle. It shows the added control with a persisted 125% value, not physical zoom. Native macOS geometry, actual OS file dragging, and installer execution were untested. The implemented floor is 50%; the PR description still says 25%. Before: |
|
[P2] Preserve macOS window-button clearance when scaling activates the mobile Navbar At a 900×600-point macOS window, changing Interface scale from 100% to 125% reduces the CSS viewport width to 720px and activates the mobile Navbar. That branch uses The native screenshot below shows the toggle clear of the window buttons on base 100% (left), and visibly overlapping their area on head 125% (right). Both captures use the same native window size; pixels are not resized. Measured native frame intersections corroborate the image:
Please apply the existing zoom-adjusted macOS traffic-light inset to the mobile Navbar branch in Native A/B run and artifacts: base Scope: production components in real Tauri/WKWebView windows on macOS, using a controlled harness. The image demonstrates visual overlap; it does not establish click interception or accidental window closure. |
|
@codex review |
|
Fixed the macOS mobile Navbar overlap reported in #9666 (comment) in Native macOS A/B verification reproduced the original overlap on The run is red because the Typechecking, ESLint, 49 focused frontend tests, and 36 desktop contract tests pass. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 044b44f993
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |


Add a device-local Interface scale control under Settings > Appearance. Desktop users can set the webview scale from 50% to 200% without changing system display scaling.
The setting is sanitized, persisted in local storage, applied before the first render, and updated live through Tauri’s webview zoom API. Reset customization and Reset all to defaults restore 100%. Browser builds hide the desktop-only control.
Screenshots
Before:
After:
Checks
npm test(4,816 passed)npm run buildnpm run typechecknpm run i18n:check:strictcargo check