Skip to content

add selected-agent live activity to the composer#2646

Open
tellaho wants to merge 2 commits into
mainfrom
tho/composer-live-activity-resurrection
Open

add selected-agent live activity to the composer#2646
tellaho wants to merge 2 commits into
mainfrom
tho/composer-live-activity-resurrection

Conversation

@tellaho

@tellaho tellaho commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Category: new-feature
User Impact: Users who opt into the experiment can preview a working agent's recent channel activity directly from the composer and switch between active agents.

Problem: The existing composer affordance says that agents are working but gives little context about what a selected agent is doing. The older live-activity draft had also fallen behind current transcript and activity primitives.

Solution: Rebuild the concept on current main as an off-by-default experiment, reusing the shared managed-agent activity panel for one selected agent at a time. The preview remains a single accessible interaction surface, includes archive-aware recency, and leaves the existing popover unchanged when disabled.

File changes

desktop/src/features/channels/ui/BotActivityBar.tsx
Routes the enabled experiment to the selected-agent preview while preserving the existing disabled popover, and adds accessible agent-switching controls.

desktop/src/features/channels/ui/ComposerLiveActivityFeed.tsx
Adds the compact composer preview using the shared managed-agent session panel, with an inert transcript subtree and accessible click-through controls.

desktop/src/features/channels/ui/composerLiveActivity.ts
Defines selected-agent resolution and archive-aware Last-live derivation.

desktop/src/features/channels/ui/composerLiveActivity.test.mjs
Covers selection fallback behavior and recency across live, archived, and active-turn sources.

desktop/src/features/profile/lib/lastLiveLabel.ts
Extracts the shared Last-live label formatter for reuse outside the profile panel.

desktop/src/features/profile/lib/lastLiveLabel.test.mjs
Covers the shared recency labels.

desktop/src/features/profile/ui/UserProfilePanelTabs.tsx
Uses the extracted shared Last-live formatter without changing profile behavior.

preview-features.json
Registers the off-by-default composer live-activity experiment.

Reproduction steps

  1. Run the desktop app and open a channel with a working managed agent.
  2. With composerLiveActivity disabled, open the composer activity popover and confirm the existing Agents working list remains unchanged.
  3. Enable Composer live activity in Settings → Experiments and reopen the popover.
  4. Confirm the selected agent's channel-scoped compact activity, Last-live label, and full-activity click-through are visible.
  5. With multiple working agents, switch the agent pills and confirm the preview follows the selected agent.
  6. Tab through the popover and confirm focus reaches the pills and open controls but never enters the transcript subtree.

Screenshots

Experiment off — existing popover
Experiment off

Enabled — single agent
Enabled single agent

Enabled — multi-agent switching
Enabled multi-agent

Keyboard focus — transcript subtree remains inert
Inert keyboard focus

npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w and others added 2 commits July 23, 2026 16:11
Rebuild of the composer live-activity experiment (old draft PR #1575) on
current main primitives. Behind the new off-by-default
composerLiveActivity preview feature, the agents-working popover shows
one selected working agent's channel-scoped feed at a time:

- ComposerLiveActivityFeed reuses ManagedAgentSessionPanel with the
  compactPreview transcript variant (same primitive as the profile
  activity embed), so live/archive merging, projection, anchored
  scrolling, and idle handling stay owned by that surface.
- Agent switching via pill tabs (role=tablist) under the preview;
  selection resolves explicit tab > open session pane > first working
  agent, and falls through when the selected agent stops working.
- Whole preview is one click target with a Last-live recency pill;
  transcript rows underneath are inert, avoiding nested interactive
  controls inside a clickable shell.
- formatLastLiveLabel extracted from UserProfilePanelTabs into
  profile/lib/lastLiveLabel so both surfaces share the recency label.

With the experiment off, the popover renders the existing agent list
unchanged.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
…nd AT

Wrap the ManagedAgentSessionPanel subtree in a native inert container so
compact transcript rows (which can render keyboard-focusable message
links) are removed from pointer, tab-order, and assistive-tech
interaction — CSS pointer-events-none only neutralized the mouse. The
overlay open button and Last-live pill stay accessible.

Also extract deriveLastLiveAt and make it archive-aware: the Last-live
pill now takes the newest across the live transcript window, archived
channel events, and the active-turn anchor, so it can no longer disagree
with archived rows visible in the preview.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
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