Skip to content

feat(app): right-click a bot in the sidebar for its menu - #55

Merged
httpsphl merged 2 commits into
mainfrom
feat/bot-context-menu
Sep 30, 2026
Merged

httpsphl merged 2 commits into
mainfrom
feat/bot-context-menu

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

What

A right-click on a bot in the sidebar opens that bot's menu where the pointer is, without opening the bot: Edit, Make crew chief / Stop being chief, Restart with a new conversation, Open folder and Archive bot. It is the menu of the header's "more" button, and both now come from one place, so they cannot diverge.

  • useBotActions(bot, crew) (features/bots/botActions.tsx) returns the menu's items and the dialogs they open (edit, the new-conversation confirmation, the archive confirmation). BotHeader lost that code and uses the hook; Sidebar uses the same hook for each conversation.
  • ContextMenu (ui/ContextMenu.tsx) reuses the rows of Menu (MenuItems), opens at the pointer, stays inside the window, and closes on a pick, Escape, a click elsewhere, a scroll, a resize or when the window loses focus. It is drawn in the body, so the sidebar's scrolling list cannot clip it, and its dialogs are too, so they are not part of the navigation.
  • Keyboard: the menu key (or Shift+F10) on a conversation opens it just inside the row, the first action takes the focus, the arrow keys, Home and End walk the actions, and the focus goes back to the conversation when it closes. Menu gets the arrow keys too.
  • The row stays highlighted while its menu is open.
  • One new text, the menu's name for screen readers ("Actions for Scout"), in the three languages.
  • Spec 15.1 describes it.

Delete joins this menu in the PR that adds it to the app, after #54.

Tests

  • features/crews/botMenu.test.tsx (new), with FakeBotloft: the menu offers exactly what the header's menu offers and does not open the bot; it acts on the bot that was clicked while another one is open (open folder, chief, archive with its confirmation outside the navigation); a paused bot cannot restart; it opens from the keyboard, walks with the arrows and gives the focus back; a click elsewhere closes it and only one is open at a time.
  • The existing header tests still pass (App.test.tsx, chief.test.tsx).
  • pnpm check passes (195 tests).

Checked in the preview (pnpm dev, FakeBotloft, 125% size, Portuguese): the menu opens at the pointer, moves up when it would leave the window at the bottom, and its archive confirmation names the right bot.

Nothing here depends on the real Claude Code. In the installed app, one thing to see by hand: a right-click on a conversation shows this menu and not the webview's own.

useBotActions holds the items of the bot's menu and the dialogs they open, so another menu can offer exactly the same.
The menu opens at the pointer (or from the keyboard's menu key), without opening the bot, with the same actions as the header's menu. ContextMenu reuses the rows of Menu, stays inside the window and walks with the arrow keys; Menu gets the arrow keys too.
@httpsphl
httpsphl merged commit 8b376f2 into main Sep 30, 2026
3 checks passed
@httpsphl httpsphl mentioned this pull request Sep 30, 2026
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