feat(nav): first-class navigation behind the nav_v2 org flag - #6117
Open
rafavalls wants to merge 11 commits into
Open
feat(nav): first-class navigation behind the nav_v2 org flag#6117rafavalls wants to merge 11 commits into
rafavalls wants to merge 11 commits into
Conversation
The sidebar becomes a destination list (Home, Reports, Tasks, Library, plus one row per GitHub-backed coding agent) instead of a chat list, and the chat list moves into a titled dropdown at the top of the chat panel. Reports only appears once the org actually has a Commerce Discovery report, and opens that report's MCP app in place. Home, Automations and Settings leave the top tab bar (Settings owns the latter two); each panel gains an explicit collapse control. The navigation is single-teammate, so the agent switcher is gone from the shell. Defaults on for reports_only orgs; an explicit nav_v2:false still wins. The flag-off layout is untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Home / Reports / Tasks / Library only set `?main=`, so opening one from a coding agent's thread left `virtualmcpid` on that agent: the panel showed the destination while the header kept the agent's Preview / Publish controls, and both sidebar rows highlighted at once. They now hand back to the Super Agent, reusing its empty "New chat" when there is one. Also stabilises nav-v2.spec.ts under load: the sidebar helper retries with a reload (ORGANIZATION_SETTINGS_GET degrades to empty flags on a failed read, which renders the flag-off sidebar), and the timeouts allow for cold-Vite route compiles across the three lazy routes this spec crosses. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An absent `?main=` was always read as Home, but only the Super Agent defaults to Overview — a coding agent's thread has no `main` because its default view is Preview, so both Home and the agent's own row highlighted at once. An absent `main` now means Home only on the Super Agent; anywhere else no destination is active, which is the truth. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… thread-panel wiring Opening an org destination from a coding agent's thread now reuses the same setTaskId/createNewTask path as every other thread switch instead of a hand-built navigate() call that dropped search params and skipped resolveTaskSwitchSearch. Also folds the search-dialog state and the MyThreadsSection prop-plumbing (duplicated across the sidebar list and the chat panel's threads menu) into useThreadsPanel, and adds e2e coverage for the reports_only/nav_v2 flag precedence and the destination-from-other-agent fix, none of which had a test before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-agent-nav # Conflicts: # apps/web/src/hooks/use-organization-settings.ts
…card Both columns were a top bar on the sidebar background plus a card below it, so the cards started ~48px down and the two edges read differently. Under the first-class navigation each panel is now a single full-height card that owns its own header, giving chat and main an identical surface. Scoped to nav_v2 via PanelCard's `headerInside`; the flag-off layout keeps the header-above-card shape exactly as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rows were 32px tall on a 6px gap; drop to 4px (the SidebarMenu default) and scale the coding-agents separator to match. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SidebarMenuButton only hides its tooltip on mobile, so an expanded row showed a tooltip repeating the label already next to the icon. Pass it only for the collapsed icon rail, where it is the sole label. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The panel group had pb-1 but pt-0, so the full-height cards sat flush against the top edge while leaving 4px below. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
View tabs, branch selector and publish relocated into the chat header whenever the main panel was closed. They belong to the main panel, and the chat header's right-panel toggle already reopens it, so under the first-class navigation they just go away instead. The classic layout keeps the relocation — it has no other way back to the views. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
navigation-settings borrowed the review section's toast copy; give it its own key. workspace-panel-group's header comment only described the classic layout, which no longer matches the first-class navigation's full-height cards. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this contribution about?
Behind a new
nav_v2org flag, the sidebar becomes a destination list (Home · Reports · Tasks · Library, plus one row per GitHub-backed coding agent, labelled by repo) instead of a chat list, and the chat list moves into a titled dropdown at the top of the chat panel. Reports only appears once the org actually has a Commerce Discovery report and opens that report's MCP app in place. Home / Automations / Settings leave the top tab bar (the latter two already live under Settings), each panel gains an explicit collapse control, and the agent switcher is gone since this navigation is single-teammate. The flag defaults on forreports_onlyorgs — an explicitnav_v2: falsestill wins — and the flag-off layout is byte-for-byte untouched.How did you verify your code works?
Added
packages/e2e/tests/nav-v2.spec.ts(3 specs, all passing): flag-off keeps the chat list in the sidebar; flag-on shows the destinations, routes them to?main=files|board|overview, asserts Overview/Automations left the top bar and no agent is named anywhere, and round-trips both collapse controls through?sidepanel=0/?main=0; and a third spec stands up a stub Commerce Discovery MCP to prove Reports is absent before the connection exists and present + opening?main=…get_my_diagnosticafter.bun run check,bun run lint(0 errors),bun run fmt:checkandknipare clean;bun testis unchanged against the pre-branch baseline (107 pre-existing jsdom failures before and after, verified viagit stash). Also driven manually in Chromium end-to-end against a local stub report.Screenshots/Demonstration
Sidebar:
Home · Reports · Tasks · Librarywith the collapse trigger beside the org selector; chat header: threads dropdown showing the current thread title,|←collapse-chat at the start of the main header and the right-panel toggle at its end.How to Test
/$org— the sidebar now lists destinations; click each and confirm the URL moves to?main=overview|board|fileswith the row highlighted.|←and right-panel icons to collapse/restore each panel; neither can hide both.Migration Notes
No DB migration.
nav_v2is a new key in the existingorganization_settings.flagsjsonb bag (OrgFlagsSchema); tool contracts were regenerated. Nothing is enabled for existing non-reports orgs until the flag is set.Review Checklist
🤖 Generated with Claude Code
Summary by cubic
Introduces first-class navigation behind the
nav_v2org flag. Old: sidebar showed chats and the top bar carried Overview/Automations/Settings; New: the sidebar lists destinations (Home, Reports, Tasks, Library) plus GitHub-backed coding agents, the chat list moves to a Threads menu in the chat header, panels are full-height cards with paired collapse toggles, and undernav_v2the main panel’s controls no longer relocate into the chat header.Sidebar and routing: destination clicks set
?main=overview|board|files(Reports opens its MCP app by pinned tab id). Opening a destination from a coding agent’s thread returns to the Super Agent viasetTaskId/createNewTaskand preserves search params; an absent?mainhighlights Home only on the Super Agent.Threads: moved to a titled menu (
ThreadsMenu) in the chat header with search and View/Type/Scope filters; shared state and actions are consolidated inuseThreadsPanel. The classic sidebar thread list is unchanged when the flag is off.Layout and controls: both columns render as full-height cards with in-card headers; new collapse buttons (“Hide/Show chat/panel”) sit at opposite ends of the headers and sync with
?sidepanel=0|chatand?main=0. Overview/Automations/Settings are removed from the top bar (Library/Tasks overlay tabs are hidden undernav_v2). No agent switcher under the single‑teammate navigation.Settings and copy: add an org-level switch at Settings → General → Navigation; includes a dedicated error toast key. E2E coverage in
packages/e2e/tests/nav-v2.spec.tsvalidates flag behavior, Reports visibility/opening,reports_onlyprecedence, and Super Agent handoff.Rollout
nav_v2toOrgFlagsSchema; update@decocms/sharedtool IO.reports_onlyorgs; setnav_v2: falseto force off. Others opt in via Settings → General → Navigation.Written for commit 242adcc. Summary will update on new commits.