agent-orchestrator/frontend/src/renderer/hooks
Harshit Singh Bhandari acd811dce3
fix(browser): clip preview view to its panel column so it can't render out of bounds (#2203)
* fix(browser): clip preview view to its panel column so it can't paint out of bounds

The inspector's Browser tab hosts a native WebContentsView positioned from the
slot's getBoundingClientRect. That overlay is a window-level layer, so DOM
overflow:hidden never clips it. The slot sits inside the inspector's
min-w-[280px] reflow guard, so on a narrow panel (small window, or mid
collapse/expand) the slot's box spills past its resizable-panel column and the
view paints over the terminal/sidebar, "out of the box" (#2202).

Two fixes in useBrowserView:
- Intersect the measured slot rect with its [data-panel] column before sending
  bounds, so the view can only ever paint inside that column.
- Observe the panel column (not just the slot) with the ResizeObserver. During
  the flex-grow collapse/expand animation the slot's width stays pinned by
  min-w, so a slot-only observer never re-fires and the bounds go stale; the
  column's width changes every frame, so observing it re-measures throughout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore: format with prettier [skip ci]

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-26 19:06:56 +05:30
..
use-mobile.tsx feat(renderer): clone agent-orchestrator shell and inspector 2026-06-11 16:45:00 +05:30
useBrowserView.test.tsx fix(browser): clip preview view to its panel column so it can't render out of bounds (#2203) 2026-06-26 19:06:56 +05:30
useBrowserView.ts fix(browser): clip preview view to its panel column so it can't render out of bounds (#2203) 2026-06-26 19:06:56 +05:30
useDaemonStatus.test.tsx fix: recover terminal reattach after daemon idle (#354) 2026-06-21 13:59:15 +05:30
useDaemonStatus.ts fix: recover terminal reattach after daemon idle (#354) 2026-06-21 13:59:15 +05:30
useEventsConnection.ts feat(frontend): scaffold for frontend with complimentary backend changes (#168) 2026-06-10 11:40:17 +05:30
useNotificationsQuery.ts feat: add desktop notifications v1 (#262) 2026-06-22 01:14:04 +05:30
useResizable.ts feat(renderer): clone agent-orchestrator shell and inspector 2026-06-11 16:45:00 +05:30
useSessionScmSummary.ts feat: surface SCM summaries in desktop (#263) 2026-06-22 00:35:00 +05:30
useTerminalSession.test.tsx fix: keep terminal input sources explicit (#383) 2026-06-23 04:40:09 +05:30
useTerminalSession.ts fix: keep terminal input sources explicit (#383) 2026-06-23 04:40:09 +05:30
useWorkspaceQuery.test.tsx feat: surface SCM summaries in desktop (#263) 2026-06-22 00:35:00 +05:30
useWorkspaceQuery.ts fix(preview): add clear, reuse defaults, force refresh, local files (#379) (#380) 2026-06-22 16:04:29 +05:30