feat(app): add v2 home tab toggle#32191
Open
Hona wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a v2 “Home” toggle (UI + command) that switches between Home and the most-recent active v2 tab, persists recent-tab state, and aligns pressed styling for muted icon buttons.
Changes:
- Adds Home toggle behavior (mod+b) in the v2 titlebar with a tooltip keybind display and persistent recent-tab tracking.
- Updates tab state management to persist “active tab” and map session routes to a stable root session tab.
- Adjusts v2 icon-button pressed styling for
ghost-mutedto use the active icon color.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/v2/components/icon-button-v2.css | Sets pressed ghost-muted icon color to the active icon color token. |
| packages/app/src/pages/session.tsx | Syncs session + computes root session target for tab routing when v2 designs are enabled. |
| packages/app/src/pages/layout.tsx | Removes mod+b keybind from legacy sidebar toggle when new design is enabled. |
| packages/app/src/pages/directory-layout.tsx | Removes directory-level session sync side-effect. |
| packages/app/src/desktop-menu.ts | Removes macOS native menu accelerator for sidebar toggle. |
| packages/app/src/context/tabs.tsx | Persists active tab and adds home-toggle + route→tab mapping logic. |
| packages/app/src/context/layout.tsx | Makes LayoutRoute server key required (injected from active server). |
| packages/app/src/context/command.tsx | Adds formatKeybindParts + exposes keybindParts() for UI keycap rendering. |
| packages/app/src/components/titlebar.tsx | Implements v2 Home toggle button + command registration and updates tab navigation to use useTabs(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+149
to
+153
| const current = (route: LayoutRoute) => { | ||
| if (route.type === "home" || route.type === "dir-new-sesssion") return | ||
| if (route.type === "draft") { | ||
| return tabs.find((tab) => tab.type === "draft" && tab.draftID === route.draftID) | ||
| } |
Comment on lines
+165
to
+169
| const canToggleHome = (route: LayoutRoute) => { | ||
| if (!ready()) return false | ||
| if (route.type === "home") return true | ||
| return current(route) !== undefined | ||
| } |
Comment on lines
141
to
145
| id: "view", | ||
| label: "View", | ||
| items: [ | ||
| { type: "item", label: "Toggle Sidebar", command: "sidebar.toggle", accelerator: { macos: "Cmd+B" } }, | ||
| { type: "item", label: "Toggle Sidebar", command: "sidebar.toggle" }, | ||
| { type: "item", label: "Toggle Terminal", command: "terminal.toggle", accelerator: { macos: "Ctrl+`" } }, |
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.
TLDR; Adds the designed v2 Home toggle with persistent recent-tab navigation and consistent active icon styling.
Changelog
mod+bto toggle between Home and the current v2 tabDesign issues: anomalyco/opencontrol#134 and anomalyco/opencontrol#137
Supersedes #31953.
Verification
bun typecheckinpackages/appgit diff --check