Skip to content

[WEB-5582] chore: top nav and user menu improvement#8245

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
chore-sidebar-preferences-and-user-menu-improvement
Dec 4, 2025
Merged

[WEB-5582] chore: top nav and user menu improvement#8245
sriramveeraghanta merged 2 commits intopreviewfrom
chore-sidebar-preferences-and-user-menu-improvement

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Dec 4, 2025

Description

This PR includes top nav and user menu improvements.

Type of Change

  • Improvement
  • Code refactoring

Summary by CodeRabbit

  • Style

    • Improved spacing and alignment in navigation dialog options and input fields.
  • Refactor

    • Updated navigation menu implementation for consistency and improved internal navigation handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@anmolsinghbhatia anmolsinghbhatia self-assigned this Dec 4, 2025
Copilot AI review requested due to automatic review settings December 4, 2025 15:00
@makeplane
Copy link

makeplane bot commented Dec 4, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

Two UI components were updated: styling adjustments to flex containers and input margins in a navigation customization dialog, and refactoring of navigation items in a user menu from Link components to CustomMenu.MenuItem with imperative router.push() calls for navigation.

Changes

Cohort / File(s) Summary
Navigation UI Styling
apps/web/core/components/navigation/customize-navigation-dialog.tsx
Flex container labels changed from "items-center" to "gap-2"; input elements gain "mt-1" top margin for alignment adjustment.
User Menu Navigation Refactor
apps/web/core/components/workspace/sidebar/user-menu-root.tsx
Link-wrapped navigation items replaced with CustomMenu.MenuItem components; added useRouter hook; navigation now uses imperative router.push() instead of declarative Link elements for account settings, preferences, and God Mode routes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify CustomMenu.MenuItem integration and router.push() calls are correctly implemented
  • Confirm no broken navigation routes from the Link → router.push() conversion
  • Check styling changes in customize-navigation-dialog.tsx render correctly across screen sizes

Poem

🐰 A hop through menus, styling refined,
Links transformed to router calls so kind,
Flex gaps align, margins find their place,
Navigation flows with graceful pace!

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title mentions 'top nav and user menu improvement' but the actual changes are UI layout adjustments in the customize-navigation dialog and refactoring user menu navigation from Link components to router.push calls, which partially aligns with the user menu portion but doesn't capture the navigation refactoring aspect or match the PR objectives mentioning 'sidebar preferences'. Consider a more specific title that reflects both the UI layout changes and the navigation refactoring, such as 'Refactor user menu navigation and customize navigation UI' or update to match the stated PR objectives about sidebar preferences.
Description check ❓ Inconclusive The PR description is minimal and vague, lacking sufficient detail about the specific changes and their rationale. Expand the description to explain what improvements were made, why the refactoring was necessary, and provide details about the navigation changes and their impact.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-sidebar-preferences-and-user-menu-improvement

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

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors navigation patterns in the user menu and improves radio button alignment in the navigation preferences dialog. The changes replace Next.js Link components with router.push() callbacks in menu items, aligning with the established pattern used throughout sidebar components in the codebase.

Key changes:

  • Migrated from wrapping CustomMenu.MenuItem with Link to using onClick handlers with router.push()
  • Fixed radio button alignment by adjusting flex properties and adding top margin
  • Removed unused Link import and added useRouter from "next/navigation"

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/web/core/components/workspace/sidebar/user-menu-root.tsx Refactored navigation from Link wrapping to onClick with router.push for Settings, Preferences, and God Mode menu items
apps/web/core/components/navigation/customize-navigation-dialog.tsx Fixed radio button vertical alignment by removing items-center and adding mt-1 to input elements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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: 2

🧹 Nitpick comments (1)
apps/web/core/components/workspace/sidebar/user-menu-root.tsx (1)

95-104: Consider aligning Sign Out with the new navigation pattern.

The Sign Out item uses a button inside CustomMenu.MenuItem, while the newly refactored Settings, Preferences, and God Mode items use CustomMenu.MenuItem with onClick directly. For consistency, consider refactoring Sign Out to match the new pattern.

Apply this diff to align the pattern:

-      <div className={`${isUserInstanceAdmin ? "pb-2" : ""}`}>
-        <CustomMenu.MenuItem>
-          <button
-            type="button"
-            className="flex w-full items-center gap-2 rounded text-xs hover:bg-custom-background-80"
-            onClick={handleSignOut}
-          >
-            <LogOut className="size-4 stroke-[1.5]" />
-            {t("sign_out")}
-          </button>
-        </CustomMenu.MenuItem>
-      </div>
+      <div className={`${isUserInstanceAdmin ? "pb-2" : ""}`}>
+        <CustomMenu.MenuItem onClick={handleSignOut}>
+          <div className="flex w-full items-center gap-2 rounded text-xs">
+            <LogOut className="size-4 stroke-[1.5]" />
+            {t("sign_out")}
+          </div>
+        </CustomMenu.MenuItem>
+      </div>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c390604 and 633d993.

📒 Files selected for processing (2)
  • apps/web/core/components/navigation/customize-navigation-dialog.tsx (2 hunks)
  • apps/web/core/components/workspace/sidebar/user-menu-root.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/navigation/customize-navigation-dialog.tsx
  • apps/web/core/components/workspace/sidebar/user-menu-root.tsx
🧠 Learnings (2)
📚 Learning: 2025-10-21T17:22:05.204Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7989
File: apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx:45-46
Timestamp: 2025-10-21T17:22:05.204Z
Learning: In the makeplane/plane repository, the refactor from useParams() to params prop is specifically scoped to page.tsx and layout.tsx files in apps/web/app (Next.js App Router pattern). Other components (hooks, regular client components, utilities) should continue using the useParams() hook as that is the correct pattern for non-route components.

Applied to files:

  • apps/web/core/components/workspace/sidebar/user-menu-root.tsx
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • apps/web/core/components/workspace/sidebar/user-menu-root.tsx
🧬 Code graph analysis (1)
apps/web/core/components/workspace/sidebar/user-menu-root.tsx (4)
packages/ui/src/dropdowns/custom-menu.tsx (1)
  • CustomMenu (532-532)
apps/space/core/store/publish/publish.store.ts (1)
  • workspaceSlug (93-95)
packages/i18n/src/store/index.ts (1)
  • t (223-244)
packages/constants/src/endpoints.ts (1)
  • GOD_MODE_URL (7-7)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: Agent
  • GitHub Check: Build and lint web apps
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (3)
apps/web/core/components/navigation/customize-navigation-dialog.tsx (1)

262-294: LGTM! Improved radio button alignment pattern.

The change from flex items-center to flex gap-2 with mt-1 on the input aligns the radio button with the first line of text rather than centering it vertically with the entire text block. This is a better UX pattern when labels include multi-line descriptions.

apps/web/core/components/workspace/sidebar/user-menu-root.tsx (2)

3-3: LGTM! Correct router setup for App Router.

The import and initialization of useRouter from next/navigation is appropriate for imperative navigation in menu items.

Also applies to: 24-25


110-114: LGTM! God Mode navigation follows the new pattern.

The refactor to CustomMenu.MenuItem with router.push(GOD_MODE_URL) is consistent with the Settings and Preferences changes, and properly uses translation.

</div>
</CustomMenu.MenuItem>
</Link>
<CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account`)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, read the component file to see the useParams() usage
cat -n apps/web/core/components/workspace/sidebar/user-menu-root.tsx | head -100

Repository: makeplane/plane

Length of output: 4286


🏁 Script executed:

# Find where UserMenuRoot is imported and used
rg -n "UserMenuRoot" --type tsx --type ts -C 2

Repository: makeplane/plane

Length of output: 86


🏁 Script executed:

# Check the useParams hook and its type signature in the codebase
rg -n "useParams" apps/web/core/components/workspace/sidebar/user-menu-root.tsx -A 3 -B 3

Repository: makeplane/plane

Length of output: 529


🏁 Script executed:

# Search for UserMenuRoot imports and usage
rg "UserMenuRoot" --type ts -C 3

Repository: makeplane/plane

Length of output: 2208


🏁 Script executed:

# Check the actual routes where UserMenuRoot might be used
rg "sidebar" apps/web/core/components/workspace --type ts -l | head -10

Repository: makeplane/plane

Length of output: 719


🏁 Script executed:

# Look for type definitions or custom hooks for useParams
fd "use-params" apps/web

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Check if there's a Next.js configuration that might affect useParams
cat tsconfig.json | head -50

Repository: makeplane/plane

Length of output: 104


🏁 Script executed:

# Check the top-navigation-root.tsx file where UserMenuRoot is used
cat -n apps/web/ce/components/navigations/top-navigation-root.tsx | head -50

Repository: makeplane/plane

Length of output: 2461


🏁 Script executed:

# Look for app router structure with workspaceSlug
find apps/web -type f -name "layout.tsx" -o -name "page.tsx" | grep -E "workspace|workspaceSlug" | head -20

Repository: makeplane/plane

Length of output: 1631


🏁 Script executed:

# Search for route structure with [workspaceSlug]
rg "\[workspaceSlug\]" --type ts -l

Repository: makeplane/plane

Length of output: 1003


🏁 Script executed:

# Check the actual route segments in the app directory
find apps/web -type d -name "\[workspaceSlug\]" 2>/dev/null

Repository: makeplane/plane

Length of output: 93


🏁 Script executed:

# Find tsconfig.json in the workspace root or apps/web
find apps/web -name "tsconfig.json" -o -name "tsconfig*.json" | head -5

Repository: makeplane/plane

Length of output: 81


🏁 Script executed:

# Check if there's a root tsconfig
find . -maxdepth 2 -name "tsconfig.json" 2>/dev/null

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Look at how other components in the same file handle useParams
rg "useParams()" apps/web/core/components/workspace/sidebar --type ts -A 3 -B 1

Repository: makeplane/plane

Length of output: 16068


🏁 Script executed:

# Check if workspaceSlug is used elsewhere without guards in same directory
rg "workspaceSlug" apps/web/core/components/workspace/sidebar/user-menu-root.tsx -C 5

Repository: makeplane/plane

Length of output: 1232


🏁 Script executed:

# Check TypeScript strictNullChecks setting
cat apps/web/tsconfig.json | grep -A 5 "strictNullChecks\|compilerOptions"

Repository: makeplane/plane

Length of output: 388


Add type guards for workspaceSlug and translate the "Preferences" label.

workspaceSlug from useParams() is potentially undefined under strict null checks (strictNullChecks: true in tsconfig). This would result in navigating to /${undefined}/settings/account. Add a guard or assertion (see quick-actions.tsx for the pattern in this codebase). Additionally, the "Preferences" label on line 89 is hardcoded while "settings" on line 83 is translated—apply the same t() call for consistency.

🤖 Prompt for AI Agents
In apps/web/core/components/workspace/sidebar/user-menu-root.tsx around line 80,
add a type guard/assertion for workspaceSlug (from useParams()) before using it
in router.push to avoid navigating to /undefined — follow the pattern used in
quick-actions.tsx (check for null/undefined and return early or assert with a
non-null operator where appropriate). Also replace the hardcoded "Preferences"
label on line 89 with the translated string via t() to match the translated
"settings" label usage.

<CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account/preferences`)}>
<div className="flex w-full items-center gap-2 rounded text-xs">
<Settings2 className="h-4 w-4 stroke-[1.5]" />
<span>Preferences</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use translation for "Preferences" label.

Line 89 hardcodes "Preferences" while line 83 uses {t("settings")} for consistency with i18n. This prevents proper localization.

Apply this diff to use translation:

-            <span>Preferences</span>
+            <span>{t("preferences")}</span>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span>Preferences</span>
<span>{t("preferences")}</span>
🤖 Prompt for AI Agents
In apps/web/core/components/workspace/sidebar/user-menu-root.tsx around line 89,
the "Preferences" label is hardcoded; replace the literal string with the i18n
call (e.g., use {t("preferences")}) to match the pattern used for
{t("settings")} for proper localization, and add the "preferences" key to the
locale translation files if it does not already exist.

@anmolsinghbhatia anmolsinghbhatia changed the title [WEB-5582] chore: sidebar preferences and user menu improvement [WEB-5582] chore: top nav and user menu improvement Dec 4, 2025
@sriramveeraghanta sriramveeraghanta merged commit 392c8cf into preview Dec 4, 2025
12 of 13 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-sidebar-preferences-and-user-menu-improvement branch December 4, 2025 15:55
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* chore: user menu code refactor

* chore: CustomizeNavigationDialog enhancements
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* chore: user menu code refactor

* chore: CustomizeNavigationDialog enhancements
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* chore: user menu code refactor

* chore: CustomizeNavigationDialog enhancements
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.

4 participants