Repository navigation
feat(desktop): reorganize sidebar and workspace header chrome #5824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a009678
feat(desktop): reorganize sidebar and workspace header chrome
Kitenite eb077cb
feat(desktop): collapsible Workspaces sidebar header with add-repo bu…
Kitenite 000334f
feat(desktop): merge top bar into pane tab bar, responsive PR header,…
Kitenite 119b5b5
feat(desktop): scroll edge fades for workspace sidebar Files and Chan…
Kitenite 010191b
fix(desktop): address review nits — onSelect in help submenu, seed fo…
Kitenite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Sidebar/header reorg — change log (branch `reorganize-sidebar-header`) | ||
|
|
||
| Revert guide: each item is independent; revert by undoing the listed file(s). | ||
|
|
||
| ## Workspace content area (v2) | ||
|
|
||
| - **Presets bar: no border, taller, more chip spacing** — `h-8 gap-0.5 border-b` → `h-10 gap-1.5`, borderless. `v2-workspace/$workspaceId/components/V2PresetsBar/V2PresetsBar.tsx` | ||
| - **Run button moved presets bar → tab bar trailing slot** (next to BackgroundTerminalsButton; presets bar `trailing` prop deleted, TopBar portal slot `workspace-topbar-run-slot` deleted). `v2-workspace/$workspaceId/page.tsx`, `V2PresetsBar.tsx`, `_dashboard/components/TopBar/TopBar.tsx` | ||
| - **Inverted tab styling** — inactive tabs carry the shaded block/bottom border, active tab blends into pane; bar itself borderless. `packages/panes/.../TabBar/TabBar.tsx`, `TabItem.tsx` | ||
|
|
||
| ## Workspace right sidebar (v2) | ||
|
|
||
| - **Tab strip (Files/Changes/Review) border-b removed**; inverted tab button styles. `WorkspaceSidebar/components/SidebarHeader/SidebarHeader.tsx`, `screens/main/.../RightSidebar/headerTabStyles.ts` | ||
| - **PR action header: border-b removed; open-in button moved here from TopBar** (renders next to Create PR). `WorkspaceSidebar/components/PRActionHeader/PRActionHeader.tsx`, `TopBar.tsx` | ||
| - **Open-in chevron size-3.5 → size-3** to match PR chevron. `TopBar/components/V2OpenInMenuButton/V2OpenInMenuButton.tsx` | ||
| - **Files tab: search button moved from tab strip into explorer toolbar** (before New File); "EXPLORER" title deleted. `WorkspaceSidebar/components/FilesTab/FilesTab.tsx`, `WorkspaceSidebar.tsx` | ||
|
|
||
| ## Dashboard sidebar | ||
|
|
||
| - **New Workspace moved to top** (above Search/Automations/Tasks; also first in collapsed rail). `DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx` | ||
| - **Recently-viewed (history) button hidden, not deleted** — two commented lines. `_dashboard/components/NavigationControls/NavigationControls.tsx:7,69` | ||
| - **Help menu moved into org dropdown.** `TopBar/components/OrganizationDropdown/components/HelpSubMenu/` (was `DashboardSidebarHelpMenu`) | ||
| - **New collapsible "Workspaces" header** above the project list; hover chevron right of label; hosts the Add repository dropdown (moved out of the New Workspace row). Collapse persists via zustand `sidebar-workspaces-collapse`. New: `DashboardSidebar/components/DashboardSidebarWorkspacesHeader/`, `stores/sidebar-workspaces-collapse.ts`; wired in `DashboardSidebar.tsx`, `DashboardSidebarHeader.tsx` | ||
| - **Header block border-b removed** (expanded variant only). `DashboardSidebarHeader.tsx` | ||
| - **Project header indented** `pl-3` → `pl-5`. `DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/DashboardSidebarProjectRow.tsx` | ||
| - **Workspace diff stats (+N −N) only render on the active row.** `DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx` | ||
| - **Workspace-count badges removed** from custom section headers and project rows (`totalWorkspaceCount` prop dropped from ProjectRow; collapsed-rail popover count kept). `DashboardSidebarSection/components/DashboardSidebarSectionHeader/DashboardSidebarSectionHeader.tsx`, `DashboardSidebarProjectRow.tsx` | ||
|
|
||
| --- | ||
|
|
||
| # Session 2 additions (same branch, parallel session) | ||
|
|
||
| ## Dashboard sidebar | ||
|
|
||
| - **User/org dropdown moved header → footer**; footer is now `[user dropdown | UpdatesPill | ⚙ | ?]` → later `?` removed (help lives in the org dropdown). `DashboardSidebarHeader.tsx`, `DashboardSidebar.tsx` | ||
| - **Settings is an icon-only gear** in the footer (was a full-width labeled row); tooltip carries the hotkey. `DashboardSidebar.tsx` | ||
| - **Org dropdown (expanded trigger): chevron removed** (topbar variant keeps it); **Settings item removed** from the menu (was the v1 TODO item); **"Switch organization" got an icon** (`HiOutlineArrowsRightLeft`). `TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx` | ||
| - **`SubmitPromptDialog` moved** to `OrganizationDropdown/components/`; old `DashboardSidebarHelpMenu/` deleted (git-tracked, restorable). | ||
| - **Workspaces tab hidden, not deleted** — `SHOW_WORKSPACES_TAB = false` flag; flip to true to restore. `DashboardSidebarHeader.tsx` | ||
| - **New Search row/icon** opens the command palette; clicking while open closes it (state captured on pointerdown because the palette dismisses on outside pointerdown before click). `DashboardSidebarHeader.tsx` | ||
| - **Looking-glass button deleted** from `NavigationControls.tsx` (`⌘K` hotkey unaffected). | ||
| - **ResourceConsumption moved** from right edge (`ml-auto`) to after back/forward in the top row. `DashboardSidebarHeader.tsx` | ||
| - **Section-header hover drag-grip removed** — chevron stays visible; drag still works via row listeners. `DashboardSidebarSectionHeader.tsx` | ||
| - **Workspaces under a section: indent `pl-7` → `pl-10`.** `DashboardSidebarExpandedWorkspaceRow.tsx` | ||
|
|
||
| ## Terminal pane / changes panel | ||
|
|
||
| - **Pane-title chevron removed** (fetch spinner kept). `v2-workspace/.../TerminalPane/components/TerminalSessionDropdown/TerminalSessionDropdown.tsx` | ||
| - **Divider after rich-input ✎ button removed.** `TerminalPane/components/TerminalPaneHeaderExtras/TerminalPaneHeaderExtras.tsx` | ||
| - **Duplicate refresh spinner removed** (the refresh icon itself spins). `useChangesTab/components/ChangesToolbar/ChangesToolbar.tsx` | ||
| - **Changes header block: `py-1.5` wrapper** around header+toolbar; toolbar `border-b` removed. `useChangesTab/components/ChangesTabContent/ChangesTabContent.tsx`, `ChangesToolbar.tsx` | ||
|
|
||
| ## Tabs / top bar (shared surfaces) | ||
|
|
||
| - **`headerTabStyles.ts` gained `inverted` option** used only by v2 `SidebarHeader.tsx` (`inverted: true`) — v1 RightSidebar styling unchanged; active tab framed by l/r/t borders, transparent sides keep 1px stability. | ||
| - **`packages/panes` TabItem/TabBar**: inverted colors, active-tab l/r/t frame, close-button hover bgs swapped; ALL `border-b` removed (tabbed + empty-state variants) and inactive-tab `border-r` separators removed; `+` button got `ml-1.5`. Affects every `Workspace` consumer. | ||
| - **`TopBar.tsx` `border-b` removed** — NOTE: dashboard-wide; every route loses the line under the top bar, not just the workspace view. | ||
| - **TopBar merged into the pane tab bar** (v2 workspace route, expanded sidebar only): `layout.tsx` skips `<TopBar />` when `onV2WorkspaceRoute && !versionMismatch && sidebarOutsideColumn`; the tab bar is now the Electron drag region (`drag` on the bar root, `no-drag` on tabs track / add button / trailing — `packages/panes` `TabBar.tsx`); `RightSidebarToggle` + non-Mac `WindowControls` moved into the tab-bar trailing slot (`v2-workspace/$workspaceId/page.tsx`). Collapsed/closed sidebar still shows the TopBar (its inset keeps content clear of macOS traffic lights). Workspace title breadcrumb no longer renders on this route. |
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
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
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
41 changes: 41 additions & 0 deletions
41
apps/desktop/src/renderer/commandPalette/modules/addProject/commands.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { FolderInputIcon, LayoutTemplateIcon, PlusIcon } from "lucide-react"; | ||
| import { useAddRepositoryModalStore } from "renderer/stores/add-repository-modal"; | ||
| import { useFolderImportIntent } from "renderer/stores/folder-import-intent"; | ||
| import type { Command, CommandProvider } from "../../core/types"; | ||
|
|
||
| export const addProjectProvider: CommandProvider = { | ||
| id: "add-project", | ||
| provide: () => { | ||
| const commands: Command[] = [ | ||
| { | ||
| id: "addProject.cloneFromUrl", | ||
| title: "Clone from URL", | ||
| section: "add-project", | ||
| icon: PlusIcon, | ||
| keywords: ["add project", "repository", "repo", "git", "clone"], | ||
| run: () => { | ||
| void useAddRepositoryModalStore.getState().openNewProject(); | ||
| }, | ||
| }, | ||
| { | ||
| id: "addProject.openFromFolder", | ||
| title: "Open from folder", | ||
| section: "add-project", | ||
| icon: FolderInputIcon, | ||
| keywords: ["add project", "import", "local", "directory"], | ||
| run: () => useFolderImportIntent.getState().request(), | ||
| }, | ||
| { | ||
| id: "addProject.startFromTemplate", | ||
| title: "Start from a template", | ||
| section: "add-project", | ||
| icon: LayoutTemplateIcon, | ||
| keywords: ["add project", "new", "gallery", "starter"], | ||
| run: () => { | ||
| void useAddRepositoryModalStore.getState().openTemplateGallery(); | ||
| }, | ||
| }, | ||
| ]; | ||
| return commands; | ||
| }, | ||
| }; |
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
41 changes: 41 additions & 0 deletions
41
apps/desktop/src/renderer/commandPalette/ui/FolderImportMount/FolderImportMount.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { toast } from "@superset/ui/sonner"; | ||
| import { useNavigate } from "@tanstack/react-router"; | ||
| import { useEffect, useRef } from "react"; | ||
| import { useFolderFirstImport } from "renderer/routes/_authenticated/_dashboard/components/AddRepositoryModals/hooks/useFolderFirstImport"; | ||
| import { useFolderImportIntent } from "renderer/stores/folder-import-intent"; | ||
|
|
||
| export function FolderImportMount() { | ||
| const tick = useFolderImportIntent((s) => s.tick); | ||
| const navigate = useNavigate(); | ||
| const folderImport = useFolderFirstImport({ | ||
| onError: (message) => { | ||
| toast.error(`Import failed: ${message}`); | ||
| }, | ||
| onMultipleProjects: ({ candidates }) => { | ||
| toast.error("Import failed", { | ||
| description: `Multiple projects use this repository (${candidates.length}). Choose the project in settings to set it up on this device.`, | ||
| action: { | ||
| label: "Open Projects", | ||
| onClick: () => navigate({ to: "/settings/projects" }), | ||
| }, | ||
| }); | ||
| }, | ||
| }); | ||
| const folderImportRef = useRef(folderImport); | ||
| folderImportRef.current = folderImport; | ||
| // Seed with the mount-time tick so a remount doesn't replay an import | ||
| // triggered earlier in the session. | ||
| const lastTickRef = useRef(tick); | ||
|
|
||
| useEffect(() => { | ||
| if (tick === lastTickRef.current) return; | ||
| lastTickRef.current = tick; | ||
| void folderImportRef.current.start().then((result) => { | ||
| if (result) { | ||
| toast.success("Project ready — open it from the sidebar."); | ||
| } | ||
| }); | ||
| }, [tick]); | ||
|
|
||
| return null; | ||
| } | ||
1 change: 1 addition & 0 deletions
1
apps/desktop/src/renderer/commandPalette/ui/FolderImportMount/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { FolderImportMount } from "./FolderImportMount"; |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastTickRefis a local ref that resets to0whenever the component mounts. Iftickin the store is already> 0at mount time (e.g., the user triggered a folder import earlier in the same session, then this subtree remounted due to a parent re-render or React StrictMode's double-invoke), the conditiontick !== lastTickRef.currentfires immediately and callsfolderImport.start()again with no user intent. Consider initialisinglastTickRefto the current store tick at mount rather than0.Prompt To Fix With AI