feat: Add alt description support for image uploads#40075
feat: Add alt description support for image uploads#40075dougfabris wants to merge 6 commits intodevelopfrom
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: 53775f4 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 (1)
✅ Files skipped from review due to trivial changes (1)
📜 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). (2)
WalkthroughAdds optional alternative text (description) to image uploads: UI field in the upload modal, persistence on Upload objects, an edit API, propagation through upload processing and message composition, and rendering as image alt text across previews, galleries, and file lists. Server-side outgoing attachments no longer include Changes
Sequence DiagramsequenceDiagram
participant User as User
participant Modal as FileUploadModal
participant Store as UploadsStore
participant Composer as MessageComposer
participant Attachment as MessageAttachment
participant Img as ImgComponent
User->>Modal: open + select image + enter alt text
Modal->>Modal: capture name + description
Modal->>Store: submit upload (name, description)
Store->>Store: persist upload.description (and metadataForEncryption.description)
Composer->>Store: retrieve uploads for message
Composer->>Attachment: include description in composed message payload
Attachment->>Img: forward description as alt prop
Img->>Img: render <img alt="description">
Img-->>User: image displayed with alt text
Note over User,Store: Edit flow
User->>Composer: open edit modal for upload
Composer->>Store: editUploadDescription(id, newDescription)
Store->>Store: update upload.description
Store-->>Img: UI reflects updated alt text
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches⚔️ Resolve merge conflicts
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #40075 +/- ##
===========================================
- Coverage 70.20% 70.18% -0.02%
===========================================
Files 3278 3278
Lines 116605 116643 +38
Branches 20723 20707 -16
===========================================
+ Hits 81859 81866 +7
- Misses 31444 31483 +39
+ Partials 3302 3294 -8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
f6144b7 to
301d855
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/client/views/room/modals/FileUploadModal/FileUploadModal.tsx`:
- Around line 69-71: The current submit handler in FileUploadModal (handleSubmit
-> onSubmit) converts an empty description to undefined which conflates "no
change" and "clear description"; change the logic so an explicitly cleared alt
text is sent as an empty string instead of undefined. Locate the onSubmit call
inside handleSubmit and replace the description argument transformation
(currently description?.trim() || undefined) with code that trims once and
passes '' when trimmed === '' (e.g., const desc = description?.trim();
onSubmit(name.trim(), desc === '' ? '' : desc)), so clearing the alt text is
persisted.
🪄 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: 87441941-7b61-4f93-bf95-014709caca0e
⛔ Files ignored due to path filters (1)
apps/meteor/client/views/room/modals/FileUploadModal/__snapshots__/FileUploadModal.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (18)
apps/meteor/app/file-upload/server/methods/sendFileMessage.tsapps/meteor/client/components/ImageGallery/ImageGallery.tsxapps/meteor/client/components/message/content/attachments/DefaultAttachment.tsxapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/views/room/contextualBar/RoomFiles/components/ImageItem.tsxapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsxapps/meteor/client/views/room/modals/FileUploadModal/ImagePreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsxpackages/i18n/src/locales/en.i18n.json
💤 Files with no reviewable changes (1)
- apps/meteor/app/file-upload/server/methods/sendFileMessage.ts
📜 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). (4)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: cubic · AI code reviewer
- GitHub Check: CodeQL-Build
🧰 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/client/components/message/content/attachments/DefaultAttachment.tsxapps/meteor/client/components/ImageGallery/ImageGallery.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/views/room/contextualBar/RoomFiles/components/ImageItem.tsxapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/ImagePreview.tsxapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsx
🧠 Learnings (15)
📚 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/components/message/content/attachments/DefaultAttachment.tsxapps/meteor/client/components/ImageGallery/ImageGallery.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/views/room/contextualBar/RoomFiles/components/ImageItem.tsxapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/ImagePreview.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsx
📚 Learning: 2026-03-11T18:15:53.272Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/app/api/server/v1/rooms.ts:294-296
Timestamp: 2026-03-11T18:15:53.272Z
Learning: In Rocket.Chat's `rooms.mediaConfirm/:rid/:fileId` endpoint (apps/meteor/app/api/server/v1/rooms.ts), updating `file.name` from `bodyParams.fileName` without updating `file.path` is intentionally safe. The file path is keyed by `_id` (not by filename), so the stored path remains valid regardless of a rename. `file.name` only affects the display name in the message attachment; do not flag this as a path-divergence issue.
Applied to files:
apps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx
📚 Learning: 2026-03-12T17:12:49.121Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:28-33
Timestamp: 2026-03-12T17:12:49.121Z
Learning: Rocket.Chat — apps/meteor/client/lib/chats/flows/uploadFiles.ts: When E2E_Enable_Encrypt_Files is disabled, plaintext file uploads are allowed in E2E rooms; this fallback is expected and should not be flagged as a security regression.
Applied to files:
apps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx
📚 Learning: 2026-03-11T18:17:53.972Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/processMessageUploads.ts:112-119
Timestamp: 2026-03-11T18:17:53.972Z
Learning: In `apps/meteor/client/lib/chats/flows/processMessageUploads.ts`, when sending multiple file uploads, each file is confirmed via its own `/rooms.mediaConfirm/${rid}/${fileId}` call and produces a separate message. Only the first file's confirm payload carries the composed message text (`msg`); all subsequent files receive `msg: ''`. This one-message-per-file behavior is intentional by design — do not flag it as a bug or suggest batching into a single message.
Applied to files:
apps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsxapps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsx
📚 Learning: 2026-02-12T15:39:28.416Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 32703
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:52-58
Timestamp: 2026-02-12T15:39:28.416Z
Learning: In `apps/meteor/client/lib/chats/flows/uploadFiles.ts`, when E2E encryption is required but not allowed (e.g., `E2E_Enable_Encrypt_Files` setting is disabled), the function intentionally abandons the entire upload queue and displays a toast error. This fail-fast behavior prevents partial uploads when encryption requirements cannot be met and is the expected behavior, not a bug.
Applied to files:
apps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsx
📚 Learning: 2026-03-03T11:11:48.541Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39230
File: apps/meteor/app/api/server/v1/chat.ts:214-222
Timestamp: 2026-03-03T11:11:48.541Z
Learning: In apps/meteor/server/lib/moderation/reportMessage.ts, the reportMessage function validates that description is not empty or whitespace-only with `if (!description.trim())`. When migrating the chat.reportMessage endpoint to OpenAPI, adding minLength validation to the schema preserves this existing behavior.
Applied to files:
apps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsxapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsxapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsxapps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsx
📚 Learning: 2026-02-24T19:16:35.307Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 39003
File: apps/meteor/client/lib/chats/flows/sendMessage.ts:39-45
Timestamp: 2026-02-24T19:16:35.307Z
Learning: In apps/meteor/client/lib/chats/flows/sendMessage.ts, when sdk.call('sendMessage', ...) throws an error, the message is intentionally left with temp: true (not deleted or cleaned up) to support a future retry UI feature. This allows users to retry sending failed messages rather than losing them.
Applied to files:
apps/meteor/client/lib/chats/flows/processMessageUploads.ts
📚 Learning: 2026-03-20T13:51:23.302Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 39553
File: apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts:179-181
Timestamp: 2026-03-20T13:51:23.302Z
Learning: In `apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts`, the truthiness guards `...(integration.avatar && { avatar })`, `...(integration.emoji && { emoji })`, `...(integration.alias && { alias })`, and `...(integration.script && { script })` in the `$set` payload of `updateIncomingIntegration` are intentional. Empty-string values for these fields should NOT overwrite the stored value — only truthy values are persisted. Do not flag these as bugs preventing explicit clears.
Applied to files:
apps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/Upload.ts
📚 Learning: 2026-03-19T13:59:40.678Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38357
File: apps/meteor/app/apps/server/converters/uploads.ts:45-49
Timestamp: 2026-03-19T13:59:40.678Z
Learning: In `apps/meteor/app/apps/server/converters/uploads.ts`, the `room` async handler in `convertToApp` uses non-null assertions (`upload.rid!` and `result!`) intentionally. The data flow guarantees that any upload reaching this point must have a `rid`; if it does not, throwing an error is the desired behavior (fail-fast / data integrity guard). Do not flag these non-null assertions as unsafe during code review.
Applied to files:
apps/meteor/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/Upload.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/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.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 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/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.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/client/lib/chats/flows/processMessageUploads.tsapps/meteor/client/lib/chats/uploads.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.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/components/message/content/attachments/file/ImageAttachment.tsx
📚 Learning: 2026-03-15T14:31:28.969Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39647
File: apps/meteor/app/api/server/v1/users.ts:710-757
Timestamp: 2026-03-15T14:31:28.969Z
Learning: In RocketChat/Rocket.Chat, the `UserCreateParamsPOST` type in `apps/meteor/app/api/server/v1/users.ts` (migrated from `packages/rest-typings/src/v1/users/UserCreateParamsPOST.ts`) intentionally has `fields: string` (non-optional) and `settings?: IUserSettings` without a corresponding AJV schema entry. This is a pre-existing divergence carried over verbatim from the original rest-typings source (PR `#39647`). Do not flag this type/schema misalignment during the OpenAPI migration review — it is tracked as a separate follow-up fix.
Applied to files:
apps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/chats/Upload.tsapps/meteor/client/views/room/modals/FileUploadModal/FileUploadModal.tsx
📚 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/client/lib/chats/Upload.ts
🔇 Additional comments (16)
apps/meteor/client/lib/chats/Upload.ts (1)
9-9: Good type extension for upload metadata.Adding
description?: stringhere is a clean, backward-compatible way to carry alt text through both non-encrypted and encrypted upload flows.apps/meteor/client/views/room/contextualBar/RoomFiles/components/FileItem.tsx (1)
19-19: Description-to-alt wiring looks correct in this component.This correctly propagates file
descriptioninto the image rendering path for contextual bar items.Also applies to: 27-27
apps/meteor/client/components/ImageGallery/ImageGallery.tsx (1)
195-195: Nice accessibility improvement in gallery images.Using
descriptionasaltwith an empty-string fallback is correct and preserves non-decorative vs decorative semantics.Also applies to: 202-208
apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx (1)
18-18: Attachment image alt-text support is wired correctly.The new optional prop plus
altpassthrough keeps existing defaults and enables upstream accessibility text.Also applies to: 40-40, 86-86
apps/meteor/client/components/message/content/attachments/DefaultAttachment.tsx (1)
99-101: Good propagation of attachment description into image alt text.This keeps the attachment path aligned with the new accessibility behavior.
apps/meteor/client/lib/chats/flows/processMessageUploads.ts (1)
62-62: Upload confirmation payload updates look consistent.
descriptionis now carried in both attachment construction and media-confirm message payload typing, matching the intended alt-text persistence flow.Also applies to: 101-105, 126-126
apps/meteor/client/lib/chats/ChatAPI.ts (1)
125-125: Uploads API contract update is correct.Adding
editUploadDescriptionhere cleanly exposes the new store capability through the chat API surface.apps/meteor/client/views/room/contextualBar/RoomFiles/components/ImageItem.tsx (1)
17-17:⚠️ Potential issue | 🟠 MajorAvatar from
@rocket.chat/fuselagedoes not support thealtprop—remove it or use an alternative approach.The
@rocket.chat/fuselageAvatar component (version ^0.75.0) does not accept analtprop. Passingalt={alt}to<Avatar>will be silently ignored and will not expose alt text to screen readers. This defeats the accessibility intent of the change. Either remove thealtprop or wrap the Avatar in a semantically appropriate container with proper ARIA labels.⛔ Skipped due to learnings
Learnt from: tassoevan Repo: RocketChat/Rocket.Chat PR: 39397 File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68 Timestamp: 2026-03-06T18:10:23.330Z Learning: In the RocketChat/Rocket.Chat `packages/gazzodown` package and more broadly, the HTML `<code>` element has an implicit ARIA role of `code` per WAI-ARIA 1.3, and `testing-library/dom` / jsdom supports it. Therefore, `screen.getByRole('code')` / `screen.findByRole('code')` correctly locates `<code>` elements without needing an explicit `role="code"` attribute. Do NOT flag `findByRole('code')` as invalid in future reviews.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:53:01.096Z Learning: In RocketChat/Rocket.Chat, there are two different `ModalBackdrop` components: 1. `rocket.chat/fuselage` `ModalBackdrop`: its `ModalBackdropProps` is `BoxProps`, so it accepts `onClick` and all other Box/DOM props. There is no `onDismiss` prop on this component. 2. `rocket.chat/ui-client` `ModalBackdrop` (packages/ui-client/src/components/Modal/ModalBackdrop.tsx): has a narrower interface `{ children?: ReactNode; onDismiss?: () => void }` and calls `onDismiss` on Escape keypress and outside mouse-up. It does NOT forward arbitrary DOM props like `onClick`. When reviewing usage of `ModalBackdrop`, always check the import source to determine which component is being used and which props are valid.packages/i18n/src/locales/en.i18n.json (1)
87-88: Looks good — accessibility copy is clear and aligned with the feature goals.Both new strings are well-phrased and map cleanly to the alt-text UX introduced in this PR.
apps/meteor/client/views/room/modals/FileUploadModal/ImagePreview.tsx (1)
11-35: Good accessibility default for image alt text.The optional
altprop with a default empty string is correctly propagated to the rendered<img>, which keeps the no-description path accessible.apps/meteor/client/lib/chats/uploads.ts (1)
66-82: Description edit flow is correctly synchronized for encrypted uploads.Updating both
descriptionandmetadataForEncryption.descriptionin the same patch keeps plaintext and encrypted metadata aligned.apps/meteor/client/views/room/modals/FileUploadModal/FilePreview.tsx (1)
43-50: Prop wiring for description through preview is solid.
descriptionis correctly added to the props contract and passed only where it is needed (MediaPreview).apps/meteor/client/views/room/composer/messageBox/MessageComposerFiles.tsx (1)
13-21: Callback integration with the updated edit signature looks correct.The memoized
handleEditpath cleanly bridges the updated modal payload to store operations.Also applies to: 34-34
apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx (1)
18-38: Accessibility mapping is correctly applied in attachment rendering.Passing
descriptionintoAttachmentImageasaltis the right behavior for assistive technologies.apps/meteor/client/views/room/composer/messageBox/MessageComposerFileItem.tsx (1)
18-18: Edit modal wiring is consistent end-to-end.The updated callback signature and
fileDescriptionhydration correctly preserve and forward description state.Also applies to: 40-47
apps/meteor/client/views/room/modals/FileUploadModal/MediaPreview.tsx (1)
37-40: Image-only alt propagation in media preview is correctly implemented.The new
descriptionprop is cleanly routed toImagePreviewwithout affecting audio/video branches.Also applies to: 57-59
Proposed changes (including videos or screenshots)
Depends on #40067
descriptionfield to thealtattribute on rendered<img>tags for accessibilitydescriptionfrom non-image attachment creation on the server (audio, video, generic) since it's no longer renderedTest plan
<img>tag has the correctaltattributealtdefaults to empty stringIssue(s)
Steps to test or reproduce
Further comments
WA-17
Summary by CodeRabbit