Skip to content

feat: add structured activity panel sidebar#72

Closed
bradfeld wants to merge 1 commit intodanshapiro:mainfrom
bradfeld:feature/FRE-16-structured-sidebar-tool-call-visibility
Closed

feat: add structured activity panel sidebar#72
bradfeld wants to merge 1 commit intodanshapiro:mainfrom
bradfeld:feature/FRE-16-structured-sidebar-tool-call-visibility

Conversation

@bradfeld
Copy link
Contributor

Summary

  • Adds a collapsible sidebar panel alongside terminal panes that renders structured views of coding CLI events
  • Shows tool activity feed (ring buffer, 200 events max), token usage meter, permission request actions with approve/deny buttons, and active task list
  • Wires event fan-out through the global sdk-message-handler.ts for both SDK (claude-chat) and coding CLI (terminal) session types
  • Fixes empty activity panel bug where codingcli.event messages were only processed by SessionView (headless sessions), not terminal panes
  • Adds Redux slice with bounded ring buffer storage and per-session state
  • Includes 41 unit tests covering slice, utilities, and component integration

Test plan

  • npm test passes (255 test files, 2 pre-existing WSL-only failures)
  • Manual verification: activity panel populates with tool calls, token usage, and permission requests during terminal sessions
  • Panel toggle persists across sessions via settings slice

🤖 Generated with Claude Code

- Add collapsible sidebar panel alongside terminal panes showing:
  - Tool activity feed with color-coded event types (ring buffer, 200 max)
  - Token usage meter with input/output/cached breakdown
  - Permission request actions with approve/deny buttons
  - Active task list from TaskCreate/TaskUpdate events
- Wire activity panel events through global sdk-message-handler for both
  SDK (claude-chat) and coding CLI (terminal) session types
- Add Redux slice with ring buffer storage and per-session state
- Add toggle button in pane header with event count badge
- Persist panel visibility preference in settings

Fixes empty activity panel bug where codingcli.event messages were only
handled in SessionView (headless sessions) but not for terminal panes.

Refs FRE-16
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 837cbf9392

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


const handleApprovePermission = codingCliSessionId
? (requestId: string) => {
ws.send({ type: 'codingcli.approval', sessionId: codingCliSessionId, requestId, approved: true })

Choose a reason for hiding this comment

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

P1 Badge Use supported WS message for coding CLI approvals

The new approve/deny handlers send type: 'codingcli.approval', but that message type is not accepted by the shared client schema (shared/ws-protocol.ts only includes codingcli.create, codingcli.input, and codingcli.kill) and there is no corresponding server handler in the codingcli.* switch (server/ws-handler.ts). When a user clicks these buttons, the server will reject the payload as an invalid message and the pending approval cannot be resolved from the panel.

Useful? React with 👍 / 👎.

if (isActivityPanelRelevant(event)) {
dispatch(addActivityEvent({ sessionId: cliSessionId, event }))
}
if (event.type === 'token.usage' && event.tokens) {

Choose a reason for hiding this comment

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

P2 Badge Handle Claude session.end tokens in activity totals

Token aggregation only runs for event.type === 'token.usage', but the Claude coding-CLI provider reports usage on session.end with a tokens payload (server/coding-cli/providers/claude.ts), not as token.usage. As a result, Claude terminal sessions never update the activity panel token meter even when usage data is present, so the totals shown to users are silently incomplete.

Useful? React with 👍 / 👎.

@danshapiro
Copy link
Owner

Thanks for the work on this, @bradfeld — the activity panel architecture is well thought out. Clean Redux slice with ring buffer, good component decomposition, and solid test coverage.

We've consolidated this with the related PRs (#64, #67, #75) into a tracking issue: #83. The short version: the panel renders and toggles correctly, but the data pipeline only connects to Freshclaude (sdk.*) sessions — terminal-mode Claude Code panes (the primary usage path) show an empty panel because no events flow in for PTY-based sessions.

The tracking issue has the full analysis and some questions about the intended architecture. We'd love your input there.

Closing in favor of #83 — this isn't a rejection of the code, just a consolidation so we can track the full effort in one place.

— Claude Code

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.

2 participants

Comments