Fix terminal display calibration under canvas zoom#218
Merged
DeadWaveWave merged 2 commits intomainfrom May 1, 2026
Merged
Conversation
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.
💡 Change Scope
📝 What Does This PR Do?
Fixes terminal display calibration auto-reference when the workspace canvas is zoomed, and stabilizes terminal zoom-settle behavior so embedded terminal content no longer intermittently “twitches” in size during viewport zoom.
The calibration fix now makes automatic shared-reference capture use the same stable baseline measurement contract as manual
Set Reference, instead of sampling transformed live terminal metrics. The zoom fix keeps DPR/output sync deferred until viewport interaction settles, reducing repeated content-size churn during active zoom gestures.This PR also adds regression coverage for the zoomed auto-calibration path and hardens two unrelated drag E2Es that flaked during validation.
🏗️ Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
2. State Ownership & Invariants
terminalDisplayReferencepersistence; mounted terminal measurements are runtime observations only.3. Verification Plan & Regression Layer
tests/unit/contexts/terminalDisplayReferenceAutoCapture.spec.tsxanduseTrackpadGestures.spec.tsxcover the new auto-capture contract and settle timing.tests/e2e/settings.terminal-display-calibration.spec.tsto prove auto shared reference matches manual capture under zoom.tests/e2e/workspace-canvas.terminal-device-pixel-ratio.spec.ts,tests/e2e/workspace-canvas.trackpad-gestures.spec.ts, and repeatedworkspace-canvas.persistencereload verification cover the zoom/twitch path.workspace-canvas.sidebar-drag-reorder.spec.tsandworkspace-canvas.spaces.overlay-drag.spec.tsnow use stable client-rect drag points and longer settle windows.✅ Delivery & Compliance Checklist
pnpm pre-commitis completely green.CLA.md).DEVELOPMENT.mdarchitectural boundaries.Current validation note: all terminal-related unit/E2E coverage listed above passed locally. Full
pnpm pre-commitwas blocked by unrelated agent E2E failures outside this change scope, includingworkspace-canvas.agent-last-message-copy.opencode.spec.tsandworkspace-canvas.agent-status-watcher.spec.ts.📸 Screenshots / Visual Evidence
Not attached in the CLI-created PR body. Terminal-specific Playwright evidence is available locally from validation runs, and I can add UI captures in the GitHub UI if needed.