feat: Add draft message badge in sidebar#40216
feat: Add draft message badge in sidebar#40216Polinarr60 wants to merge 2 commits intoRocketChat:developfrom
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: 2f05320 The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 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 |
|
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 (2)
✅ Files skipped from review due to trivial changes (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (13)📓 Common learnings📚 Learning: 2026-01-17T01:51:47.764ZApplied to files:
📚 Learning: 2026-03-20T13:51:23.302ZApplied to files:
📚 Learning: 2026-04-18T12:32:50.305ZApplied to files:
📚 Learning: 2026-03-11T22:04:20.529ZApplied to files:
📚 Learning: 2026-04-17T18:33:24.670ZApplied to files:
📚 Learning: 2026-02-24T19:16:35.307ZApplied to files:
📚 Learning: 2026-04-10T22:42:05.539ZApplied to files:
📚 Learning: 2026-04-17T17:38:12.974ZApplied to files:
📚 Learning: 2026-02-24T19:36:55.089ZApplied to files:
📚 Learning: 2026-04-10T21:17:22.932ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
🔇 Additional comments (1)
WalkthroughAdds a sidebar draft indicator: new storage-key utility, a hook to detect drafts via storage events, a badge component, event emission from the composer, sidebar integrations, and English localization strings for draft labels. Changes
Sequence DiagramsequenceDiagram
participant User
participant MessageBox as MessageBox Component
participant Window as Window (Events)
participant Hook as useRoomDraft Hook
participant Sidebar as Sidebar (Badge)
User->>MessageBox: Type draft message
MessageBox->>MessageBox: Debounced persist to storage
MessageBox->>Window: Dispatch CustomEvent localStorageChange { key }
Window->>Hook: localStorageChange / storage event received
Hook->>Hook: Read storage via getMessageBoxStorageKey
Hook->>Sidebar: Emit update (showDraft=true)
Sidebar->>Sidebar: Render DraftBadge
Sidebar->>User: Display draft indicator
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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/meteor/app/ui-message/client/messageBox/createComposerAPI.ts`:
- Around line 42-50: The persist function currently dispatches a window
CustomEvent 'localStorageChange' with the full draft text (input.value); change
it to only include the storage key to avoid leaking drafts: keep saving/removing
via Accounts.storageLocation.setItem/removeItem (refer to persist, storageID,
Accounts.storageLocation), but when calling window.dispatchEvent(new
CustomEvent('localStorageChange', ...)) pass only { key: storageID } in detail
(omit input.value or set no value field) for both the set and remove branches so
listeners like useRoomDraft get the key but never the draft content.
In `@apps/meteor/client/sidebar/badges/DraftBadge.tsx`:
- Around line 14-16: DraftBadge's aria-label currently always interpolates
roomTitle via t('__draftMessage__from__roomTitle__', { roomTitle }) which
produces an incomplete accessible name when roomTitle is undefined; change the
logic in DraftBadge to fallback to an alternative i18n key or string when
roomTitle is missing (for example use t('__draftMessage__') or
t('__draftMessage__from__roomTitle__', { roomTitle: fallback }) ), i.e.,
conditionally compute the aria-label before rendering (referencing the
aria-label prop, roomTitle variable, DraftBadge component and t(...) call) so
the label is always a complete, meaningful string.
In `@apps/meteor/client/sidebar/hooks/useRoomDraft.ts`:
- Around line 9-29: The hook useRoomDraft only checks the base messagebox key
for room drafts; update handleStorageChange and the draft-read function to
include thread keys generated by getMessageBoxStorageKey(roomId, tmid). Compute
the baseKey = getMessageBoxStorageKey(roomId) and treat any storage events where
e.key === baseKey or e.key?.startsWith(`${baseKey}-`) (and same for
e.detail?.key) as relevant in handleStorageChange, and change the draft getter
to scan Accounts.storageLocation keys: check the baseKey item and any keys that
start with `${baseKey}-`, calling getItem for each and returning true if any
value is non-empty after trim. Use the existing symbols handleStorageChange,
getMessageBoxStorageKey, and Accounts.storageLocation.getItem to locate and
modify the logic.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c812ab48-97ca-44d9-87e9-0a20a162797a
📒 Files selected for processing (9)
.changeset/soft-berries-deliver.mdapps/meteor/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/lib/utils/getMessageBoxStorageKey.tsapps/meteor/client/sidebar/badges/DraftBadge.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/hooks/useRoomDraft.tsapps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/views/room/composer/messageBox/MessageBox.tsxpackages/i18n/src/locales/en.i18n.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{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/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/lib/utils/getMessageBoxStorageKey.tsapps/meteor/client/sidebar/hooks/useRoomDraft.tsapps/meteor/client/sidebar/badges/DraftBadge.tsxapps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
🧠 Learnings (22)
📓 Common learnings
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 39545
File: apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts:59-61
Timestamp: 2026-03-11T22:04:20.529Z
Learning: In `apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts`, the `msg.u._id === uid` early-return in the `streamNewMessage` handler is intentional: the "New messages" indicator is designed to notify about messages from other users only. Self-sent messages — including those sent from a different session/device — are always skipped, by design. Do not flag this as a multi-session regression.
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.
Applied to files:
apps/meteor/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/DraftBadge.tsxapps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
📚 Learning: 2026-03-11T22:04:20.529Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 39545
File: apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts:59-61
Timestamp: 2026-03-11T22:04:20.529Z
Learning: In `apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts`, the `msg.u._id === uid` early-return in the `streamNewMessage` handler is intentional: the "New messages" indicator is designed to notify about messages from other users only. Self-sent messages — including those sent from a different session/device — are always skipped, by design. Do not flag this as a multi-session regression.
Applied to files:
apps/meteor/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsx.changeset/soft-berries-deliver.mdapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/hooks/useRoomDraft.tsapps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
apps/meteor/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/lib/utils/getMessageBoxStorageKey.tsapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
apps/meteor/app/ui-message/client/messageBox/createComposerAPI.tsapps/meteor/client/lib/utils/getMessageBoxStorageKey.tsapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-02-24T19:36:55.089Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').
Applied to files:
apps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsx
📚 Learning: 2026-04-17T17:38:12.974Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39858
File: packages/ui-kit/src/interactions/UserInteraction.ts:33-33
Timestamp: 2026-04-17T17:38:12.974Z
Learning: In RocketChat/Rocket.Chat (`packages/ui-kit/src/interactions/UserInteraction.ts`), `ViewSubmitUserInteraction` and `ViewClosedUserInteraction` intentionally do NOT include `rid` when the interaction originates from a **modal** surface. Modals are not scoped to a room, so no room id is available in that context. The `rid?: string` field is optional to support the contextual bar surface (where room context exists) while remaining absent for modals. Do not flag the absence of `rid` in modal viewSubmit/viewClosed interactions as a missing-context bug.
Applied to files:
apps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 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/navigation/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/DraftBadge.tsxapps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
.changeset/soft-berries-deliver.mdpackages/i18n/src/locales/en.i18n.json
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.
Applied to files:
.changeset/soft-berries-deliver.md
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
.changeset/soft-berries-deliver.mdpackages/i18n/src/locales/en.i18n.json
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
Applied to files:
.changeset/soft-berries-deliver.md
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
Applied to files:
.changeset/soft-berries-deliver.md
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
.changeset/soft-berries-deliver.mdapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.
Applied to files:
.changeset/soft-berries-deliver.md
📚 Learning: 2026-04-10T22:42:05.539Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 40075
File: apps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx:69-71
Timestamp: 2026-04-10T22:42:05.539Z
Learning: In `apps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx`, the submit handler converts an empty/whitespace-only description to `undefined` (`description?.trim() || undefined`) intentionally. All downstream image-rendering components (`AttachmentImage`, `ImagePreview`, `ImageItem`, `ImageGallery`) default `undefined` alt to `''`, so the `<img alt="">` attribute is always present. Do not flag this `undefined` conversion as a bug preventing alt text from being cleared.
Applied to files:
apps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/badges/DraftBadge.tsx
📚 Learning: 2026-04-18T12:32:50.305Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 38623
File: apps/meteor/app/lib/server/functions/cleanRoomHistory.ts:146-149
Timestamp: 2026-04-18T12:32:50.305Z
Learning: In `apps/meteor/app/lib/server/functions/cleanRoomHistory.ts` (PR `#38623`), the read-receipt cleanup (both `ReadReceipts.removeByMessageIds` and `ReadReceiptsArchive.removeByMessageIds`) is intentionally only performed in the limited prune path (`limit && selectedMessageIds`). The unlimited/delete-all path (`limit === 0`) deliberately skips cleaning up orphaned read receipts in both hot and cold storage — this is by design. Do not flag this as a bug or missing cleanup in future reviews.
Applied to files:
apps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-04-17T18:33:24.670Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39858
File: apps/meteor/tests/e2e/apps/uikit-interactions.spec.ts:123-151
Timestamp: 2026-04-17T18:33:24.670Z
Learning: In RocketChat/Rocket.Chat (`apps/meteor/tests/e2e/apps/uikit-interactions.spec.ts`), `executeBlockActionHandler` invocations originating from a **modal** surface intentionally do NOT include a `block_action_room` (room property) in the interaction payload. Modals are not scoped to a room, so no room id is available in that context. Do not flag the absence of a room assertion in the modal block-action test as a missing coverage bug; instead, document it explicitly with a `test.step` asserting the room entry is `undefined`.
Applied to files:
apps/meteor/client/sidebar/badges/SidebarItemBadges.tsxapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.
Applied to files:
apps/meteor/client/lib/utils/getMessageBoxStorageKey.tsapps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2026-04-13T16:40:55.864Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40100
File: apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx:18-35
Timestamp: 2026-04-13T16:40:55.864Z
Learning: In Rocket.Chat's embedded mode (`?layout=embedded`), route changes are driven by the parent frame reloading the iframe URL, which causes a full remount of the React tree (including `EmbeddedPreload` at `apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx`). The component never survives a navigation, so `roomParams` (computed via `useMemo`) is always fresh on mount. A `[router]` singleton as the sole `useMemo` dependency is therefore correct and intentional — do not flag it as a stale-dependency bug in this component.
Applied to files:
apps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/client/sidebar/hooks/useRoomDraft.ts
📚 Learning: 2025-11-17T22:38:48.631Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37505
File: packages/i18n/src/locales/en.i18n.json:3765-3765
Timestamp: 2025-11-17T22:38:48.631Z
Learning: Rocket.Chat i18n copy: Keep sentence case for the value of "Notification_Desktop_show_voice_calls" in packages/i18n/src/locales/en.i18n.json (“Show desktop notifications for voice calls”) per design directive; do not change to Title Case even if nearby labels differ.
Applied to files:
packages/i18n/src/locales/en.i18n.json
🔇 Additional comments (6)
.changeset/soft-berries-deliver.md (1)
1-6: Changeset scope and versioning look correct.Minor bumps and the description match the feature-level addition without indicating breaking behavior.
apps/meteor/client/lib/utils/getMessageBoxStorageKey.ts (1)
1-3: Utility implementation is clean and correctly typed.The key format is consistent and the optional thread suffix handling is straightforward.
packages/i18n/src/locales/en.i18n.json (1)
1871-1872: Looks good — draft translation keys are consistent and correctly structured.These entries cover badge text and room-context phrasing, and the interpolation key format matches existing patterns.
Based on learnings: In this repository, new translation keys should be added to
packages/i18n/src/locales/en.i18n.jsononly; other locale files are populated via the external translation pipeline and/or fall back to English.Also applies to: 7167-7167
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx (1)
34-34: LGTM — storage key generation is now centralized.This keeps the composer persistence key aligned with the sidebar draft detection utility.
Also applies to: 131-131
apps/meteor/client/views/navigation/sidebar/badges/SidebarItemBadges.tsx (1)
5-8: LGTM — draft badge integration is clean.The new hook and badge are wired without changing the existing unread or invitation badge behavior.
Also applies to: 17-23
apps/meteor/client/sidebar/badges/SidebarItemBadges.tsx (1)
5-9: LGTM — old sidebar path is covered too.This keeps draft badge behavior consistent between the old and new sidebar badge renderers.
Also applies to: 18-25
Proposed changes (including videos or screenshots)
Added draft message badge in sidebar. Users can now see which rooms have unsaved messages with a visual "Draft" badge.
Issue(s)
Closes #40215
Steps to test or reproduce
Further comments
Summary by CodeRabbit
New Features
Improvements
Localization