Skip to content

feat(react): add an opt-in Devtools button to ChatSidenav - #1643

Open
blove wants to merge 1 commit into
mainfrom
blove/react-sidenav-devtools
Open

blove wants to merge 1 commit into
mainfrom
blove/react-sidenav-devtools

Conversation

@blove

@blove blove commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Angular <chat-sidenav> shows a footer "Devtools" button (streaming dot, opens ChatDebug docked bottom) when [agent] is set, debug is true and dev mode is on (chat-sidenav.component.ts, CHAT_DEBUG_INCLUDED). React ChatSidenav had no equivalent.

  • ChatSidenav gains an opt-in devtools prop: { session, render, label?, buttonLabel? }. Without it nothing changes.
  • The footer button shows a dot (data-streaming) while session status is running, hides its label when collapsed, and on first press mounts render(panel) (so apps can lazy-load @threadplane/react/debug). panel is spread onto ChatDebug.
  • ChatDebug gains optional open, onOpenChange, defaultDock and launcher="none", so the sidenav drives it instead of duplicating dock logic. Existing behavior is unchanged when they are omitted.
  • Production builds (process.env.NODE_ENV === 'production') omit the button, mirroring Angular's dev-mode gate.
  • Closing the panel returns focus to the button when focus would otherwise be lost.
  • Type-only exports (no verify-packages change); dispositions rows appended; one sentence added to the chat-sidenav doc.

Verification

  • npx nx run-many -t test lint type-tests -p react: lint 0 errors; type-tests pass; 1523 tests pass. 8 unrelated specs timed out at 5s under load, and all 353 tests in those files plus the sidenav and debug files pass when rerun with --testTimeout 60000.
  • New specs: no button without the prop; button with the prop; dot follows running; click opens ChatDebug docked bottom; close returns focus; collapsed hides label; production gate (mutation-checked by forcing the gate on).
  • node --test scripts/react-parity/verify-packages.spec.mjs: 103 pass.
  • node scripts/react-parity/inventory.mjs --check --drift warn: valid.
  • apps/website npx vitest run: docs-content-rules passes; the remaining failures (ingest route, e2e-ownership, generate-api-docs, several react-*-preview specs) are in files this PR does not touch and look environmental in a fresh worktree; not confirmed on main.

🤖 Generated with Claude Code

Angular's chat-sidenav shows a footer Devtools button, with a streaming dot, when an agent is set in dev mode, and opens ChatDebug docked to the bottom. React had no equivalent. ChatSidenav now takes an opt-in `devtools` prop (session plus a render function), renders the footer button with a dot while the session runs, and mounts the panel on first press docked bottom. Production builds omit it. ChatDebug gains optional controlled open, onOpenChange, defaultDock and launcher=none so the sidenav can drive it without duplicating its dock logic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@blove
blove enabled auto-merge November 17, 2026 23:57

This branch has not been deployed

No deployments
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