fix(navbar): hide Create New button when user has no creation permiss…#40927
fix(navbar): hide Create New button when user has no creation permiss…#40927rish106-hub wants to merge 2 commits into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📜 Recent review details⏰ 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). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (7)📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-02-10T16:32:42.586ZApplied to files:
📚 Learning: 2026-05-11T20:30:35.265ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-05-06T12:21:44.083ZApplied to files:
📚 Learning: 2026-03-27T14:52:56.865ZApplied to files:
🔇 Additional comments (3)
WalkthroughThis PR fixes a UX issue where the "Create New" navbar button appeared disabled when users lacked creation permissions. The fix tightens the permission check in the menu hook to require both the user's create-room permission and non-empty menu items, and adds a conditional render guard in the component to return ChangesCreate Button Permission Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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 |
🦋 Changeset detectedLatest commit: 4c64bb3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ions
Closes #40731
Proposed changes (including videos or screenshots)
The "Create New" (+) button in the navbar was rendering as a disabled button when the user had no room creation permissions. A disabled-but-visible button is confusing — users with no permissions should not see it at all.
Fix:
useCreateNewMenunow also checkscreateRoomItems.length > 0before including the section, andNavBarItemCreateNewreturnsnullwhen sections array is empty.Issue(s)
Closes #40731
Steps to test or reproduce
Further comments
Summary by CodeRabbit