Skip to content

fix(panel): live-update when unfocused + non-distorting responsive resize (v0.6.2)#16

Merged
mabry1985 merged 1 commit into
mainfrom
feat/panel-focus-responsive-fixes
Jul 1, 2026
Merged

fix(panel): live-update when unfocused + non-distorting responsive resize (v0.6.2)#16
mabry1985 merged 1 commit into
mainfrom
feat/panel-focus-responsive-fixes

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

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:

  • Pin the page focused/visible over CDPEmulation.setFocusEmulationEnabled(true) so the agent's page never throttles rendering based on focus.
  • Headed anti-backgrounding flags--disable-renderer-backgrounding, --disable-backgrounding-occluded-windows, --disable-background-timer-throttling so an occluded headed window keeps drawing.
  • Client visibility handling — on 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.
  • Letterbox-aware input coordinate mapping.
  • Dedupe set_viewport server-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

…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>
@protoquinn

protoquinn Bot commented Jul 1, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@mabry1985 mabry1985 merged commit 9e47628 into main Jul 1, 2026
1 check passed

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 client visibilitychange / focus reconnect+refresh (browser_panel.py:299-302). Each layer is independently correct.
  • Resize fix: object-fit:contain on canvas + letterbox-aware pos() coordinate mapping (browser_panel.py:168,266-271). Math checks out.
  • Viewport dedup via _last_vp tuple in set_viewport (browser_stream.py:255-258) — cleanly prevents identical-resize thrash.
  • Debounce 180→220ms, refresh message dispatch, args reorder in runtime.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.py changes only partially visible. Presumed correct from PR claims.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jul 1, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant