diff --git a/.claude/memory/headless-firefox-narrow-frame.md b/.claude/memory/headless-firefox-narrow-frame.md index 6b65c69b..4df89b4d 100644 --- a/.claude/memory/headless-firefox-narrow-frame.md +++ b/.claude/memory/headless-firefox-narrow-frame.md @@ -7,7 +7,7 @@ metadata: Headless Firefox (Selenium, system specs and screenshot scripts) clamps the window to at least 500px wide. A `driven_by … screen_size: [390, 844]` driver actually renders at 500px, so phone-width assertions silently test the wrong layout. -- **Specs:** use `spec/support/narrow_frame.rb` (`open_in_narrow_frame(path, width:, height:, ready:)` returns `[innerWidth, no_horizontal_overflow]`, and `within_narrow_frame { … }`) with the normal driver. Media queries and container queries evaluate against the iframe's own width. Prove each narrow assertion by breaking the CSS once. Touch-target and coarse-pointer rules still can't be tested this way. The window must be taller than the frame: links below the window's bottom edge can't be clicked, and the click silently does nothing (seed 12061, 2026-10-31). +- **Specs:** use `spec/support/narrow_frame.rb` (`open_in_narrow_frame(path, width:, height:, ready:)` returns `[innerWidth, no_horizontal_overflow]`, where "no overflow" compares `scrollWidth` with `clientWidth` since #318, and `narrow_frame_fits?` re-measures from the top page after a change inside the frame; `page_fits_sideways?` is the one overflow measure for the page the driver is in, top page or inside `within_narrow_frame`, so never write `scrollWidth <= innerWidth` again; `open_in_viewport_frame(path, viewport:, ready:)` opens a frame whose viewport is the width asked for and returns the viewport it got, which the example asserts; `within_narrow_frame { … }`) with the normal driver. Media queries and container queries evaluate against the iframe's own width. Prove each narrow assertion by breaking the CSS once. Touch-target and coarse-pointer rules still can't be tested this way. The window must be taller than the frame: links below the window's bottom edge can't be clicked, and the click silently does nothing (seed 12061, 2026-10-31). - **Screenshots:** inject a fixed-width iframe on a same-origin page, grow the frame to its content height, resize the window taller than the frame, then take an element screenshot of the frame. Without the taller window only the visible part is captured. - Separately named drivers (`options: { name: :firefox_dark }`) are still needed for different Firefox prefs, e.g. the dark theme, because Capybara reuses sessions by driver name. @@ -20,4 +20,4 @@ Related: [[pr-screenshots-workflow]]. - Measure related boxes in one script call. Two calls raced on the scanner page, which grows while the camera starts. - **Keyboard-only selects (spec 041, 2026-11-06):** under WebDriver in headless Firefox, arrow keys don't change a closed `