Skip to content

feat: Sidebar custom categories - #41539

Open
dougfabris wants to merge 99 commits into
developfrom
feat/custom-categories
Open

feat: Sidebar custom categories#41539
dougfabris wants to merge 99 commits into
developfrom
feat/custom-categories

Conversation

@dougfabris

@dougfabris dougfabris commented Jul 23, 2026

Copy link
Copy Markdown
Member

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.

Kapture 2026-07-29 at 12 59 56

Issue(s)

Closes #38663

Steps to test or reproduce

Further comments

CORE-2436

Review in cubic

Summary by CodeRabbit

New Features

  • Added custom sidebar categories for organizing rooms.
  • Create, rename, delete, reorder, collapse, and manage rooms within categories.
  • Move rooms between Favorites and categories from sidebar menus or room headers.
  • Added unread display and unread-first ordering controls.
  • Added category creation through the “Create new” menu.
  • Added validation and persistence for category names, room assignments, and ordering.
  • Enterprise-only features now provide an upgrade prompt when unavailable.

Documentation

  • Added guidance for custom sidebar categories and related preferences.

@dionisio-bot

dionisio-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f2739c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/i18n Minor
@rocket.chat/meteor Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/ui-composer Major

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

@dougfabris dougfabris added this to the 8.8.0 milestone Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b0f7035f-23b4-459a-81a6-ac32d2ea2704

📥 Commits

Reviewing files that changed from the base of the PR and between 23eb6e8 and 35365c0.

📒 Files selected for processing (1)
  • apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx

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)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (4)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx
apps/meteor/**

📄 CodeRabbit inference engine (CLAUDE.md)

The main Rocket.Chat Meteor application resides in apps/meteor/; place its application code there rather than in other monorepo areas.

Files:

  • apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx
🧠 Learnings (2)
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx
🔇 Additional comments (5)
apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx (5)

2-24: LGTM!


26-43: LGTM!


44-65: LGTM!


67-76: LGTM!


78-88: LGTM!


Walkthrough

Adds Enterprise custom sidebar categories with persisted category data, room assignment, ordering, unread controls, category menus and modals, room-header grouping, updated room creation callbacks, REST validation, documentation, and automated coverage.

Changes

Category contracts and preference persistence

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 ⚠️ 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.
✅ 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.

❤️ Share

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

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.22680% with 300 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.34%. Comparing base (fdd4ed7) to head (cb32b2b).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
unit 71.16% <64.48%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dougfabris
dougfabris force-pushed the feat/custom-categories branch from cd8dd76 to b80214e Compare July 29, 2026 15:44
@dougfabris
dougfabris force-pushed the feat/custom-categories branch 2 times, most recently from 1458dbd to a968e75 Compare July 29, 2026 16:16
@dougfabris
dougfabris force-pushed the feat/custom-categories branch from a968e75 to 35c714a Compare July 30, 2026 21:22
@dougfabris
dougfabris force-pushed the feat/custom-categories branch from 0b26aea to 58ea664 Compare July 31, 2026 13:58
@dougfabris
dougfabris force-pushed the feat/custom-categories branch from b58e5d6 to 2d87904 Compare August 20, 2026 20:23

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread packages/ui-client/src/components/GenericMenu/GenericMenu.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/meteor/client/views/room/Header/icons/RoomGroupingMenu.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/meteor/client/sidebar/RoomMenu.spec.tsx
Comment thread packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts Outdated
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 }];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

Comment thread apps/meteor/server/meteor-methods/users/saveUserPreferences.ts
Comment thread apps/meteor/client/sidebar/hooks/useRoomList.spec.tsx Outdated
…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.
@dougfabris
dougfabris force-pushed the feat/custom-categories branch from 5b80852 to 5dd6804 Compare August 21, 2026 19:56

@hacktron-app hacktron-app Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file

Severity Count
MEDIUM 1

View full scan results

Comment thread apps/meteor/client/sidebar/hooks/useRoomList.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/meteor/client/sidebar/hooks/useCategoryList.ts Outdated
Comment thread apps/meteor/client/sidebar/hooks/useCategoryList.ts Outdated
Comment thread apps/meteor/client/sidebar/hooks/useRoomList.ts Outdated
@gabriellsh
gabriellsh force-pushed the feat/custom-categories branch from 59d7a6a to 72e6e76 Compare August 21, 2026 21:35
@gabriellsh
gabriellsh force-pushed the feat/custom-categories branch from 72e6e76 to 2f2739c Compare August 21, 2026 21:37

@KevLehman KevLehman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BE seems fine

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.

Custom sidebar sections

5 participants