Repository navigation
Fix #221: wait for viewport reset layout propagation - #223
Merged
Merged
Conversation
Poll layout metrics after clearing an attached tab override, with a one-second best-effort bound. Keep equal natural sizes ambiguous rather than reporting a failed reset, and preserve lost-debugger recovery. Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
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. |
Replace guessed zoom and scrollbar allowances with an actual CSS layout baseline. Share one bounded observation window across the pre-clear read and post-clear polling, and still clear when the baseline is unavailable or unanswered. Preserve debugger-loss recovery and cover wide scrollbars, two gutters, stalled reads and natural equality. Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)
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
Closes #221.
Before clearing an attached tab's viewport override, observe its actual CSS layout with
Page.getLayoutMetrics; after the clear, poll every 10 ms until either dimension differs. This avoids guessing how page zoom or scrollbar gutters change the requested override size. The pre-clear observation and post-clear polling share a 1,000 ms budget, including unanswered reads; the clear itself retains its existing await/error semantics.The host cannot know the natural view bounds. Equal natural/overridden layouts therefore return successfully at the bound, with a diagnostic naming the last observation rather than a false restoration-failed alarm. An unavailable baseline never prevents the clear, unattached tabs do not poll, and debugger loss retains the existing recovery path.
Verification
env -u CUA_FEEDBACK_DIR npm test— 3,998 passed, 172 skipped, 0 failed (4,170 tests total). Local Node 22 and runtime-only dependencies skip own-REPL/optional-package tests; PR CI runs Node 24 with full dependencies.serve-lazy.test.mjs; the affected file passed 29/29 with the opt-in unset. Recorded the condition and workaround in Friction tracker (moved to ~/.claude/friction-tracker/cua/) #177.Independent review
doperpowers:reviewer-mediumfound one actionable P2 on the initial range: fixed scrollbar tolerance could misclassify the old layout as restored. A separate fix wave replaced that predicate with the observed pre-clear baseline inafb007d0. Follow-up review verified both original reproductions and returned correct — no material findings. Not merged.Sminos-Session: cua_repl#1ea561bc (MAWS on macbook)