Skip to content

feat(sidebar): put Chat above the groups, Competitors under Reports, and let the groups fold - #1887

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/sidebar-layout
Oct 31, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/sidebar-layout

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

A tidier left menu, as the owner asked. Three changes:

  • Chat moves above the groups, in none of them. It is where you ask about anything below, or let the agent do the work.
  • Competitors moves from Analytics to right under Reports. Prompts now follows Brand Visibility directly: adding prompts is the way into the product, so nothing sits between them, and Analytics stays shorter.
  • Execution and Analytics fold under their titles:
    • Click a title to fold its group; a chevron on the right shows the state.
    • Every group starts open. A folded group stays folded in that browser (localStorage, ansvisor.sidebar.group.<title>Open, the same pattern as the Prompts and Content submenus).
    • A folded group opens by itself when one of its pages shows, so the current page is never hidden.
    • With the menu narrowed to icons there are no titles, so every item shows.
    • Chat, Reports and Competitors have no title and don't fold.

Code

  • web/src/config/dashboard.ts sets the new order: a first untitled group (Chat), Execution (Action Center, Content, Site Audit), Analytics (Brand Visibility, Prompts, Mentions, Citations, Shopping, AI Referral Traffic), then Reports and Competitors. Routes, gates and badges are unchanged.
  • web/src/components/layout/sidebar.tsx adds the group headers as buttons (aria-expanded, aria-controls). A folded group's items aren't rendered, so the arrow keys skip them.
  • Settings › Menu access lists Chat above the headings, as the menu does, with one Other group.
  • Menu access and the work areas read their sections from the menu, so their order follows it. No role or work area changes what it shows.
  • Chat's route registry still lists Competitors once. routes-sidebar.test.ts adds it only if no group lists it.

Help and docs:

  • help/settings/menu-access.md: a new "Fold a group on your menu" section.
  • help/competitors/add-competitors.md, help/competitors/compare-competitors.md and help/settings/work-areas.md updated.
  • docs/guides/menu-access.mdx and docs/guides/competitors.mdx updated.

Related issue

None.

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 any dashboard page. The menu reads: Chat, then EXECUTION (Action Center, Content, Site Audit), ANALYTICS (Brand Visibility, Prompts, …), and under a rule Reports and Competitors.
  2. Click ANALYTICS. Its items fold and the chevron turns. Reload: it stays folded. Open Brand Visibility from a link: the group opens.
  3. Narrow the menu to icons. Every item shows.
  4. Open Settings › Menu access. Chat is the first row, above Execution.
  5. Run yarn vitest run src/components/layout src/lib/dashboard-navigation.test.ts src/lib/menu-access.test.ts src/components/settings src/lib/help.

Screenshots (1024px, light and dark) were shown to the owner.

Checklist

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

On this commit: format:check and typecheck pass, lint has 0 errors (7 old warnings in files this PR doesn't touch), and the layout, settings, onboarding, chat, help and navigation suites pass (1,319 tests in 99 files). Checked in the browser at 1024px, light and dark.

🤖 Generated with Claude Code

…and let the groups fold

Chat leaves Execution for a group of its own at the top. Competitors moves
from Analytics to right under Reports, so Prompts follows Brand Visibility.
Execution and Analytics fold under their titles: open by default, kept in
this browser, and opened again on one of their pages. Menu access lists
Chat above the headings, and the help and guides say where things are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 567d63d.

Approve preview

@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.

Approving. Chat now sits on its own above the groups, Competitors sits right under Reports, and Execution and Analytics fold. I checked:

  • Menu access: the sections still come from dashboardNav, so hiding a section by role, by person or by work area still covers Chat and Competitors where they are now. If Chat is hidden, its group is dropped, so no empty block or stray rule is left behind. In Settings → Menu access, Chat is listed above the headings and the one remaining "Other" group holds Reports and Competitors.
  • Gates: Competitors keeps competitor_tracking, so the locked row and plan badge work as before. Chat keeps ai_agent, its badge, and the /dashboard/chat link when the new Chat is on.
  • Folding: groups render open on the server and on first paint, and the saved state is read after mount, so there's no hydration mismatch. Reads and writes are wrapped in try/catch. The keys don't depend on locale. A folded group opens again when one of its pages is showing, and when the menu is narrowed to icons every item still shows.
  • A11y: the group titles are real buttons with aria-expanded, and aria-controls is set only while the list exists. The arrow-key handler still moves only between links, and the group buttons are reached with Tab.
  • Mobile menu and onboarding preview: these follow the new order, with nothing extra to change.
  • Help and docs: both Competitors articles, the guide, and the menu-access and work-areas pages now point to Reports, and the folding is described.

Tests: the layout, settings and onboarding suites, the nav, menu-access and Chat route/page-context tests, the Help validate test and plan-row.test.ts (40 files, 401 tests) all pass. tsc, eslint and prettier are clean on the changed files. The branch is up to date with main and has no conflicts.

One optional nit: the work-areas lists (Help and docs) now follow the menu order for Competitors but still list Action Center before Chat. If you want them to match the menu exactly, Chat would go first.

@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.

Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build.

@gkhngyk
gkhngyk merged commit dc40f45 into ansvisor:main Oct 31, 2026
5 of 6 checks passed
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