feat(assistant): Read-only / Write switch per conversation #101

Merged
KofTwentyTwo merged 1 commits from feature/assistant-write-mode into main 2026-10-13 22:50:02 +00:00
KofTwentyTwo commented 2026-10-13 21:28:51 +00:00 (Migrated from github.com)

Pairs with QRun-IO/qbit-assistant#21 (write mode, stacked on #19). It renders only when the server reports features.writeMode, so against older servers nothing changes.

  • The panel header gets a switch for the active conversation, built as role="switch". It shows Read-only (the default, an eye icon) or Write (an amber pencil icon), with a tooltip explaining each.
  • Toggling it sends PATCH /assistant/conversations/{id} with { writeMode }. The server decides whether the user may switch (policy, role, writable tables) and answers 403 with a message otherwise; the message appears as a toast.
  • Type additions: writeMode on conversations and updates, features.writeMode and features.autoConfirm, and preferences.

Tests: AssistantPanel.test.tsx covers switching a conversation from Read-only to Write. typecheck and lint are clean, and all 24 assistant tests pass.

🤖 Generated with Claude Code

Pairs with QRun-IO/qbit-assistant#21 (write mode, stacked on #19). It renders only when the server reports `features.writeMode`, so against older servers nothing changes. - The panel header gets a switch for the active conversation, built as `role="switch"`. It shows **Read-only** (the default, an eye icon) or **Write** (an amber pencil icon), with a tooltip explaining each. - Toggling it sends `PATCH /assistant/conversations/{id}` with `{ writeMode }`. The server decides whether the user may switch (policy, role, writable tables) and answers 403 with a message otherwise; the message appears as a toast. - Type additions: `writeMode` on conversations and updates, `features.writeMode` and `features.autoConfirm`, and `preferences`. Tests: `AssistantPanel.test.tsx` covers switching a conversation from Read-only to Write. `typecheck` and `lint` are clean, and all 24 assistant tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.