refactor(ui-kit): Remove UiKit deprecations#39268
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 44ca5fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 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 |
WalkthroughRemoves UiKit deprecations: converts several enums to const objects, deletes deprecated types/exports, replaces legacy text/render wrappers with unified renderTextObject/plain_text and block-element renderers, updates consuming code and tests, and bumps package versions in a changeset. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #39268 +/- ##
===========================================
+ Coverage 70.83% 70.86% +0.02%
===========================================
Files 3208 3207 -1
Lines 113432 113331 -101
Branches 20546 20532 -14
===========================================
- Hits 80350 80312 -38
+ Misses 31031 30966 -65
- Partials 2051 2053 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
2b0dd4a to
c4a3850
Compare
0134b04 to
9851a5d
Compare
|
/jira ARCH-2021 |
There was a problem hiding this comment.
1 issue found across 48 files
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="packages/ui-kit/src/rendering/BlockContext.ts">
<violation number="1" location="packages/ui-kit/src/rendering/BlockContext.ts:11">
P2: `BlockContext` type is widened to `symbol`, so APIs no longer enforce the finite set of valid context values.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/ui-kit/src/interactions/ServerInteraction.ts (1)
100-110: Consider usingtypia.createIs<ServerInteraction>()instead of manual OR chain.The composite
isServerInteractionfunction manually ORs all individual type guards. Usingtypia.createIs<ServerInteraction>()directly would be more maintainable and would automatically stay in sync if the union changes.♻️ Suggested refactor
-export const isServerInteraction = (input: unknown): input is ServerInteraction => - isOpenModalServerInteraction(input) || - isUpdateModalServerInteraction(input) || - isCloseModalServerInteraction(input) || - isOpenBannerServerInteraction(input) || - isUpdateBannerServerInteraction(input) || - isCloseBannerServerInteraction(input) || - isOpenContextualBarServerInteraction(input) || - isUpdateContextualBarServerInteraction(input) || - isCloseContextualBarServerInteraction(input) || - isReportErrorsServerInteraction(input); +export const isServerInteraction = typia.createIs<ServerInteraction>();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ui-kit/src/interactions/ServerInteraction.ts` around lines 100 - 110, Replace the manual OR-chain in isServerInteraction with typia's generated type guard so the check stays in sync with the ServerInteraction union; import typia and assign isServerInteraction using typia.createIs<ServerInteraction>() instead of combining isOpenModalServerInteraction, isUpdateModalServerInteraction, isCloseModalServerInteraction, isOpenBannerServerInteraction, isUpdateBannerServerInteraction, isCloseBannerServerInteraction, isOpenContextualBarServerInteraction, isUpdateContextualBarServerInteraction, isCloseContextualBarServerInteraction, and isReportErrorsServerInteraction.packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx (1)
24-27: Use the mapped field index when rendering field text.Passing
0for every field loses per-field positional identity in renderer output. Usingikeeps index semantics stable and future-proofs keyed/nested rendering behavior.Proposed change
{fields.map((field, i) => ( <div key={i} className={createClassName(styles, 'uikit-section-block__field')}> - {parser.renderTextObject(field, 0, uikit.BlockContext.SECTION)} + {parser.renderTextObject(field, i, uikit.BlockContext.SECTION)} </div> ))}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx` around lines 24 - 27, The render call inside the fields.map is passing a constant 0 as the field index which loses per-field position; change the second argument in parser.renderTextObject(field, 0, uikit.BlockContext.SECTION) to use the mapped index i so each field is rendered with its proper positional identity (update the call in the fields.map callback where parser.renderTextObject is invoked).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx`:
- Around line 24-27: The render call inside the fields.map is passing a constant
0 as the field index which loses per-field position; change the second argument
in parser.renderTextObject(field, 0, uikit.BlockContext.SECTION) to use the
mapped index i so each field is rendered with its proper positional identity
(update the call in the fields.map callback where parser.renderTextObject is
invoked).
In `@packages/ui-kit/src/interactions/ServerInteraction.ts`:
- Around line 100-110: Replace the manual OR-chain in isServerInteraction with
typia's generated type guard so the check stays in sync with the
ServerInteraction union; import typia and assign isServerInteraction using
typia.createIs<ServerInteraction>() instead of combining
isOpenModalServerInteraction, isUpdateModalServerInteraction,
isCloseModalServerInteraction, isOpenBannerServerInteraction,
isUpdateBannerServerInteraction, isCloseBannerServerInteraction,
isOpenContextualBarServerInteraction, isUpdateContextualBarServerInteraction,
isCloseContextualBarServerInteraction, and isReportErrorsServerInteraction.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (48)
.changeset/healthy-dragons-crash.mdapps/meteor/client/views/modal/uikit/ModalBlock.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/apps-engine/src/definition/messages/IMessageRaw.tspackages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsxpackages/fuselage-ui-kit/src/blocks/SectionBlock.tsxpackages/fuselage-ui-kit/src/hooks/useUiKitState.tspackages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsxpackages/fuselage-ui-kit/tsconfig.jsonpackages/livechat/src/components/uiKit/message/ButtonElement/index.tsxpackages/livechat/src/components/uiKit/message/ContextBlock/index.tsxpackages/livechat/src/components/uiKit/message/ImageBlock/index.tsxpackages/livechat/src/components/uiKit/message/OverflowElement/index.tsxpackages/livechat/src/components/uiKit/message/SectionBlock/index.tsxpackages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsxpackages/livechat/src/components/uiKit/message/index.tsxpackages/ui-kit/src/blocks/BlockElementType.spec.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/blocks/ButtonStyle.tspackages/ui-kit/src/blocks/ElementType.tspackages/ui-kit/src/blocks/LayoutBlockType.spec.tspackages/ui-kit/src/blocks/LayoutBlockType.tspackages/ui-kit/src/blocks/TextObjectType.spec.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/deprecations.tspackages/ui-kit/src/blocks/isActionsBlockElement.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/blocks/isSectionBlockAccessoryElement.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/index.tspackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/isNotNull.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/rendering/BlockRenderers.tspackages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.tspackages/ui-kit/src/rendering/LayoutBlockRenderer.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/ui-kit/src/rendering/renderBlockElement.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/tsconfig.build.json
💤 Files with no reviewable changes (11)
- packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx
- packages/ui-kit/src/index.ts
- packages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.ts
- packages/ui-kit/src/blocks/ElementType.ts
- packages/ui-kit/src/blocks/BlockElementType.spec.ts
- packages/ui-kit/src/blocks/ButtonStyle.ts
- packages/ui-kit/src/rendering/BlockRenderers.ts
- packages/ui-kit/src/isNotNull.ts
- packages/ui-kit/src/blocks/LayoutBlockType.spec.ts
- packages/ui-kit/src/blocks/TextObjectType.spec.ts
- packages/ui-kit/src/blocks/deprecations.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). (1)
- GitHub Check: cubic · AI code reviewer
🧰 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:
packages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/blocks/isActionsBlockElement.tspackages/livechat/src/components/uiKit/message/ImageBlock/index.tsxpackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/livechat/src/components/uiKit/message/index.tsxpackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/livechat/src/components/uiKit/message/ButtonElement/index.tsxpackages/fuselage-ui-kit/src/blocks/SectionBlock.tsxpackages/ui-kit/src/blocks/isSectionBlockAccessoryElement.tspackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/blocks/LayoutBlockType.tspackages/livechat/src/components/uiKit/message/OverflowElement/index.tsxpackages/livechat/src/components/uiKit/message/SectionBlock/index.tsxpackages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsxpackages/ui-kit/src/blocks/TextObjectType.tspackages/livechat/src/components/uiKit/message/ContextBlock/index.tsxpackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/rendering/renderTextObject.tsapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsxpackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/rendering/renderBlockElement.tspackages/ui-kit/src/rendering/LayoutBlockRenderer.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/apps-engine/src/definition/messages/IMessageRaw.tspackages/fuselage-ui-kit/src/hooks/useUiKitState.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tsapps/meteor/client/views/modal/uikit/ModalBlock.tsxpackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
**/*.spec.ts
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use.spec.tsextension for test files (e.g.,login.spec.ts)
Files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
🧠 Learnings (17)
📓 Common learnings
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.
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.
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Avoid code comments in the implementation
Applied to files:
packages/fuselage-ui-kit/tsconfig.jsonpackages/ui-kit/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.
Applied to files:
packages/fuselage-ui-kit/tsconfig.json.changeset/healthy-dragons-crash.md
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 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:
packages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/blocks/isActionsBlockElement.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/blocks/isSectionBlockAccessoryElement.tspackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/blocks/LayoutBlockType.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/rendering/renderBlockElement.tspackages/ui-kit/src/rendering/LayoutBlockRenderer.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/apps-engine/src/definition/messages/IMessageRaw.tspackages/fuselage-ui-kit/src/hooks/useUiKitState.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.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:
packages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/blocks/isActionsBlockElement.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/blocks/isSectionBlockAccessoryElement.tspackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/blocks/LayoutBlockType.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/rendering/renderBlockElement.tspackages/ui-kit/src/rendering/LayoutBlockRenderer.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/apps-engine/src/definition/messages/IMessageRaw.tspackages/fuselage-ui-kit/src/hooks/useUiKitState.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
📚 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:
packages/livechat/src/components/uiKit/message/index.tsx.changeset/healthy-dragons-crash.mdpackages/livechat/src/components/uiKit/message/SectionBlock/index.tsxpackages/livechat/src/components/uiKit/message/ContextBlock/index.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/apps-engine/src/definition/messages/IMessageRaw.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:
packages/livechat/src/components/uiKit/message/index.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
📚 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/healthy-dragons-crash.mdapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
📚 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/healthy-dragons-crash.mdpackages/livechat/src/components/uiKit/message/ContextBlock/index.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
📚 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/healthy-dragons-crash.md
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
packages/livechat/src/components/uiKit/message/ButtonElement/index.tsxpackages/fuselage-ui-kit/src/blocks/SectionBlock.tsxpackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsxapps/meteor/client/views/modal/uikit/ModalBlock.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests
Applied to files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
📚 Learning: 2025-12-10T21:00:43.645Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:43.645Z
Learning: Adopt the monorepo-wide Jest testMatch pattern: <rootDir>/src/**/*.spec.{ts,js,mjs} (represented here as '**/src/**/*.spec.{ts,js,mjs}') to ensure spec files under any package's src directory are picked up consistently across all packages in the Rocket.Chat monorepo. Apply this pattern in jest.config.ts for all relevant packages to maintain uniform test discovery.
Applied to files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.
Applied to files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
📚 Learning: 2026-02-26T19:22:36.646Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx:40-40
Timestamp: 2026-02-26T19:22:36.646Z
Learning: In packages/ui-voip/src/views/CallHistoryContextualbar/CallHistoryActions.tsx, when the media session state is 'unavailable', the voiceCall action is not included in the actions object passed to CallHistoryActions, so it won't appear in the menu at all. The action filtering happens upstream before getItems is called, preventing any tooltip confusion for the unavailable state.
Applied to files:
packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
🧬 Code graph analysis (19)
packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx (1)
packages/livechat/src/components/uiKit/message/index.tsx (1)
parser(118-118)
packages/livechat/src/components/uiKit/message/index.tsx (2)
packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx (1)
context(105-115)packages/ui-kit/src/index.ts (3)
BlockContext(56-56)DatePickerElement(14-14)StaticSelectElement(23-23)
packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx (1)
packages/livechat/src/components/uiKit/message/index.tsx (1)
parser(118-118)
packages/ui-kit/src/blocks/isContextBlockElement.ts (3)
packages/ui-kit/src/blocks/BlockElementType.ts (1)
BlockElementType(3-25)packages/ui-kit/src/index.ts (2)
BlockElementType(54-54)TextObjectType(55-55)packages/ui-kit/src/blocks/TextObjectType.ts (1)
TextObjectType(3-6)
packages/ui-kit/src/blocks/LayoutBlockType.ts (1)
packages/ui-kit/src/index.ts (1)
LayoutBlock(43-43)
packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx (1)
packages/livechat/src/components/uiKit/message/index.tsx (1)
parser(118-118)
packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx (2)
packages/livechat/src/components/uiKit/message/index.tsx (1)
parser(118-118)apps/meteor/app/ui-message/client/messageBox/createComposerAPI.ts (1)
text(325-327)
packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx (1)
packages/livechat/src/components/uiKit/message/index.tsx (1)
parser(118-118)
packages/ui-kit/src/blocks/TextObjectType.ts (1)
packages/ui-kit/src/index.ts (2)
TextObjectType(55-55)TextObject(7-7)
packages/ui-kit/src/rendering/renderTextObject.ts (3)
packages/ui-kit/src/rendering/BlockRenderers.ts (1)
BlockRenderers(8-14)packages/ui-kit/src/index.ts (3)
BlockRenderers(58-58)TextObject(7-7)BlockContext(56-56)packages/ui-kit/src/rendering/SurfaceRenderer.ts (1)
renderTextObject(45-47)
apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx (1)
packages/ui-client/src/components/Contextualbar/index.ts (1)
ContextualbarTitle(33-33)
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts (1)
packages/ui-kit/src/index.ts (1)
BlockContext(56-56)
packages/ui-kit/src/rendering/SurfaceRenderer.ts (2)
packages/ui-kit/src/index.ts (2)
TextObject(7-7)BlockContext(56-56)packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx (1)
context(105-115)
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts (1)
packages/ui-kit/src/index.ts (1)
BlockContext(56-56)
packages/ui-kit/src/rendering/renderBlockElement.ts (2)
packages/ui-kit/src/rendering/BlockRenderers.ts (1)
BlockRenderers(8-14)packages/ui-kit/src/index.ts (3)
BlockRenderers(58-58)BlockElement(29-29)BlockContext(56-56)
packages/ui-kit/src/blocks/BlockElementType.ts (1)
packages/ui-kit/src/index.ts (2)
BlockElementType(54-54)BlockElement(29-29)
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts (1)
packages/ui-kit/src/index.ts (2)
BlockContext(56-56)PlainText(5-5)
packages/apps-engine/src/definition/messages/IMessageRaw.ts (1)
packages/ui-kit/src/index.ts (1)
LayoutBlock(43-43)
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts (1)
packages/ui-kit/src/index.ts (1)
BlockContext(56-56)
🔇 Additional comments (45)
.changeset/healthy-dragons-crash.md (2)
2-6: Version bump mapping looks appropriate for the stated refactor.
@rocket.chat/ui-kitis marked asmajor(breaking surface cleanup), while related consumers areminor, which is consistent with the PR scope.
9-9: Changeset summary line is clear and release-note ready.The note is concise and aligned with the migration intent.
packages/fuselage-ui-kit/src/hooks/useUiKitState.ts (1)
141-146: Conditional split is clear and behavior-preserving.Good refactor: separating context-based and
dispatchActionConfigchecks keeps the action routing easier to read without changing flow.packages/ui-kit/tsconfig.build.json (1)
5-6: Looks good — config change is safe and scoped.This is a build-config-only update, and I don’t see functional or release-blocking risk in this segment.
packages/ui-kit/src/blocks/LayoutBlockType.ts (1)
1-16: LGTM! Well-structured enum-to-const conversion.The
as const satisfies Record<...>pattern correctly enforces that all keys match the uppercase form ofLayoutBlock['type']values while providing full type inference. This maintains type safety while achieving erasable syntax compliance.packages/ui-kit/src/blocks/layout/PreviewBlock.ts (1)
13-18: LGTM!The discriminant change from template literal to string literal
'preview'correctly decouples this type fromLayoutBlockTypewhile maintaining the same runtime behavior and type narrowing capabilities.packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts (1)
3-6: LGTM!Clean conversion to string literal discriminant, consistent with the broader refactoring pattern across layout blocks.
packages/ui-kit/src/blocks/layout/InfoCardBlock.ts (1)
13-16: LGTM!Discriminant updated to string literal
'info_card', consistent with the refactoring pattern applied to other layout blocks.packages/ui-kit/src/blocks/BlockElementType.ts (1)
1-25: Looks good — clean enum-to-const migration with solid type constraints.This aligns well with the erasable-syntax objective and keeps
BlockElementTypestrongly typed without reintroducing deprecated enum patterns.packages/ui-kit/src/interactions/ServerInteraction.ts (2)
72-74: Acceptable use of ESLint directive for semantic type union.The ESLint disable for
@typescript-eslint/no-duplicate-type-constituentsis appropriate here. WhileModalView['id'],BannerView['viewId'], andContextualBarView['id']likely all resolve tostring, keeping them explicit documents which view types support error reporting. This is a reasonable trade-off for clarity.
89-98: LGTM on typia type guards.The
typia.createIs<T>()calls correctly generate runtime type guards for each server interaction variant, enabling proper discrimination at runtime.packages/fuselage-ui-kit/tsconfig.json (1)
4-4: VerifyerasableSyntaxOnlycompatibility and preserved strictness diagnostics.This is likely correct for the erasable-syntax migration, but confirm the repo TypeScript version supports
erasableSyntaxOnlyand thatnoImplicitReturns/noImplicitThisare still enforced via@rocket.chat/tsconfig/client.json(or intentionally relaxed).packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx (1)
31-31: LGTM!The migration from
surfaceRenderer.text(text)tosurfaceRenderer.renderTextObject(text, 0)is consistent with the broader API refactor across the codebase.packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx (1)
67-67: LGTM!The migration to
parser.renderTextObject(text, 0)aligns with the unified text rendering approach adopted across the livechat UI kit components.packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx (1)
55-55: LGTM!The button text rendering correctly migrated to use
parser.renderTextObject(text, 0), consistent with other livechat components.packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx (2)
42-43: LGTM!Good use of the loop index
ifor each option's text rendering, providing unique identifiers for each rendered text object within the select options.
54-54: LGTM!Placeholder rendering correctly migrated to
renderTextObject.apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx (2)
93-93: LGTM!The contextual bar title correctly migrates to
renderTextObject.
105-105: LGTM!Button text rendering for close and submit actions properly migrated to
renderTextObjectwith distinct indices.Also applies to: 111-111
packages/ui-kit/src/rendering/BlockContext.ts (1)
1-11: Clean conversion from enum to const object with Symbols.The pattern of using a const object with Symbol values plus a type alias is a standard TypeScript approach for "erasable syntax" that avoids runtime enum artifacts.
One consideration: Symbols are not JSON-serializable. If
BlockContextvalues were ever persisted or transmitted, this would break. However, based on the usage patterns (rendering context passed between internal rendering functions), this appears to be purely in-memory state that isn't serialized, so the Symbol approach is appropriate here.packages/ui-kit/src/rendering/LayoutBlockRenderer.ts (1)
4-7: LGTM!The type change from
BlockContext.BLOCKtotypeof BlockContext.BLOCKis correct. With the enum-to-const-object migration,typeof BlockContext.BLOCKproperly captures the unique symbol type, whereas the old enum member syntax no longer applies.packages/ui-kit/src/rendering/renderBlockElement.ts (2)
6-7: Clean simplification of the renderer lookup.The direct property access with type assertion is appropriate here since
BlockRenderers<T>defines optional properties for each block element type. The explicit cast toBlockElementRenderer<T> | undefinedcorrectly handles the polymorphic return type.
14-14: LGTM!The optional chaining with nullish coalescing provides clean, readable null handling while maintaining the correct
thiscontext via.call(renderers, ...).packages/ui-kit/src/blocks/TextObjectType.ts (1)
1-6: Typed const-object migration looks solid.This preserves erasable syntax while keeping strict key/value consistency for text object types.
packages/ui-kit/src/blocks/isContextBlockElement.ts (1)
7-16: Context element type guard update is correct.The direct
block.typeswitch andMRKDWNcase alignment keep this guard behavior consistent.packages/ui-kit/src/blocks/isInputBlockElement.ts (1)
5-19: Input block type-guard simplification is safe.Switching directly on
block.typekeeps the same accepted element set and return behavior.packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx (1)
18-25:MRKDWNcase migration is clean.This keeps context text rendering behavior intact while aligning with the updated text type constants.
packages/ui-kit/src/blocks/isActionsBlockElement.ts (1)
5-21: Actions block guard refactor looks good.The direct discriminant check preserves the same accepted action element types.
packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts (1)
5-17: Section accessory guard simplification is correct.Using
block.typedirectly keeps the same narrowing behavior for supported accessory elements.packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx (1)
16-19: Dedicated context-element render call is a good migration.
renderContextBlockElementis correctly used in the per-item mapping path.apps/meteor/client/views/modal/uikit/ModalBlock.tsx (3)
15-15: Type-onlyUiKitimport cleanup is correct.This keeps type references without carrying an unnecessary runtime namespace import.
116-116: Keyboard-flow typing refinements look good.The generic
querySelectorAll<HTMLElement>and directhandleKeyDown(e)call improve type clarity cleanly.Also applies to: 164-164
181-181: Modal text rendering migration is consistent.Using
modalParser.renderTextObjectfor title/controls aligns these call sites with the new rendering path.Also applies to: 193-193, 198-198
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts (1)
34-194: Refactor alignment looks correct in the parser test harness.The migration to
renderTextObject/block-element-specific renderers and snake_case element methods is consistently applied, and expected outputs remain coherent with the new API surface.packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts (1)
35-251: Renderer migration in banner spec is consistent and well-applied.The updated helper calls (
renderTextObject,renderSectionAccessoryBlockElement,renderInputBlockElement, and snake_case element handlers) are coherent with the refactor and keep the test expectations stable.packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts (1)
36-251: ContextualBar spec updates are coherent with the deprecation cleanup.The switch to
renderTextObjectand block-element-specific renderer entrypoints is consistent across changed helpers and fits the intended API migration.packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts (1)
36-251: Modal parser spec migration is clean and consistent.The updated renderer methods and snake_case element handlers are applied uniformly and remain compatible with the expectations asserted by the tests.
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts (1)
34-194: Attachment parser spec changes are correctly aligned with the new rendering API.The helper replacements (
renderTextObject,renderSectionAccessoryBlockElement,renderActionsBlockElement,renderContextBlockElement) are consistently wired.packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx (1)
69-69: Title rendering migration is correct.Using
parser.renderTextObject(title, 0)here is consistent with the broader parser API changes and keeps behavior unchanged.packages/ui-kit/src/rendering/renderTextObject.ts (1)
6-7: Simplification is good and preserves fallback behavior.The direct renderer lookup plus
?.call(...) ?? nullkeeps null-safety while reducing unnecessary conditional logic.Also applies to: 14-14
packages/livechat/src/components/uiKit/message/index.tsx (1)
99-115: Handler renames are consistent with canonical UI Kit element keys.These renamed parser methods (
datepicker,static_select,multi_static_select) look aligned with the deprecation-removal direction and preserve existing behavior.packages/ui-kit/src/rendering/SurfaceRenderer.ts (2)
45-45: DefaultingrenderTextObjectcontext toBlockContext.NONEis a solid API cleanup.This makes call sites simpler while keeping behavior explicit and consistent with the refactor.
42-42: Verify null-vs-nullish filtering semantics on the render pipeline.On Line 42, the filter
(value): value is TOutputObject => value !== nullwill retainundefinedvalues if any upstream renderer returns them. If that is possible in this pipeline, prefervalue != nullto filter bothnullandundefined.packages/apps-engine/src/definition/messages/IMessageRaw.ts (2)
1-1:blockstyping remains compatible with the deprecation cleanup.Lines 1 and 38 look consistent with the refactor goal and keep the
IMessageRaw.blockssurface explicit.Also applies to: 38-38
9-10: Reconsider the proposed simplification—it changes type semantics and is unsafe.
Pick<T, keyof T>on a union likeLayoutBlockextracts only the common interface (properties shared by all members), producing a narrower type. Simplifying totype IBlock = LayoutBlockwould widen it to the full union, fundamentally changing the type's intent. The current pattern intentionally narrows the interface, and removing it would break the semantic distinction whereArray<IBlock | Block>relies on this narrowing to represent a distinct type.Likely an incorrect or invalid review comment.
6d2fd40 to
44ca5fa
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1)
181-181: Consider replacing raw parser context literals with named constants.
0/1are hard to read and fragile. A small local constant map would make intent clearer with no behavior change.Refactor sketch
+const textRenderContext = { + modal: 0, + action: 1, +} as const; -<ModalTitle id={`${id}-title`}>{modalParser.renderTextObject(view.title, 0)}</ModalTitle> +<ModalTitle id={`${id}-title`}>{modalParser.renderTextObject(view.title, textRenderContext.modal)}</ModalTitle> -{modalParser.renderTextObject(view.close.text, 0)} +{modalParser.renderTextObject(view.close.text, textRenderContext.modal)} -{modalParser.renderTextObject(view.submit.text, 1)} +{modalParser.renderTextObject(view.submit.text, textRenderContext.action)}Also applies to: 193-193, 198-198
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/meteor/client/views/modal/uikit/ModalBlock.tsx` at line 181, Replace the magic numeric context arguments passed to modalParser.renderTextObject (e.g., the literal 0/1 at ModalTitle and the other two call sites) with named constants to clarify intent; add a small local const or enum (for example TEXT_CONTEXT = 0, HTML_CONTEXT = 1 or a CONTEXT_MAP) near the top of the ModalBlock component and update calls like modalParser.renderTextObject(view.title, TEXT_CONTEXT) and similar for the other view fields so the meaning is explicit while preserving behavior.packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts (1)
52-68: Minor: Variable shadowing in map callbacks.The parameter
elementshadows the outerelementparameter in bothactionsandcontextmethods. While this works correctly, it can reduce readability.♻️ Suggested rename for clarity
actions = (element: any, context: any, index: any): any => ({ component: 'actions', props: { key: index, - children: element.elements.map((element: any, key: number) => this.renderActionsBlockElement(element, key)), + children: element.elements.map((child: any, key: number) => this.renderActionsBlockElement(child, key)), block: context === BlockContext.BLOCK, }, }); context = (element: any, context: any, index: any): any => ({ component: 'context', props: { key: index, - children: element.elements.map((element: any, key: number) => this.renderContextBlockElement(element, key)), + children: element.elements.map((child: any, key: number) => this.renderContextBlockElement(child, key)), block: context === BlockContext.BLOCK, }, });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts` around lines 52 - 68, In actions and context methods rename the inner map callback parameter that currently shadows the outer element (in actions: this.renderActionsBlockElement(element, key) and in context: this.renderContextBlockElement(element, key)) to a non-shadowing name (e.g., child or childElement) and update the map callback signature and its usages accordingly so the outer element remains unshadowed and readability is improved; adjust any related TypeScript typings for the new parameter name in both actions and context functions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/meteor/client/views/modal/uikit/ModalBlock.tsx`:
- Line 181: Replace the magic numeric context arguments passed to
modalParser.renderTextObject (e.g., the literal 0/1 at ModalTitle and the other
two call sites) with named constants to clarify intent; add a small local const
or enum (for example TEXT_CONTEXT = 0, HTML_CONTEXT = 1 or a CONTEXT_MAP) near
the top of the ModalBlock component and update calls like
modalParser.renderTextObject(view.title, TEXT_CONTEXT) and similar for the other
view fields so the meaning is explicit while preserving behavior.
In `@packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts`:
- Around line 52-68: In actions and context methods rename the inner map
callback parameter that currently shadows the outer element (in actions:
this.renderActionsBlockElement(element, key) and in context:
this.renderContextBlockElement(element, key)) to a non-shadowing name (e.g.,
child or childElement) and update the map callback signature and its usages
accordingly so the outer element remains unshadowed and readability is improved;
adjust any related TypeScript typings for the new parameter name in both actions
and context functions.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (48)
.changeset/healthy-dragons-crash.mdapps/meteor/client/views/modal/uikit/ModalBlock.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/apps-engine/src/definition/messages/IMessageRaw.tspackages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsxpackages/fuselage-ui-kit/src/blocks/SectionBlock.tsxpackages/fuselage-ui-kit/src/hooks/useUiKitState.tspackages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsxpackages/fuselage-ui-kit/tsconfig.jsonpackages/livechat/src/components/uiKit/message/ButtonElement/index.tsxpackages/livechat/src/components/uiKit/message/ContextBlock/index.tsxpackages/livechat/src/components/uiKit/message/ImageBlock/index.tsxpackages/livechat/src/components/uiKit/message/OverflowElement/index.tsxpackages/livechat/src/components/uiKit/message/SectionBlock/index.tsxpackages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsxpackages/livechat/src/components/uiKit/message/index.tsxpackages/ui-kit/src/blocks/BlockElementType.spec.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/blocks/ButtonStyle.tspackages/ui-kit/src/blocks/ElementType.tspackages/ui-kit/src/blocks/LayoutBlockType.spec.tspackages/ui-kit/src/blocks/LayoutBlockType.tspackages/ui-kit/src/blocks/TextObjectType.spec.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/deprecations.tspackages/ui-kit/src/blocks/isActionsBlockElement.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/blocks/isSectionBlockAccessoryElement.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/index.tspackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/isNotNull.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/rendering/BlockRenderers.tspackages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.tspackages/ui-kit/src/rendering/LayoutBlockRenderer.tspackages/ui-kit/src/rendering/SurfaceRenderer.tspackages/ui-kit/src/rendering/renderBlockElement.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/tsconfig.build.json
💤 Files with no reviewable changes (11)
- packages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.ts
- packages/ui-kit/src/blocks/ElementType.ts
- packages/ui-kit/src/blocks/BlockElementType.spec.ts
- packages/ui-kit/src/blocks/TextObjectType.spec.ts
- packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx
- packages/ui-kit/src/blocks/LayoutBlockType.spec.ts
- packages/ui-kit/src/blocks/ButtonStyle.ts
- packages/ui-kit/src/isNotNull.ts
- packages/ui-kit/src/blocks/deprecations.ts
- packages/ui-kit/src/index.ts
- packages/ui-kit/src/rendering/BlockRenderers.ts
🚧 Files skipped from review as they are similar to previous changes (17)
- packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx
- packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx
- packages/ui-kit/src/blocks/LayoutBlockType.ts
- packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
- packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx
- .changeset/healthy-dragons-crash.md
- packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
- packages/ui-kit/src/blocks/isActionsBlockElement.ts
- packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx
- packages/ui-kit/tsconfig.build.json
- packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
- packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
- packages/ui-kit/src/rendering/renderBlockElement.ts
- packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx
- packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx
- packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
- packages/apps-engine/src/definition/messages/IMessageRaw.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). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 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/modal/uikit/ModalBlock.tsxpackages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tsapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/livechat/src/components/uiKit/message/index.tsxpackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/rendering/SurfaceRenderer.ts
**/*.spec.ts
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use.spec.tsextension for test files (e.g.,login.spec.ts)
Files:
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
🧠 Learnings (17)
📓 Common learnings
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.
📚 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:
apps/meteor/client/views/modal/uikit/ModalBlock.tsxapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/livechat/src/components/uiKit/message/index.tsx
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
apps/meteor/client/views/modal/uikit/ModalBlock.tsxpackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/rendering/SurfaceRenderer.ts
📚 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:
packages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/rendering/BlockContext.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:
packages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/rendering/SurfaceRenderer.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:
packages/ui-kit/src/interactions/ServerInteraction.tspackages/ui-kit/src/rendering/renderTextObject.tspackages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/blocks/isInputBlockElement.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/blocks/layout/InfoCardBlock.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/blocks/layout/VideoConferenceBlock.tspackages/ui-kit/src/blocks/isContextBlockElement.tspackages/ui-kit/src/rendering/BlockContext.tspackages/ui-kit/src/blocks/BlockElementType.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.tspackages/ui-kit/src/blocks/TextObjectType.tspackages/ui-kit/src/blocks/layout/PreviewBlock.tspackages/ui-kit/src/rendering/SurfaceRenderer.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:
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tsapps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsxpackages/livechat/src/components/uiKit/message/index.tsx
📚 Learning: 2025-12-10T21:00:43.645Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:43.645Z
Learning: Adopt the monorepo-wide Jest testMatch pattern: <rootDir>/src/**/*.spec.{ts,js,mjs} (represented here as '**/src/**/*.spec.{ts,js,mjs}') to ensure spec files under any package's src directory are picked up consistently across all packages in the Rocket.Chat monorepo. Apply this pattern in jest.config.ts for all relevant packages to maintain uniform test discovery.
Applied to files:
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.
Applied to files:
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.tspackages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.tspackages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.tspackages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.tspackages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
📚 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:
apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
📚 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:
apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Avoid code comments in the implementation
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests
Applied to files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
🧬 Code graph analysis (8)
apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1)
packages/livechat/src/components/uiKit/message/ActionsBlock.stories.tsx (1)
Button(153-169)
packages/ui-kit/src/rendering/renderTextObject.ts (3)
packages/ui-kit/src/rendering/BlockRenderers.ts (1)
BlockRenderers(8-14)packages/ui-kit/src/index.ts (3)
BlockRenderers(58-58)TextObject(7-7)BlockContext(56-56)packages/ui-kit/src/rendering/SurfaceRenderer.ts (1)
renderTextObject(45-47)
packages/ui-kit/src/blocks/isContextBlockElement.ts (2)
packages/ui-kit/src/blocks/BlockElementType.ts (1)
BlockElementType(3-25)packages/ui-kit/src/blocks/TextObjectType.ts (1)
TextObjectType(3-6)
packages/livechat/src/components/uiKit/message/index.tsx (2)
packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx (1)
context(105-115)packages/ui-kit/src/index.ts (3)
BlockContext(56-56)DatePickerElement(14-14)StaticSelectElement(23-23)
packages/ui-kit/src/blocks/BlockElementType.ts (1)
packages/ui-kit/src/index.ts (2)
BlockElementType(54-54)BlockElement(29-29)
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts (1)
packages/ui-kit/src/index.ts (1)
BlockContext(56-56)
packages/ui-kit/src/blocks/TextObjectType.ts (1)
packages/ui-kit/src/index.ts (2)
TextObjectType(55-55)TextObject(7-7)
packages/ui-kit/src/rendering/SurfaceRenderer.ts (2)
packages/ui-kit/src/index.ts (2)
TextObject(7-7)BlockContext(56-56)packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx (1)
context(105-115)
🔇 Additional comments (25)
packages/ui-kit/src/blocks/TextObjectType.ts (1)
1-6: Type-safe enum-to-const migration looks correct.Good use of
as const+satisfiesto keepTextObjectTypeerasable while preserving strict key/value alignment withTextObject['type'].apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx (1)
93-93: LGTM! Consistent migration torenderTextObjectAPI.The deprecated
contextualBarParser.text()calls have been replaced withrenderTextObject()across all three render sites (title, close button, submit button). The removal of the thirdBlockContextparameter and the associated import aligns with the PR's goal of eliminating deprecated APIs and adopting erasable TypeScript syntax.Also applies to: 105-105, 111-111
packages/ui-kit/src/blocks/layout/PreviewBlock.ts (1)
14-14: Good change: explicit'preview'discriminator is clear and type-safe.This fits the deprecation/erasable-syntax migration and keeps the discriminant narrow.
packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts (1)
4-4: LGTM:'video_conf'literal discriminant is the right migration target.packages/ui-kit/src/blocks/layout/InfoCardBlock.ts (1)
14-14: Looks good:'info_card'discriminator is explicit and consistent with the refactor direction.packages/ui-kit/src/blocks/BlockElementType.ts (1)
1-25: Const-object migration is correct and well-typed.Nice conversion to erasable syntax; the
as const+satisfiesconstraint on Line 25 keeps the exported mapping aligned withBlockElement['type']at compile time.packages/ui-kit/src/blocks/isContextBlockElement.ts (1)
8-16: Type-guard discriminant update looks solid.Using
block.typedirectly and switching toTextObjectType.MRKDWNkeeps this guard consistent with the refactored text type constants, with safe fallback behavior indefault.packages/ui-kit/src/blocks/isInputBlockElement.ts (1)
6-19: Direct discriminant switch is a good cleanup.This keeps the predicate behavior intact while simplifying narrowing logic.
packages/livechat/src/components/uiKit/message/index.tsx (3)
99-105:datepickerrename is clean and behavior-preserving.This aligns with the deprecation cleanup and keeps runtime behavior unchanged.
107-113:static_selectrename is consistent with UiKit element keys.Implementation remains intact and matches the migration goal.
115-115:multi_static_selectdeprecation migration looks correct.Keeping this as an explicit noop is consistent with the existing livechat parser behavior.
apps/meteor/client/views/modal/uikit/ModalBlock.tsx (2)
15-15: Type-onlyUiKitimport is a solid cleanup.This aligns well with the deprecation/erasable-syntax objective and avoids pulling runtime values unnecessarily.
116-116: Typing cleanup in keyboard handling looks correct.Using
querySelectorAll<HTMLElement>(...)and passingedirectly removes unsafe casting while keeping behavior intact.Also applies to: 164-164
packages/fuselage-ui-kit/tsconfig.json (1)
4-4: No issues found. TypeScript 5.9.3 fully supportserasableSyntaxOnly(available since TS 5.0), andnoImplicitReturnsandnoImplicitThisare inherited through the config chain:packages/tsconfig/base.jsonexplicitly definesnoImplicitReturnsand enablesnoImplicitThisviastrict: true. Strictness settings remain in effect.packages/ui-kit/src/rendering/renderTextObject.ts (1)
6-7: Renderer lookup simplification is solid.The direct lookup + null-safe invocation keeps the previous behavior and reduces branching.
Also applies to: 14-14
packages/ui-kit/src/rendering/BlockContext.ts (1)
1-18: Enum-to-object context migration is consistent.The symbol-backed constants and derived union type align with the erasable-syntax goal while keeping strongly typed context usage.
packages/ui-kit/src/rendering/SurfaceRenderer.ts (1)
42-46:render/renderTextObjectadjustments look good.The explicit type guard and default context are clean and keep the rendering pipeline behavior stable.
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts (1)
34-194: Spec helper migration is coherent and well-updated.The move to
renderTextObjectplus the new block-element helper methods is consistent across all changed parser paths.packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts (1)
36-251: Modal parser test refactor is consistent with the new renderer APIs.The updated helper calls and renamed handlers are applied uniformly across changed sections.
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts (1)
35-251: Banner parser spec updates are aligned and consistent.The refactor to
renderTextObjectand renamed element handlers is applied cleanly across the changed helper implementations.packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts (1)
34-194: Message parser spec refactor looks correct.The changed helper methods consistently use the new rendering entry points and keep expected output structure intact.
packages/ui-kit/src/interactions/ServerInteraction.ts (1)
68-74: No compatibility issue:ReportErrorsServerInteractionis a new type, not a breaking change.The
viewIdfield was introduced as mandatory when this type was first added. ActionManager.ts (lines 147-155) already expects and destructuresviewIdas a required field. There are no legacy producers in the codebase emittingtype: 'errors'payloads withoutviewId, and this type has only four references—all within its own definition file.No diff or optional fallback is needed.
Likely an incorrect or invalid review comment.
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts (3)
148-228: Method renames and API alignment look correct.The method renames from camelCase to snake_case (
datepicker,static_select,multi_static_select,plain_text_input,linear_scale) correctly align with the block element type identifiers used in the UI Kit specification. The test expectations throughout the file validate that the new rendering pipeline produces the expected output structure.
261-1906: Test coverage is comprehensive and test names are descriptive.The test suite covers all major block types (divider, section, image, actions, context, input, conditional) with multiple scenarios for each. Test names like "renders text as plain_text", "renders accessory as button", and "renders when conditions match" clearly communicate the expected behavior being tested.
36-50: All render methods are correctly provided by theSurfaceRendererbase class.The methods
renderTextObject,renderSectionAccessoryBlockElement,renderActionsBlockElement,renderContextBlockElement, andrenderInputBlockElementare all defined as public methods inSurfaceRenderer(the immediate parent ofUiKitParserContextualBar) and properly inherited by the test class.
…Block Resolves RocketChat#39493. After the refactor in RocketChat#39268, the renderTextObject call in SectionBlock.tsx was missing its required third context argument. Adds UiKit.BlockContext.NONE consistent with every other renderTextObject call in fuselage-ui-kit, and changes the import from type-only to runtime since BlockContext is a runtime const enum. Made-with: Cursor
Proposed changes (including videos or screenshots)
It removes deprecated types and methods from
@rocket.chat/ui-kit.Issue(s)
Steps to test or reproduce
Further comments
The code moves to erasable syntax, which in reality means no TypeScript
enumsare allowed anymore.Task: ARCH-2027
Summary by CodeRabbit
Refactor
Breaking Changes
Chores