Skip to content

fix: make navigation more user-friendly#7599

Merged
pandeymangg merged 7 commits intomainfrom
fix/navigation
Apr 9, 2026
Merged

fix: make navigation more user-friendly#7599
pandeymangg merged 7 commits intomainfrom
fix/navigation

Conversation

@jobenjada
Copy link
Copy Markdown
Member

@jobenjada jobenjada commented Mar 26, 2026

…lti-organization support and new modals

- Added props for multi-organization features in EnvironmentLayout.
- Updated MainNavigation to include organization and project management modals.
- Introduced new translations for organization and workspace changes.
@jobenjada jobenjada requested a review from Dhruwang March 26, 2026 14:28
@jobenjada jobenjada marked this pull request as ready for review April 1, 2026 15:01
@jobenjada jobenjada requested review from pandeymangg and removed request for Dhruwang April 1, 2026 15:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

Walkthrough

The PR modifies the environment layout and navigation components to support multi-organization features and access control. License-related and access-control flags are propagated from the environment layout server component to the main navigation. The navigation component is significantly refactored to add organization and project switcher dropdowns that replace the previous user switch section, with async data loading and project creation limit enforcement. Additionally, an icon in the project breadcrumb is updated from HotelIcon to FoldersIcon.

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

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.
Description check ⚠️ Warning PR description is incomplete and lacks critical sections required by the template including 'What does this PR do', 'How should this be tested', and required checklist items. Complete the PR description by: (1) Replacing the image with a detailed explanation of changes, (2) Filling out 'How should this be tested' section, (3) Checking off required checklist items, (4) Following Conventional Commits specification in the title if not already compliant.
Title check ❓ Inconclusive The title is vague and generic, using the non-descriptive phrase 'make navigation more user-friendly' that doesn't convey specific information about the actual changes made. Replace with a specific title that describes the main change, e.g., 'feat: add workspace and organization switchers to navigation' or 'feat: replace user switch with workspace and organization switchers'.

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


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
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: 3

🤖 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/web/app/`(app)/environments/[environmentId]/components/MainNavigation.tsx:
- Around line 297-309: The loadProjects and loadOrganizations callbacks
currently only handle the resolved result path and never clear the loading flags
if the fetch promise rejects; wrap the async work in a try/catch/finally (or
append .catch/.finally) inside the useCallback for loadProjects and mirror the
same pattern in loadOrganizations so that setIsLoadingProjects(false) and
setIsLoadingOrganizations(false) always run in finally, and in catch set the
appropriate error state (e.g., setWorkspaceLoadError using
getFormattedErrorMessage(result/error) or a fallback) after calling
getProjectsForSwitcherAction/getOrganizationsForSwitcherAction; keep the
existing sorting and setProjects/setOrganizations logic in the try block.
- Around line 75-92: Duplicate route-matching logic and workspace settings
metadata used in isActiveProjectSetting and isActiveOrganizationSetting (and the
corresponding list/matcher in project-breadcrumb.tsx) should be extracted into a
single shared helper/config module; create a new helper (e.g., export functions
or constants like isActiveProjectSettingMatcher,
isActiveOrganizationSettingMatcher, and WORKSPACE_SETTINGS or
ACCOUNT_SETTINGS_PATTERN) and replace the local implementations in
MainNavigation.tsx and project-breadcrumb.tsx with imports from that module so
both files call the same matcher/constants.
- Around line 442-445: The dropdown trigger elements used with
DropdownMenuTrigger asChild (the workspace switcher, organization switcher and
user trigger) currently render as <div> and use switcherTriggerClasses which
includes focus:outline-none; replace each <div> child with a <button
type="button"> element, add an appropriate aria-label when isCollapsed (e.g.,
"Open workspace menu", "Open organization menu", "Open user menu") so icon-only
buttons are accessible, and remove focus:outline-none from
switcherTriggerClasses in favor of visible focus styles (e.g.,
focus-visible:ring or similar) so keyboard focus is apparent; update the
components that use switcherTriggerClasses and the three DropdownMenuTrigger
asChild usages to use the new button + aria-label pattern.
🪄 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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fd36da16-23b0-4116-b197-719a8f055035

📥 Commits

Reviewing files that changed from the base of the PR and between 59cc9c5 and 1bc9918.

⛔ Files ignored due to path filters (1)
  • apps/web/locales/en-US.json is excluded by !apps/web/locales/**
📒 Files selected for processing (3)
  • apps/web/app/(app)/environments/[environmentId]/components/EnvironmentLayout.tsx
  • apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx
  • apps/web/app/(app)/environments/[environmentId]/components/project-breadcrumb.tsx

Comment thread apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx Outdated
@mattinannt mattinannt removed the request for review from pandeymangg April 2, 2026 10:45
Copy link
Copy Markdown
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@jobenjada please fix failing checks and coderabbit comments.

after that you can re-request a review from Anshuman :-)

@jobenjada jobenjada requested review from pandeymangg and xernobyl and removed request for pandeymangg April 2, 2026 12:16
@mattinannt mattinannt requested review from mattinannt and removed request for mattinannt April 6, 2026 13:18
@jobenjada jobenjada requested a review from xernobyl April 8, 2026 11:46
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@xernobyl xernobyl left a comment

Choose a reason for hiding this comment

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

LGTM

@jobenjada jobenjada added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 8, 2026
@pandeymangg pandeymangg added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit d96304d Apr 9, 2026
17 checks passed
@pandeymangg pandeymangg deleted the fix/navigation branch April 9, 2026 08:24
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