feat: Sidebar custom categories - #41539
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 |
🦋 Changeset detectedLatest commit: 2f2739c The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (4)
|
| Layer / File(s) | Summary |
|---|---|
Category contracts and preference persistence packages/core-typings/src/IUser.ts, packages/rest-typings/..., apps/meteor/server/..., apps/meteor/tests/end-to-end/api/sidebar-custom-categories.ts, docs/features/custom-sidebar-categories.md, .changeset/odd-times-sleep.md |
Adds ISidebarCustomCategory, preference validation, server support, API tests, translations, licensing, documentation, and release metadata. |
Category state and management UI
| Layer / File(s) | Summary |
|---|---|
Category state and management UI apps/meteor/client/sidebar/hooks/*, apps/meteor/client/sidebar/categories/*, packages/i18n/src/locales/en.i18n.json |
Adds category persistence, validation, room movement, unread settings, ordering, menus, licensing behavior, and category modals. |
Grouped sidebar data and rendering
| Layer / File(s) | Summary |
|---|---|
Grouped sidebar data and rendering apps/meteor/client/sidebar/hooks/useRoomList.ts, apps/meteor/client/sidebar/RoomList/*, apps/meteor/client/sidebar/hooks/useRoomList.spec.tsx, apps/meteor/tests/e2e/sidebar.spec.ts |
Changes the room list to grouped data with custom categories, empty groups, unread handling, persisted ordering, and group controls. |
Room grouping and creation integration
| Layer / File(s) | Summary |
|---|---|
Room grouping and creation integration apps/meteor/client/sidebar/RoomMenu.tsx, apps/meteor/client/sidebar/categories/*, apps/meteor/client/views/room/Header/*, apps/meteor/client/navbar/NavBarPagesGroup/*, apps/meteor/client/sidebar/RoomMenu.spec.tsx, apps/meteor/client/sidebar/categories/*.spec.tsx |
Adds category-aware room menus and room-header controls. Room creation modals now expose success callbacks for category assignment and menu actions. |
End-to-end category validation
| Layer / File(s) | Summary |
|---|---|
End-to-end category validation apps/meteor/tests/e2e/sidebar-custom-categories.spec.ts, apps/meteor/tests/e2e/page-objects/fragments/*, apps/meteor/tests/e2e/page-objects/home-channel.ts, apps/meteor/tests/e2e/*.spec.ts |
Adds Enterprise Edition coverage for category creation, management, room movement, header grouping, menu behavior, licensing, and keyboard navigation. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Merge Risk: 🟡 Moderate · up to 35365
The feature adds personal sidebar categories, but the current implementation still has concrete merge-readiness issues: category-created channels can receive an undefined name, validation behavior differs between API paths, and the creation dialog may allow duplicate submissions during asynchronous work. These should be fixed or explicitly accepted before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | 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 |
|---|---|---|
| Linked Issues check | ✅ Passed | The changes implement user-defined sidebar sections for organizing rooms, including creation, assignment, ordering, renaming, and deletion [#38663]. |
| Out of Scope Changes check | ✅ Passed | The changes support custom sidebar categories, their integrations, licensing, documentation, validation, and test coverage without unrelated code. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and concisely identifies the main change: adding custom categories to the sidebar. |
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
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 @coderabbitai help to get the list of available commands.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #41539 +/- ##
===========================================
+ Coverage 69.29% 69.34% +0.04%
===========================================
Files 4255 4275 +20
Lines 168629 169716 +1087
Branches 30008 30296 +288
===========================================
+ Hits 116859 117686 +827
- Misses 46599 46832 +233
- Partials 5171 5198 +27
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
cd8dd76 to
b80214e
Compare
1458dbd to
a968e75
Compare
a968e75 to
35c714a
Compare
0b26aea to
58ea664
Compare
b58e5d6 to
2d87904
Compare
…s-style augmentation
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx">
<violation number="1" location="apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx:11">
P2: When a licensed user opens a non-omnichannel room without a subscription, this branch renders category controls instead of returning nothing. The controls call `rooms.setCategory`, but that endpoint silently ignores rooms without the user's subscription, so moving or removing the room appears to succeed while doing nothing. Restore a `useUserIsSubscribed()` guard before rendering the category menu.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
…improved category management
…comments and simplifying room category handling
There was a problem hiding this comment.
1 issue found across 22 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/client/sidebar/hooks/useCustomCategories.ts">
<violation number="1" location="apps/meteor/client/sidebar/hooks/useCustomCategories.ts:170">
P2: When a user first toggles a setting for a system group, that group jumps to the front of the sidebar because omitted groups receive the maximum sort rank. Preserve the existing `sidebarSectionsOrder` for groups absent from the persisted entries, or persist a complete initial order before sorting.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| const existing = allEntries.find((entry) => entry._id === id); | ||
| const next = existing | ||
| ? allEntries.map((entry) => (entry._id === id ? { ...entry, ...patch } : entry)) | ||
| : [...allEntries, { _id: id, name: id, default: true, ...patch }]; |
There was a problem hiding this comment.
P2: When a user first toggles a setting for a system group, that group jumps to the front of the sidebar because omitted groups receive the maximum sort rank. Preserve the existing sidebarSectionsOrder for groups absent from the persisted entries, or persist a complete initial order before sorting.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/sidebar/hooks/useCustomCategories.ts, line 170:
<comment>When a user first toggles a setting for a system group, that group jumps to the front of the sidebar because omitted groups receive the maximum sort rank. Preserve the existing `sidebarSectionsOrder` for groups absent from the persisted entries, or persist a complete initial order before sorting.</comment>
<file context>
@@ -183,8 +155,61 @@ export const useCustomCategories = () => {
+ const existing = allEntries.find((entry) => entry._id === id);
+ const next = existing
+ ? allEntries.map((entry) => (entry._id === id ? { ...entry, ...patch } : entry))
+ : [...allEntries, { _id: id, name: id, default: true, ...patch }];
+ return persist(next);
+ },
</file context>
…e related code - Updated type imports and usages from ISidebarCustomCategory to ISidebarCategory across multiple files. - Adjusted user preferences and API endpoints to reflect the new category structure. - Removed unused hooks and functions related to custom categories. - Modified tests to align with the new category naming conventions.
5b80852 to
5dd6804
Compare
…le from default property
…t custom category names
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
59d7a6a to
72e6e76
Compare
72e6e76 to
2f2739c
Compare
Proposed changes (including videos or screenshots)
Important
This feature is enterprise
Allows users create personal, named groups of rooms in the sidebar.
Categories appear alongside the standard groups (Favorites, Teams, Channels, DMs), can be reordered, renamed, and deleted, and each controls its own "Show unreads" / "Keep unreads on top" behavior.
Room assignment is exclusive — a room belongs to exactly one category, one system group, or Favorites at a time.
Issue(s)
Closes #38663
Steps to test or reproduce
Further comments
CORE-2436
Summary by CodeRabbit
New Features
Documentation