fix(panel): live-update when unfocused + non-distorting responsive resize (v0.6.2)#16
Merged
Merged
Conversation
…size (v0.6.2)
Two field-reported issues.
1. "Only live-navigates when the view is focused." The screencast stalled unless the
panel had focus. Fixed defensively across the plausible causes:
- Pin the page focused/visible over CDP (Emulation.setFocusEmulationEnabled) so it
never throttles rendering when the operator's console view isn't the focused one.
- Headed windows launch with anti-backgrounding flags
(--disable-renderer-backgrounding, --disable-backgrounding-occluded-windows,
--disable-background-timer-throttling) so an occluded window keeps drawing.
- The panel reconnects (if the socket dropped) / forces a fresh frame on
visibilitychange + focus, so switching back snaps to current instantly.
2. "Responsive is buggy." Root cause: the canvas stretched the old-aspect frame while
the viewport round-tripped, so it distorted; and a drag re-armed the screencast on
every observation.
- canvas object-fit: contain — letterbox during the catch-up instead of distorting.
- letterbox-aware input coordinate mapping.
- dedupe set_viewport server-side (skip unchanged size) + debounce 180→220ms.
No stream regression: nav still paints every page, resize still reshapes to the dock
(validated live). 47 host-free tests pass; ruff clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #16 | fix(panel): live-update when unfocused + non-distorting responsive resize (v0.6.2)
VERDICT: WARN
CI Status
- test: queued
⚠️ CI non-terminal — re-review required once tests complete.
Diff Review
- Three-defence focus fix: CDP
Emulation.setFocusEmulationEnabled(browser_stream.py:257), headed anti-backgrounding Chrome flags (runtime.py:30-34), and clientvisibilitychange/focusreconnect+refresh (browser_panel.py:299-302). Each layer is independently correct. - Resize fix:
object-fit:containon canvas + letterbox-awarepos()coordinate mapping (browser_panel.py:168,266-271). Math checks out. - Viewport dedup via
_last_vptuple inset_viewport(browser_stream.py:255-258) — cleanly prevents identical-resize thrash. - Debounce 180→220ms,
refreshmessage dispatch, args reorder inruntime.py— all low-risk supporting changes.
Observations
- LOW: Clawpatch structural review unavailable for this repo (not in mounted set). Diff-only review; no cross-file analysis possible.
- GAP: CI still queued — 47 claimed tests not yet verified. Re-review on terminal CI before merge.
- GAP: Test diff truncated in preview —
tests/test_agent_browser.pychanges only partially visible. Presumed correct from PR claims.
— Quinn, QA Engineer
|
Submitted COMMENT review on #16. |
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.
Two field-reported issues with the interactive panel.
1. "Only live-navigates when the view is focused"
The screencast stalled unless the panel had focus. Since the exact cause depends on the setup (headed window occlusion vs. console-iframe backgrounding vs. page-focus throttling), fixed defensively across all three:
Emulation.setFocusEmulationEnabled(true)so the agent's page never throttles rendering based on focus.--disable-renderer-backgrounding,--disable-backgrounding-occluded-windows,--disable-background-timer-throttlingso an occluded headed window keeps drawing.visibilitychange/focus, reconnect if the socket dropped, else force a fresh frame so switching back snaps to current instantly.2. "Responsive is buggy"
Root cause: the canvas stretched the old-aspect frame while the viewport round-tripped (resize → CDP → new frame), so it distorted; and a drag re-armed the screencast on every observation.
canvas { object-fit: contain }— letterbox during the catch-up instead of distorting.set_viewportserver-side (skip unchanged size) + debounce 180 → 220ms.Validation
No stream regression — nav still paints every page, resize still reshapes to the dock (900×1200), both re-checked live. 47 host-free tests pass, ruff clean (new: headed anti-throttle args, headless-clean argv, page visibility/refresh + object-fit wiring).
Note
The headed anti-backgrounding flags only take effect on a fresh session launch. If the browser is already running, close it (
browser_close) and reopen so the flags apply.🤖 Generated with Claude Code