fix: scale-aware viewport units and restore/extend Open editor - #17
Merged
Merged
Conversation
The Text & UI scale control transforms .shell, but every vh/vw value in the stylesheet still measured against the real, unscaled window, so modals, the code pane, and the splash screen stopped lining up with everything else at any scale other than 100%. Introduces --vh/ --vw custom properties (1% of the true viewport divided by the active scale) and rewrites every vh/vw literal to use them, so viewport units scale in lockstep with the rest of the UI.
PR #14 merged an outdated commit of its own branch, so the ExecutablePath-based fix for Open editor never actually reached main even though it shipped in v0.1.15's changelog and its own PR. Restores it, and adds a macOS fallback: when the configured editor's CLI binary can't be found anywhere (for example "code" with the VS Code shell command never installed), launch the application directly with `open -a`, forwarding any extra configured flags via --args.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes bundled together, both regressions/gaps in the last release:
1. Text & UI scale looked "horrible" / didn't shift properly
The scale control transforms
.shell, but the stylesheets usevh/vwin ~60 places (modals, the code pane, splash screen, responsive clamps). Those units always measure against the real, unscaled window regardless of an ancestor'stransform, so at any scale other than 100% those elements stopped lining up with everything else that scales via the transform. Fixed by introducing--vh/--vwcustom properties (1% of the true viewport, divided by the active scale) and rewriting everyvh/vwliteral to use them viacalc(), so viewport units now scale in lockstep with the rest of the UI.2. Open editor still doesn't work on macOS
Root cause turned out to be two separate things:
gh pr view 14 --json commitsshows only 2 commits, not the 3rd one (a56d3d8) that actually contained theExecutablePathfix forOpenInEditor. It shipped in the v0.1.15 changelog and its own now-orphaned branch, but never actually reachedmain. Restored here.codewith no CLI shim installed (VS Code's "Shell Command: Install 'code' command in PATH" never run) has no binary to find anywhere —ExecutablePathcan't invent one. Added a macOS-only fallback: when the binary truly can't be found, launch the application directly viaopen -a "<App Name>"for a short list of common editors (VS Code, VS Code Insiders, Cursor, Sublime Text, Zed, WebStorm, IntelliJ IDEA, Atom), forwarding any extra configured flags via--args.Test plan
go build ./backend/...,go vet ./backend/...go test ./backend/...— restoredTestOpenInEditorUsesExecutablePathFallbacks(lost the same way as the fix itself) and addedTestMacEditorLaunchArgumentsResolvesKnownApplications/TestMacEditorLaunchArgumentsForwardsExtraFlags; the 4 other failing tests are pre-existing/environment-dependent (present onmaintoo)npx tsc -b,npm run build,npm testall cleanmake build(realwails build) succeeds end-to-end