Skip to content

feat(webui): browser preview as top-right terminal overlay + session-scoped, ephemeral thumbnails#162

Merged
edwin-zvs merged 2 commits into
mainfrom
webui-preview-overlay
May 23, 2026
Merged

feat(webui): browser preview as top-right terminal overlay + session-scoped, ephemeral thumbnails#162
edwin-zvs merged 2 commits into
mainfrom
webui-preview-overlay

Conversation

@edwin-zvs

@edwin-zvs edwin-zvs commented May 23, 2026

Copy link
Copy Markdown
Contributor

Make the web UI's browser thumbnail render like the desktop TUI — a top-right overlay over the terminal screen with autohide + close — and then make thumbnails behave consistently across the TUI and webui: per-session overlay, cross-session matrix-rain wallpaper, and ephemeral (live-only) lifecycle.

Overlay (TUI parity)

  • #browserPreview moves inside #terminalWrap as a position:absolute overlay anchored top-right (z-index above the scroll buttons), instead of a flex sibling below the terminal. The terminal reclaims that vertical space and the preview floats over it.
  • Added a caption (page title / url) under the thumbnail and a × close button.
  • Autohide after ~7s (matches the TUI's BROWSER_PREVIEW_TTL); hovering pins it (clears the timer); × dismisses it.

Scoping + lifecycle

  • In-session overlay is scoped to the displayed session (TUI reads selected_id; webui reads currentId) — switching sessions hides it.
  • Matrix-rain wallpaper is cross-session: it now tracks the latest browser preview from any session (the rain is a fleet visualization), rather than only the focused session.
  • Previews are ephemeral / live-only: they are no longer reconstructed from the transcript on either client.
    • TUI: dropped browser_preview from hydration + reconnect replay (apply_transcript_to_local_state no longer takes/returns it).
    • Webui: renderEvent and replayTranscriptToTerm no longer call setBrowserPreview during transcript replay; the live WS path (handleNotification) is the sole setter.
    • Result: a TUI/webui restart or reconnect won't resurrect a stale thumbnail, and once closed it's gone.

Verification

  • web_smoke (real headless Chrome): overlay is a child of #terminalWrap, position:absolute at top:8px, renders the base64 image + caption, has a close button; × hides and forgets the stored entry; and replaying the event through the transcript path does NOT resurrect the thumbnail.
  • CLI unit tests: matrix_rain_paints_browser_preview_wallpaper extended to assert a non-selected session's preview still paints the rain wallpaper (cross-session).
  • Full workspace cargo build --workspace --all-targets --locked + cargo test (cli + e2e) green locally.

🤖 Generated with Claude Code

The web client rendered the browser thumbnail in a separate strip between
the terminal and the input/keyboard. Move it to a top-right overlay over
the terminal screen — mirroring the desktop TUI — with a caption, a close
(×) button, and autohide.

- `#browserPreview` now lives inside `#terminalWrap` (position:absolute,
  top-right, above the scroll buttons) instead of as a flex sibling
  below the terminal, so the terminal reclaims that vertical space and
  the preview floats over it. Caption shows the page title/url.
- Autohide after ~7s (matches the TUI's BROWSER_PREVIEW_TTL); hovering the
  overlay pins it (clears the timer); the × dismisses it and drops the
  stored preview. Autohide/close remove the per-session entry, so it
  doesn't reappear on session switch — same lifecycle as the TUI.

Like the TUI, the overlay is anchored to the terminal view, so it shows
in terminal mode (where browser-driving agents run).

Test: web_smoke now asserts the overlay is a child of #terminalWrap,
position:absolute at top:8px, has the caption + close button, and that ×
hides it and forgets the stored entry. Verified visually (screenshot).
@edwin-zvs
edwin-zvs force-pushed the webui-preview-overlay branch from 4d29abf to 0cbdb6b Compare May 23, 2026 05:31
…ion, make ephemeral

- In-session thumbnail overlay (TUI + webui) stays scoped to the
  displayed session; switching sessions hides it.
- Matrix-rain wallpaper now tracks the latest browser preview from ANY
  session (the rain is a fleet visualization), not just the focused one.
- Browser previews are ephemeral / live-only: never reconstructed from
  the transcript on the TUI (hydration + reconnect replay) or the webui
  (renderEvent / replayTranscriptToTerm). A restart or reconnect no
  longer resurrects a stale thumbnail; once closed, it's gone.
@edwin-zvs edwin-zvs changed the title feat(webui): browser preview as top-right terminal overlay (TUI parity) feat(webui): browser preview as top-right terminal overlay + session-scoped, ephemeral thumbnails May 23, 2026
@edwin-zvs
edwin-zvs merged commit a32b86d into main May 23, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the webui-preview-overlay branch May 23, 2026 06:01
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