Skip to content

feat(chat): fold the chat menu's Governance under its title with an arrow - #2180

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/chat-menu-governance-collapse
Nov 6, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/chat-menu-governance-collapse

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

The owner asked for this. In Chat's own menu, Governance (Activity, What Chat can do, Tool policy) now opens and closes with a down arrow, like the groups of the app's main left menu (Execution, Analytics).

What it looks like: the GOVERNANCE title keeps its look (the menu's small uppercase section title). It is now a button across the row, with the arrow on the right. The arrow points right (›) while Governance is closed and down (⌄) while it is open, as in the main menu. Clicking the title, or Enter or Space on it, opens and closes it.

Default state and memory:

  • Closed at first. It is open whenever Activity or What Chat can do is the page shown. The main menu does this too: its groups open on one of their pages, and that isn't remembered. Tool policy opens Settings › Chat, outside Chat, where this menu isn't shown.
  • The person's choice is remembered in this browser (local storage), as the main menu remembers its groups. It is kept with the chat menu's other folds under ansvisor.chatMenu.sections (governance: true = closed), so the menu keeps all its folds under one key. On one of its pages the person can still close it, and that choice is kept.

Pattern reused: the main sidebar's group header in web/src/components/layout/sidebar.tsx: a type="button" title with lucide's ChevronDown (h-3.5 w-3.5 transition-transform, -rotate-90 while closed), aria-expanded, aria-controls only while the items are shown, and the items not rendered while closed. The open-on-its-page effect is copied too. Nothing new is built: the change is in chat-menu.tsx only.

Accessibility: a native button, so Tab reaches it and Enter or Space toggles it. aria-expanded follows the state, and aria-controls="chat-menu-governance" names the items while they show. The arrow is aria-hidden. When it is open, the items' links, their active state (aria-current="page" on Activity or What Chat can do) and their hover and focus styles are as before. Governance's items have no counts.

Scope: only Governance changes, as the owner asked. The chat menu's other sections still fold with the ▴ / ▾ button at their right: Menu, Agents at work, Chats, and Connections inside Menu. They could follow the same title-and-chevron pattern in a follow-up if the owner wants the menu to look the same throughout.

  • Help: help/chat/chat.md. The chat menu says Governance is closed until clicked (142 words), and a new section, Open and close Governance (68 words), says how it opens, closes, opens on its own pages and is remembered in this browser. Keywords: governance, open governance. approved-articles.json regenerated (yarn test -u src/lib/help).

Related issue

None (owner's request: Chat menu UI).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Open Chat, in a browser that hasn't used this menu before (or clear ansvisor.chatMenu.sections in local storage). GOVERNANCE shows with › and no items under it.
  2. Click GOVERNANCE. Activity, What Chat can do and Tool policy show, and the arrow points down. Reload: it stays open. Click it again and reload: it stays closed.
  3. With it closed, open Activity (from Ctrl K, or a link). Governance is open with Activity marked. Reload: the stored choice is still "closed".
  4. Keyboard: Tab to GOVERNANCE and press Enter or Space. It toggles, and a screen reader announces "expanded" / "collapsed".
  5. Tests: cd web && npx vitest run src/components/chat/chat-menu.test.tsx src/lib/help.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

Checks run locally on 7d3ba99 (branched from main at 12e5e7b, and it still merges cleanly into main 5d1a1e6):

  • web: format:check passes. lint gives 0 errors and 7 warnings, all already on main in files this PR doesn't touch. typecheck passes. yarn test passes 998/998 files, 10696 tests passed and 1 skipped. yarn build with CI's placeholder env passes.
  • chat-menu.test.tsx: 23/23. There are 3 new Governance tests (closed by default and the toggle; remembered open or closed; open on its pages with the page marked and without being remembered), and the existing menu test opens Governance before it checks its links. src/lib/help: 12/12.
  • Also checked in headless Chrome: closed with ›, open with ⌄, Enter and Space toggle it, and on Activity it opens with Activity marked.

Generated by Claude Code

…rrow

The owner asked for Governance in Chat's own menu (Activity, What Chat
can do, Tool policy) to open and close with a down arrow, like the
groups of the app's main menu. Its title is now a button with the main
menu's group pattern: lucide's ChevronDown on the right, turned to point
right while closed, aria-expanded, and aria-controls while its items
show. It is closed at first and open while Activity or What Chat can do
is the page shown, without remembering that. The person's open/closed
choice is kept in this browser with the chat menu's other folds
(ansvisor.chatMenu.sections), as the main menu keeps its groups in
local storage. Only Governance changes.

Help: Use Chat gets an "Open and close Governance" section; the approved
articles are copied again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@gkhngyk
gkhngyk merged commit ef0b5c8 into ansvisor:main Nov 6, 2026
13 checks passed
gkhngyk pushed a commit that referenced this pull request Nov 6, 2026
…ts (#2184)

#2180 gave Governance the main menu's chevron, so the chat menu showed two
kinds of arrows. Governance now uses the small ▾ / ▴ button Menu and Chats
have, beside its title; it still opens by itself on its pages and remembers
how it was left. Help says so.

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

3 participants