Repository navigation
test(support): narrow-frame helper compares with clientWidth, not innerWidth (#318) - #337
Merged
Merged
Conversation
…318) Same measure (scrollWidth against innerWidth), now callable after a page in the frame changes, so the next commit's example can overflow it by a few pixels. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…erWidth (#318) innerWidth includes the frame's classic 15px scrollbar, so a page scrolling sideways by up to that much passed whenever the frame scrolled vertically. The new example overflows the sign-in page by 5px under a vertical scrollbar: red on the old comparison (expected false, got true), green now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rollbar widths, sign-up page (#318) Review fixes: YARD tags on open_in_narrow_frame and narrow_frame_fits?, the scrollbar is about 12 to 15px by platform, the example opens the sign-up page (first run redirects the sign-in page), and the memory note no longer lists the trap as open. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…low (#318) For the checks that run inside within_narrow_frame or on the top page. The example was red (undefined method) before it; narrow_frame_fits? now enters the frame and calls it, so the clientWidth comparison has one home. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…elpers (#318) Their own fits? and frame_fits? compared scrollWidth with innerWidth, the trap of the helper's fix. They now call page_fits_sideways? and narrow_frame_fits?. 91 examples green before and after: nothing was hiding in these files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ways? (#318) Ten inline scrollWidth <= window.innerWidth expectations, same trap as the helper's. 103 examples green before and after. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…Width (#318) Six checks that sit in a script's result object, so they can't call the Ruby helper, now read documentElement.clientWidth. 99 examples green before and after. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e's viewport (#318) open_in_narrow_frame's width includes the classic scrollbar, so its 360px frame lays a page out in about 345px. The new helper sizes the frame as the viewport plus the measured scrollbar, as deck_shape_panel_spec's open_fold_in_frame does. Its example was red (undefined method) first. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…0px viewport (#318) fits? and two element-edge checks compared with innerWidth. With clientWidth, 3 examples failed at the 360px frame (AC-5.4/5.5 light and dark, and the zone head one): the frame lays out in about 345px and the worst-case row's table spills 10px past it, the spill spec 074 recorded at a true viewport. They now open the frame as a 360px viewport (open_in_viewport_frame, 360 + measured scrollbar) and pass, 29 examples. No page changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e 360px viewport (#318) With clientWidth the AC-5.1 example failed at the 360px frame (light and dark): the frame lays out in about 345px and the zone table's worst-case row spills 10px past it, not the mana bar. It now opens a 360px viewport (open_in_viewport_frame) and passes, 29 examples. Minimal edit: #330 adds examples to this file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two element-edge checks (the title's and the sentence's right edge) read window.innerWidth, the same blind spot as the overflow checks. 15 examples green. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…port, not the frame (#318) footer_spec compared the footer text's right edge with the frame's width minus the gutter, which includes the scrollbar (a variant of the trap that no innerWidth grep finds): it now reads clientWidth. scanner_sitting_spec compared scrollWidth with 360/390, the same weak copy: three checks call page_fits_sideways?. 58 examples green across the four files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ck page's two 360px kinds, memory (#318) The viewport helper's comment says the caller asserts the width it returns; its example shows the overflow is under the scrollbar; deck_page_spec's header says which 360px each group uses and the spill is 7 to 10px by platform; the memory note names page_fits_sideways? and open_in_viewport_frame. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…unning (#318) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…318) open_phone_frame and open_fold_in_frame repeated its scrollbar measuring; they now call it and open the fold afterwards. Deferred until #330 (spec 078) merged, as the PR said. deck_shape_panel_spec and deck_page_spec: 66 examples green. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Closes #318
What
The narrow-frame test helper reported "fits" as
documentElement.scrollWidth <= innerWidth.innerWidthincludes the frame's classic scrollbar (15px on a Mac, about 12px on CI, pinned in system specs by #271), so a page overflowing sideways by up to that much passed whenever the frame scrolled vertically. Spec 072's review found the trap; this closes it. Test support only: no app code, no page changes, so no screenshots.Routing (ruled by the coordinator, 2026-11-12): a direct fix, no spec. The maintainer ruled the sweep of the same trap in the other specs (option A) part of this PR.
Changes (one commit each, red first where it applies)
spec/support/narrow_frame.rb:page_fits_sideways?is the one measure (scrollWidth <= clientWidth, for the page the driver is in),narrow_frame_fits?enters the frame and calls it,open_in_narrow_framereturns the same[innerWidth, fits]as before.open_in_viewport_frame(path, viewport:, ready:)opens a frame whose viewport is the width asked for (viewport + the measured scrollbar), asopen_fold_in_framedoes in the shape panel spec.spec/system/narrow_frame_spec.rb(4 examples): a 5px sideways overflow under a vertical scrollbar. Red on the old comparison (expected false, got true, preconditions asserted: scrollbar wider than 5px, overflow exactly 5px), green onclientWidth. The two later helpers were each red first (undefined method).scrollWidth <= window.innerWidthchecks and 4 element-edgeright <= window.innerWidthchecks across 21 spec files, swapped to the shared helpers or toclientWidthin place; nine specs' ownfits?/frame_fits?methods deleted.footer_spec(the footer's right edge against the frame width minus the gutter) and threescanner_sitting_specchecks against the literal 360/390 were the same trap without the wordinnerWidth; the second review round found them.deck_page_spec.rbx3 (AC-5.4/5.5 light and dark, and the zone-head one) anddeck_shape_panel_spec.rbx2 (AC-5.1 light and dark). It is not a page bug and not the mana bar: a 360px frame with a classic scrollbar lays out in about 345px (348px on CI), and the zone table's worst-case row (60-character name, six-symbol cost, 1,234 proxies) is 355px wide there, 7 to 10px over. Spec 074 (decision 6, AC-1.15) recorded that this spill does not scroll the document at a true 360px viewport. They failed at 345px and pass at a true 360px viewport (open_in_viewport_frame); the 640, 768 and 1280px cases stay fixed frames. The edit indeck_shape_panel_spec.rbis minimal (Deck shape mana bar: a label wider than its segment wraps and is cut off #330 adds examples there)..claude/memory/headless-firefox-narrow-frame.mdupdated; lessondocs/lessons/2026-11-12-sweep-a-measurement-trap-by-swapping-and-running-not-by-grep.md.Evidence
open_in_narrow_framepassed withclientWidth, 0 failures, 3 min 25 s. Nothing was hiding behind the helper.footer_spec,scanner_sitting_spec,narrow_frame_spec,deck_page_spec: 58 examples, 0 failures.ff8ddbfa(run 43234966773): all jobs pass, the four RSpec shards 1200 + 1109 + 1194 + 1037 = 4,540 examples, 0 failures, 2 pending. The pre-push fullbin/cipassed on both pushes.menu_tab_bar_clearance_spec.rb:334("restores a page from Turbo's cache with every menu closed and the scroll it had",scroll_y0 vs 498.75, seed 14592). It passed alone, and the whole file passed with the same seed (29 examples). This branch touches no app code and not that spec; recorded here, and as an issue only if it recurs.Reviews (read-only, Opus)
footer_specgutter check, fixed), minors fixed (scanner leftovers, the viewport helper's contract in its comment, the example asserting the overflow is under the scrollbar,deck_page_specheader saying which 360px each group uses, memory note). Deferred until Deck shape mana bar: a label wider than its segment wraps and is cut off #330 merged, then done:open_fold_in_frameandopen_phone_frameindeck_shape_panel_spec.rbrepeatedopen_in_viewport_frame; after A mana bar label fits its segment or isn't drawn (spec 078, #330) #336 (spec 078) landed they call it (a small commit on the merged branch,deck_shape_panel_spec.rbanddeck_page_spec.rb: 66 examples green, spec 078's included).Merged main
origin/main(2780c1b4, #336 spec 078) merged into the branch with a merge commit, no conflicts; no newinnerWidthcheck came in with it.Owed to the maintainer
🤖 Generated with Claude Code