Skip to content

Render session widgets in web UI#246

Merged
edwin-zvs merged 5 commits into
mainfrom
webui-session-widgets
May 26, 2026
Merged

Render session widgets in web UI#246
edwin-zvs merged 5 commits into
mainfrom
webui-session-widgets

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • Render file-backed session widgets in the web UI from SessionDetail.ui_panels
  • Add a widgets dropdown with persisted per-session visibility in localStorage
  • Support basic widget Markdown, nested checklists, :::timeline / :::agentd-timeline, and inline agentd:action/... links
  • Dispatch widget actions through session.input as OBSERVATION: ui.action ...
  • Support explicit ?key= shortcut display/dispatch only while a widget card has focus

Manual QA

Using an isolated daemon (AGENTD_WEBUI_PORT=5876) with a timeline-demo.md widget:

  • Verified widget appears in the web UI for the selected session
  • Verified timeline renders with nested checklist items and keyed actions ([d] Start demo, [r] Run checks)
  • Verified dropdown toggles visibility and persists hidden state in localStorage
  • Verified re-showing through dropdown restores the widget
  • Verified clicking Run checks sends OBSERVATION: ui.action ... into the session transcript

Validation

  • node --check on extracted index.html script
  • cargo build -p agentd
  • cargo build -p agentd-cli (for isolated smoke-test CLI)
  • git diff --check

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Updated per feedback:\n\n- Moved the web widget trigger to a top-right overlay control (), positioned left of the terminal controls when those are visible.\n- Changed widget content to a top-right popover instead of a full-width section.\n- Raised web browser preview z-order above widget popovers.\n- Adjusted TUI render order so browser preview redraws after dynamic UI widgets/popovers and stays on top.\n\nValidation rerun:\n- on extracted web script\n- \n- \n- Browser smoke test verified the button has a visible top-right rect and opens a 420px popover.

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Updated per feedback:

  • Moved the web widget trigger to a top-right overlay control labeled widgets, positioned left of the terminal top/bottom controls when those are visible.
  • Changed widget content to a top-right popover instead of a full-width section.
  • Raised web browser preview z-order above widget popovers.
  • Adjusted TUI render order so browser preview redraws after dynamic UI widgets/popovers and stays on top.

Validation rerun:

  • node --check on extracted web script
  • cargo build -p agentd -p agentd-cli
  • git diff --check
  • Browser smoke test verified the widgets button has a visible top-right rect and opens a 420px popover.

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Follow-up polish from web hot-reload review:

  • Suppressed the first markdown heading inside widget card bodies when it is already used as the card title, avoiding duplicate titles.
  • Capped the web widget popover to max-width/max-height 80% of the session view.
  • Strengthened timeline connector styling so the vertical bar is visible between timeline rows.

Validation:

  • node --check on extracted web script
  • cargo build -p agentd -p agentd-cli
  • git diff --check
  • Browser smoke test confirmed body no longer repeats the title, connector style is present, and popover size is below 80% of the view.

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Follow-up from web UI review:

  • Put the terminal-mode widgets control into the same top-right control row as top/bottom, ordered widgets → top → bottom, so top/bottom remain visible when widgets exist.
  • Kept the chat/headless fallback widgets control for views that do not show terminal top/bottom controls.
  • Re-aligned the widget popover to the right edge of the session view instead of the widgets button edge.
  • Reworked timeline connectors onto a dedicated rail column so the vertical line spans rows with nested checklist items.

Validation:

  • node --check on extracted web script
  • cargo build -p agentd -p agentd-cli
  • git diff --check
  • Browser smoke test confirmed popover right edge alignment and timeline rail CSS; terminal-mode row is covered by DOM/control-row ordering.

@edwin-zvs

Copy link
Copy Markdown
Contributor Author

Final widget visual polish:

  • Removed the inner widget-card border/background so the popover presents as a single bordered surface.
  • Kept the title/body divider and added a simple separator only between multiple widget cards.

Validation:

  • node --check on extracted web script
  • cargo build -p agentd
  • git diff --check

@edwin-zvs
edwin-zvs merged commit cb8be78 into main May 26, 2026
1 check passed
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