Skip to content

feat(desktop): v2 chrome — sidebar-hosted toggle/nav, sidebar OpenIn,…#3983

Merged
Kitenite merged 2 commits into
mainfrom
hide-perf-measurer
May 2, 2026
Merged

feat(desktop): v2 chrome — sidebar-hosted toggle/nav, sidebar OpenIn,…#3983
Kitenite merged 2 commits into
mainfrom
hide-perf-measurer

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented May 2, 2026

… drop ResourceConsumption

  • Hide ResourceConsumption in the TopBar on v2 workspace routes.
  • When v2 + sidebar expanded, lift the sidebar out of the TopBar column so the TopBar starts to the right of it. Collapsed/closed sidebars stay inside the column so the TopBar runs full-width across the top.
  • Move SidebarToggle + NavigationControls into the expanded DashboardSidebar header (next to the macOS traffic lights). Bring them back into the TopBar when the sidebar is closed/collapsed. Pads aligned at 80px on Mac for consistent toggle position across both states.
  • Move V2WorkspaceOpenInButton into a top row of the v2 right sidebar; keep it in the TopBar only when the right sidebar is closed. Row collapses via empty:hidden when the button has nothing to render.

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Summary by cubic

Update v2 desktop chrome so the expanded left sidebar hosts the toggle + navigation and the TopBar starts to its right. Open In now stays in the TopBar on v2 routes, and ResourceConsumption is hidden across all v2 pages.

  • New Features

    • When v2 + sidebar expanded, the sidebar header hosts SidebarToggle + NavigationControls next to macOS traffic lights; they return to the TopBar when the sidebar is closed/collapsed. Mac padding defaults while loading and the row self-owns the 80px pad for consistent placement.
    • Collapsed/closed sidebars stay inside the TopBar column so the TopBar runs full width; when expanded in v2, the sidebar is lifted out so the TopBar starts to the right.
  • Refactors

    • Promoted SidebarToggle and NavigationControls to shared _dashboard/components/; removed unused V2WorkspaceSearchBarTrigger.

Written for commit 7c3058a. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Improved sidebar and window chrome positioning on macOS for better alignment with system controls.
  • Refactor

    • Restructured sidebar display logic based on workspace state and feature settings.
    • Consolidated search bar trigger behavior across different workspace route types.

… drop ResourceConsumption

- Hide ResourceConsumption in the TopBar on v2 workspace routes.
- When v2 + sidebar expanded, lift the sidebar out of the TopBar column so
  the TopBar starts to the right of it. Collapsed/closed sidebars stay inside
  the column so the TopBar runs full-width across the top.
- Move SidebarToggle + NavigationControls into the expanded DashboardSidebar
  header (next to the macOS traffic lights). Bring them back into the TopBar
  when the sidebar is closed/collapsed. Pads aligned at 80px on Mac for
  consistent toggle position across both states.
- Move V2WorkspaceOpenInButton into a top row of the v2 right sidebar; keep
  it in the TopBar only when the right sidebar is closed. Row collapses via
  empty:hidden when the button has nothing to render.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34fce52c-979e-4aee-99f4-a4828eab4945

📥 Commits

Reviewing files that changed from the base of the PR and between 038c16a and 7c3058a.

📒 Files selected for processing (12)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/NavigationControls.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/components/HistoryDropdown/HistoryDropdown.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/components/HistoryDropdown/hooks/useRecentlyViewed/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/components/HistoryDropdown/hooks/useRecentlyViewed/useRecentlyViewed.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/components/HistoryDropdown/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/NavigationControls/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/SidebarToggle/SidebarToggle.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/SidebarToggle/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/V2WorkspaceSearchBarTrigger/V2WorkspaceSearchBarTrigger.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/V2WorkspaceSearchBarTrigger/index.ts

📝 Walkthrough

Walkthrough

This pull request restructures the dashboard layout for V2 cloud workspace support by conditionally lifting the workspace sidebar outside the TopBar, detecting platform via Electron TRPC to adjust macOS padding, and simplifying search bar logic by removing the V2WorkspaceSearchBarTrigger component.

Changes

V2 Cloud Layout Restructuring

Layer / File(s) Summary
State & Platform Detection
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
Adds platform query via Electron TRPC to derive isMac flag for conditional padding ("80px" on macOS, "8px" otherwise).
Layout Hierarchy
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx
Conditionally lifts the sidebar panel outside the TopBar column when isV2CloudEnabled, sidebar is open, and not collapsed; otherwise keeps it inside the content column.
Component Rendering
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
Renders new top drag row with SidebarToggle and NavigationControls in the expanded sidebar with platform-specific padding.
TopBar Integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx
Computes sidebarHostsChrome to conditionally render SidebarToggle and NavigationControls only when sidebar is not hosting chrome; gates ResourceConsumption behind !isV2CloudEnabled.
Search Bar Simplification
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/V2WorkspaceSearchBarTrigger/*
Removes V2WorkspaceSearchBarTrigger component and its export; TopBar now renders SearchBarTrigger directly only for non-V2-workspace routes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 The sidebar hops up high, chrome finds a home,
Platform-aware padding keeps macOS alone,
Layout breathes free when V2 clouds arise,
Controls dance between—now you see where chrome lies! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: v2 chrome layout refactoring with sidebar-hosted toggle/nav controls and moving the OpenIn button, while dropping ResourceConsumption.
Description check ✅ Passed The PR description clearly explains the key changes and provides detailed implementation notes, though the template sections (Related Issues, Type of Change, Testing, Screenshots) are not filled out.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hide-perf-measurer

Tip

💬 Introducing [Slack Agent](https://www.coderabbit.ai/agent): Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 2, 2026

Greptile Summary

This PR refactors the v2 desktop chrome layout: the expanded left sidebar is lifted out of the TopBar's flex column so the TopBar only spans the remaining width, and SidebarToggle/NavigationControls move into the sidebar header (returning to the TopBar only when the sidebar is closed/collapsed). Additionally, V2WorkspaceOpenInButton is placed in a top row of the right sidebar and removed from the TopBar while the sidebar is open, and ResourceConsumption is hidden on all v2 workspace routes. The sidebarHostsChrome / sidebarOutsideColumn derivations are consistent across TopBar and layout.tsx, and the empty:hidden trick correctly collapses the right-sidebar OpenIn row when the button has nothing to render.

Confidence Score: 4/5

Safe to merge — all changes are UI layout adjustments with no logic regressions; only P2 style observations noted.

No P0 or P1 findings. The layout lifting logic is symmetric between layout.tsx and TopBar.tsx. The two P2 comments cover a silent padding dependency and an unconditional hook call that is guarded at render-time — neither affects correctness.

DashboardSidebarHeader.tsx — implicit 72+8=80px padding arithmetic; TopBar.tsx — unconditional useV2UserPreferences call on non-v2 routes.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx Extracts sidebarPanel into a variable and conditionally renders it outside vs inside the flex column based on v2 + expanded state; logic matches TopBar's sidebarHostsChrome derivation.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx Introduces sidebarHostsChrome to hide SidebarToggle/NavigationControls from the TopBar when the expanded v2 sidebar hosts them; splits V2WorkspaceOpenInButton rendering behind !isRightSidebarOpen; minor implicit padding dependency.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx Adds a traffic-light-aware drag row hosting SidebarToggle + NavigationControls when the sidebar is expanded; paddingLeft of 72px + parent px-2 (8px) = 80px total, matching the TopBar pad.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/WorkspaceSidebar.tsx Adds a top row with V2WorkspaceOpenInButton inside the right sidebar; empty:hidden correctly collapses the row when the button returns null.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[DashboardLayout render] --> B{isV2CloudEnabled AND sidebar open AND not collapsed?}
    B -- Yes sidebarOutsideColumn=true --> C[sidebarPanel rendered OUTSIDE flex column]
    C --> D[TopBar: paddingLeft=16px, no SidebarToggle or NavControls]
    C --> F[DashboardSidebarHeader: SidebarToggle + NavControls at 72+8=80px]
    B -- No sidebarOutsideColumn=false --> G[sidebarPanel rendered INSIDE flex column]
    G --> I[TopBar: paddingLeft=80px on Mac, shows SidebarToggle + NavControls]

    A --> J{isV2WorkspaceRoute AND isRightSidebarOpen?}
    J -- Yes --> K[V2WorkspaceOpenInButton in WorkspaceSidebar top row]
    J -- No --> L[V2WorkspaceOpenInButton in TopBar]

    A --> M{isV2WorkspaceRoute?}
    M -- Yes --> N[ResourceConsumption hidden]
    M -- No --> O[ResourceConsumption shown in TopBar]
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx:212-218
**Implicit padding dependency — 72 + 8 ≠ comment**

The `72px` value only works as intended because the parent container carries `px-2` (8 px), making the effective inset 80 px — matching the TopBar's pad. This coupling is silent: if the parent's horizontal padding changes, the traffic-light alignment breaks with no obvious link to this constant. A short inline comment (e.g. `/* 72 + 8px (parent px-2) = 80px to clear traffic lights */`) would make the arithmetic explicit for future readers.

### Issue 2 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx:37
**`isRightSidebarOpen` read unconditionally — guards only at render time**

`useV2UserPreferences()` is called on every TopBar render, including routes that are not v2 workspace routes, even though `isRightSidebarOpen` is only used in the JSX condition `isV2WorkspaceRoute && !isRightSidebarOpen`. There's no correctness bug (the branch is properly gated), but if the preferences hook becomes expensive or its collection is not yet initialised on non-v2 routes, the unconditional read may add unnecessary overhead. Consider guarding the hook or noting the intentional early-read for the sake of hook rules.

Reviews (1): Last reviewed commit: "feat(desktop): add top border to v2 righ..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@Kitenite Kitenite force-pushed the hide-perf-measurer branch from fd81bdc to 038c16a Compare May 2, 2026 18:48
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx`:
- Around line 212-218: The left padding for the drag row in
DashboardSidebarHeader is using 72px which misaligns with the TopBar's 80px
padding; update the inline style in the DashboardSidebarHeader component (the
div with className "drag flex h-8 items-center gap-1.5") to use paddingLeft:
isMac ? "80px" : "0px" so the SidebarToggle and NavigationControls stay aligned
when the sidebar changes state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 903ecf69-ec3d-4690-87eb-28d8ec03949a

📥 Commits

Reviewing files that changed from the base of the PR and between 9016225 and 038c16a.

📒 Files selected for processing (4)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/WorkspaceSidebar.tsx

…esourceConsumption on all v2 routes

- Promote SidebarToggle and NavigationControls from TopBar/components/ to
  _dashboard/components/ since they're now shared with DashboardSidebarHeader
  (per AGENTS.md co-location rule). Update import sites.
- Delete unused V2WorkspaceSearchBarTrigger.
- Self-contain the toggle row's traffic-light pad in DashboardSidebarHeader
  (-mx-2 cancels parent px-2; row owns 80px on Mac, 8px otherwise) so the
  alignment doesn't depend on parent padding.
- Hide ResourceConsumption on all v2 cloud routes, not just v2 workspace
  pages (matches the original "hide perf measurer in v2" intent).
- Drop the V2WorkspaceOpenInButton-in-sidebar gate; OpenIn button stays in
  the TopBar for v2 routes regardless of right-sidebar state.
@Kitenite Kitenite merged commit 627f446 into main May 2, 2026
7 of 8 checks passed
@Kitenite Kitenite deleted the hide-perf-measurer branch May 2, 2026 20:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

MocA-Love added a commit to MocA-Love/superset that referenced this pull request May 21, 2026
…ual port

superset-sh#3983 (v2 chrome sidebar-hosted toggle/nav) skipped permanently: the
fork keeps its v1/v2/scratch/tearoff/KeepAliveWorkspaces dual-chrome
structure deliberately, and the upstream PR rearranges the topbar +
sidebar layout in a way that's incompatible with the fork's
`!isTearoff && <TopBar />` / `!isTearoff && !isScratchRoute &&
isWorkspaceSidebarOpen` conditional rendering and `WorkspaceCreatesManager`
mount. Adopting it would either delete fork-only chrome or fight the
PR's sidebar lifting on every render. The cosmetic gain (sidebar-
hosted toggle, ResourceConsumption hide on v2) is not worth the
structural churn; the fork will evolve its v2 chrome on its own.

superset-sh#4211 (pick-workspace prompt) ported manually instead of cherry-picking
since superset-sh#4211 sits on top of superset-sh#3983's layout. The behaviour port is
small and self-contained:
  - new components/CrossVersionMismatchState/{CrossVersionMismatchState.tsx,index.ts}
    copied verbatim from upstream (clean cherry-pick of the two new
    files via `git checkout 56a1f50 -- ...`)
  - layout.tsx: add v2WorkspaceMatch + onV1WorkspaceRoute +
    onV2WorkspaceRoute + versionMismatch derivation alongside the
    existing currentWorkspaceMatch / isV2CloudEnabled
  - layout.tsx: wrap the inner <KeepAliveWorkspaces /> in
    `{versionMismatch ? <CrossVersionMismatchState /> : <KeepAliveWorkspaces />}`
    so cross-version routes show the picker prompt instead of
    rendering an empty page from the wrong-version sidebar.

KeepAliveWorkspaces / WorkspaceCreatesManager / isTearoff / isScratchRoute
unchanged: cross-version mismatch is a Bad State that bypasses the
keep-alive flow entirely (the user has to pick a fresh workspace anyway).
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.

1 participant