feat(desktop): re-add Settings to org dropdown for v1#4093
Conversation
Settings was removed from the OrganizationDropdown when it moved to the sidebar footer. v1 still relies on the dropdown, so add it back with a TODO to remove once v1 is gone. Item appears in both the topbar dropdown and the sidebar header dropdown.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a "Settings" entry to the OrganizationDropdown menu: imports a cog icon and the ChangesOrganization Dropdown Settings Item
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile Summary
Confidence Score: 4/5Safe to merge; only a style-level duplication of an existing abstraction. The change is straightforward and functionally correct. The only issue is that the inline hotkey-display pattern duplicates the existing HotkeyMenuShortcut component, which is a P2 style concern. No files require special attention beyond the single changed file.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx | Adds a Settings menu item with hotkey shortcut to OrganizationDropdown for v1 compatibility; the hotkey display logic duplicates the existing HotkeyMenuShortcut abstraction. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[OrganizationDropdown rendered] --> B{variant?}
B -->|topbar| C[TopBar]
B -->|expanded| D[DashboardSidebarHeader expanded]
B -->|collapsed| E[DashboardSidebarHeader collapsed]
C & D & E --> F[DropdownMenu opens]
F --> G[Settings item - NEW]
G --> H{settingsHotkey !== 'Unassigned'?}
H -->|yes| I[Render DropdownMenuShortcut]
H -->|no| J[No shortcut shown]
I & J --> K[onSelect → navigate to /settings/account]
F --> L[Manage members]
F --> M[Switch organization]
F --> N[Log out]
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/TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx:25
**Duplicates existing `HotkeyMenuShortcut` abstraction**
`HotkeyMenuShortcut` in `renderer/components/HotkeyMenuShortcut` already encapsulates the `useHotkeyDisplay` call, the `"Unassigned"` guard, and the `DropdownMenuShortcut` render. The inline expansion here duplicates that logic and leaves the `settingsHotkey` variable unused after the refactor.
```suggestion
import { HotkeyMenuShortcut } from "renderer/components/HotkeyMenuShortcut/HotkeyMenuShortcut";
```
### Issue 2 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx:139-147
**Use `HotkeyMenuShortcut` instead of inline expansion**
The codebase has a dedicated `HotkeyMenuShortcut` component that handles the `useHotkeyDisplay` + `"Unassigned"` guard + `DropdownMenuShortcut` pattern. Using it here removes the need for the `settingsHotkey` local variable and keeps the pattern consistent across the app.
```suggestion
<DropdownMenuItem
onSelect={() => navigate({ to: "/settings/account" })}
>
<HiOutlineCog6Tooth className="h-4 w-4" />
<span>Settings</span>
<HotkeyMenuShortcut hotkeyId="OPEN_SETTINGS" />
</DropdownMenuItem>
```
Reviews (1): Last reviewed commit: "feat(desktop): re-add Settings entry to ..." | Re-trigger Greptile
| HiOutlineCog6Tooth, | ||
| } from "react-icons/hi2"; | ||
| import { useCurrentPlan } from "renderer/hooks/useCurrentPlan"; | ||
| import { useHotkeyDisplay } from "renderer/hotkeys"; |
There was a problem hiding this comment.
Duplicates existing
HotkeyMenuShortcut abstraction
HotkeyMenuShortcut in renderer/components/HotkeyMenuShortcut already encapsulates the useHotkeyDisplay call, the "Unassigned" guard, and the DropdownMenuShortcut render. The inline expansion here duplicates that logic and leaves the settingsHotkey variable unused after the refactor.
| import { useHotkeyDisplay } from "renderer/hotkeys"; | |
| import { HotkeyMenuShortcut } from "renderer/components/HotkeyMenuShortcut/HotkeyMenuShortcut"; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx
Line: 25
Comment:
**Duplicates existing `HotkeyMenuShortcut` abstraction**
`HotkeyMenuShortcut` in `renderer/components/HotkeyMenuShortcut` already encapsulates the `useHotkeyDisplay` call, the `"Unassigned"` guard, and the `DropdownMenuShortcut` render. The inline expansion here duplicates that logic and leaves the `settingsHotkey` variable unused after the refactor.
```suggestion
import { HotkeyMenuShortcut } from "renderer/components/HotkeyMenuShortcut/HotkeyMenuShortcut";
```
How can I resolve this? If you propose a fix, please make it concise.| <DropdownMenuItem | ||
| onSelect={() => navigate({ to: "/settings/account" })} | ||
| > | ||
| <HiOutlineCog6Tooth className="h-4 w-4" /> | ||
| <span>Settings</span> | ||
| {settingsHotkey !== "Unassigned" && ( | ||
| <DropdownMenuShortcut>{settingsHotkey}</DropdownMenuShortcut> | ||
| )} | ||
| </DropdownMenuItem> |
There was a problem hiding this comment.
Use
HotkeyMenuShortcut instead of inline expansion
The codebase has a dedicated HotkeyMenuShortcut component that handles the useHotkeyDisplay + "Unassigned" guard + DropdownMenuShortcut pattern. Using it here removes the need for the settingsHotkey local variable and keeps the pattern consistent across the app.
| <DropdownMenuItem | |
| onSelect={() => navigate({ to: "/settings/account" })} | |
| > | |
| <HiOutlineCog6Tooth className="h-4 w-4" /> | |
| <span>Settings</span> | |
| {settingsHotkey !== "Unassigned" && ( | |
| <DropdownMenuShortcut>{settingsHotkey}</DropdownMenuShortcut> | |
| )} | |
| </DropdownMenuItem> | |
| <DropdownMenuItem | |
| onSelect={() => navigate({ to: "/settings/account" })} | |
| > | |
| <HiOutlineCog6Tooth className="h-4 w-4" /> | |
| <span>Settings</span> | |
| <HotkeyMenuShortcut hotkeyId="OPEN_SETTINGS" /> | |
| </DropdownMenuItem> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OrganizationDropdown/OrganizationDropdown.tsx
Line: 139-147
Comment:
**Use `HotkeyMenuShortcut` instead of inline expansion**
The codebase has a dedicated `HotkeyMenuShortcut` component that handles the `useHotkeyDisplay` + `"Unassigned"` guard + `DropdownMenuShortcut` pattern. Using it here removes the need for the `settingsHotkey` local variable and keeps the pattern consistent across the app.
```suggestion
<DropdownMenuItem
onSelect={() => navigate({ to: "/settings/account" })}
>
<HiOutlineCog6Tooth className="h-4 w-4" />
<span>Settings</span>
<HotkeyMenuShortcut hotkeyId="OPEN_SETTINGS" />
</DropdownMenuItem>
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
* feat(desktop): re-add Settings entry to org dropdown for v1 Settings was removed from the OrganizationDropdown when it moved to the sidebar footer. v1 still relies on the dropdown, so add it back with a TODO to remove once v1 is gone. Item appears in both the topbar dropdown and the sidebar header dropdown. * refactor(desktop): use HotkeyMenuShortcut helper in org dropdown
* feat(desktop): re-add Settings entry to org dropdown for v1 Settings was removed from the OrganizationDropdown when it moved to the sidebar footer. v1 still relies on the dropdown, so add it back with a TODO to remove once v1 is gone. Item appears in both the topbar dropdown and the sidebar header dropdown. * refactor(desktop): use HotkeyMenuShortcut helper in org dropdown
…o-v2 superset-sh#4113 remove skip-all onboarding affordance: integrate fork's githubSyncService import alongside upstream's selectExternalWorktreesForImport in workspaces/procedures/git-status.ts. superset-sh#4115 default new users to v2 + v2 banner in v1: - Adopt upstream's V2_CLOUD flag removal: collapse useIsV2CloudEnabled to a plain boolean (drop isRemoteV2Enabled) and update every callsite back to scalar destructure (TopBar, settings/{behavior,experimental, git,links,terminal}/page, SettingsSidebar/{GeneralSettings,SettingsSidebar}). - ExperimentalSettings.tsx: drop isRemoteV2Enabled-gated 'Early access not enabled' note and Switch disabled prop; simplify track call. - v2-local-override.ts: keep fork's IS_DEV strong default (dev installs land on v2) alongside upstream's hasPriorSupersetUsage probe (initialOptInV2 = IS_DEV ? true : !hasPriorSupersetUsage()). - TopBar.tsx: integrate upstream's useWorkspaceSidebarStore reads with fork's existing chrome layout. - useMigrateV1DataToV2/useMigrateV1DataToV2.ts: re-delete (DU; upstream attempted to revive via superset-sh#4115 vocabulary cleanup; cycle 38 rationale still applies — fork trpc lacks the required procedures). superset-sh#4125 onboarding auto-skip drop, SetupButton design alignment: clean cherry-pick. superset-sh#4175 keep Skip-for-now visible during loading: clean cherry-pick. Replaces v2Projects live query with imperative v2Project.list trpc call; backfill list procedure (jwtProcedure variant) into fork's v2-project router (mirrors get pattern using ctx.organizationIds membership check). superset-sh#4214 stable Adopt button + Adopt-all (skipped): touches v1 ImportWorkspacesPage/V1ImportModal which the fork has removed. The upstream improvements (idempotent adopt-all guard, smarter skip-when- already-running) have no shipping surface in this fork; pick up if and when v1 import modal is reintroduced. superset-sh#4093 re-add Settings to org dropdown for v1: clean cherry-pick.
Summary
OrganizationDropdownso v1 users can reach/settings/accountfrom the org menu (it was removed when Settings moved to the v2 sidebar footer).TODO(v1)comment so it can be removed once v1 is gone.TopBar) and the sidebar header (DashboardSidebarHeader, collapsed + expanded).Test plan
OPEN_SETTINGShotkey shortcut and navigates to/settings/account.bun run typecheckandbun run lintare clean.Summary by cubic
Re-added a Settings item to the organization dropdown so v1 users can open
/settings/accountfrom the menu again. It appears in both the topbar and sidebar header dropdowns, shows theOPEN_SETTINGSshortcut viaHotkeyMenuShortcut, and is taggedTODO(v1)for removal after v1.Written for commit c30e646. Summary will update on new commits.
Summary by CodeRabbit