Skip to content

refactor(ui-kit): Remove UiKit deprecations#39268

Merged
ggazzo merged 6 commits intodevelopfrom
feat/ui-kit-refactor
Mar 3, 2026
Merged

refactor(ui-kit): Remove UiKit deprecations#39268
ggazzo merged 6 commits intodevelopfrom
feat/ui-kit-refactor

Conversation

@tassoevan
Copy link
Copy Markdown
Member

@tassoevan tassoevan commented Mar 3, 2026

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 enums are allowed anymore.

Task: ARCH-2027

Summary by CodeRabbit

  • Refactor

    • Unified text rendering and simplified accessory/context rendering paths across UI components.
    • Converted several legacy enums and deprecated aliases to safer constant forms to tighten types.
  • Breaking Changes

    • Removed legacy wrappers and deprecated public surfaces; integrations must use the new rendering helpers and updated names.
    • Error reporting interactions now include an associated view identifier.
  • Chores

    • Package versions updated.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 3, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 44ca5fa

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

This PR includes changesets to release 43 packages
Name Type
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-kit Major
@rocket.chat/apps-engine Minor
@rocket.chat/livechat Minor
@rocket.chat/meteor Minor
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-voip Major
@rocket.chat/core-services Patch
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
rocketchat-services Patch
@rocket.chat/apps Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/api-client Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/models Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Major
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 3, 2026

Walkthrough

Removes 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

Cohort / File(s) Summary
Changeset
\.changeset/healthy-dragons-crash.md
Bumps multiple package versions and adds refactor note for removing UiKit deprecations.
App UI components
apps/meteor/client/views/modal/uikit/ModalBlock.tsx, apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
Replaced legacy *.text(...) with renderTextObject(...); removed unused BlockContext imports and converted UiKit import to type-only where applicable.
Apps Engine types
packages/apps-engine/src/definition/messages/IMessageRaw.ts
Replaced imported IBlock with a local InterfaceOf<LayoutBlock> alias and adjusted blocks typing.
Fuselage UI Kit
packages/fuselage-ui-kit/src/...
Switched text rendering to renderTextObject(...); renamed enum case MARKDOWNMRKDWN; removed generic text() dispatcher; simplified conditions; adjusted tsconfig.
Livechat UI Kit components
packages/livechat/src/components/uiKit/message/...
Replaced parser.text(...) with parser.renderTextObject(...); migrated accessory/context/input render calls to new block-element-specific renderers; minor import/order tweaks.
Livechat Message Parser
packages/livechat/src/components/uiKit/message/index.tsx
Renamed parser methods from camelCase to snake_case: datePickerdatepicker, staticSelectstatic_select, multiStaticSelectmulti_static_select.
UI Kit enums → consts
packages/ui-kit/src/blocks/BlockElementType.ts, .../TextObjectType.ts, .../LayoutBlockType.ts, .../rendering/BlockContext.ts
Converted several TypeScript enums to readonly const objects with type-level satisfies assertions; BlockContext now exposes Symbol values and a corresponding type alias.
Deprecated removals
packages/ui-kit/src/blocks/deprecations.ts, .../ButtonStyle.ts, .../ElementType.ts, .../rendering/ConditionalBlockFiltersEngine.ts, .../isNotNull.ts
Deleted deprecations file and removed deprecated enums, types, and the isNotNull helper from the public API.
Layout discriminants
packages/ui-kit/src/blocks/layout/InfoCardBlock.ts, .../PreviewBlock.ts, .../VideoConferenceBlock.ts
Replaced template-literal discriminant types tied to LayoutBlockType with fixed string literal discriminants (e.g., 'info_card', 'preview', 'video_conf').
Type-guard simplifications
packages/ui-kit/src/blocks/isActionsBlockElement.ts, .../isContextBlockElement.ts, .../isInputBlockElement.ts, .../isSectionBlockAccessoryElement.ts
Switched switch expressions to block.type (removed casts), corrected TextObjectType case labels, and added an explicit default in one guard; logic unchanged.
Rendering API refactor
packages/ui-kit/src/rendering/SurfaceRenderer.ts, .../renderTextObject.ts, .../renderBlockElement.ts, .../BlockRenderers.ts, .../LayoutBlockRenderer.ts
Removed deprecated wrapper methods (text, plainText, renderActions, renderContext, renderAccessories, renderInputs); added default param to renderTextObject; simplified renderer lookups; removed deprecated renderer fields.
Parser & tests updates
packages/ui-kit/src/surfaces/.../*.spec.ts, packages/ui-kit/src/blocks/*/*.spec.ts
Updated many specs and test helpers to use renderTextObject/plain_text and block-element renderers; renamed internal test helper methods (camelCase→snake_case); removed several type-level tests.
Public API / index
packages/ui-kit/src/index.ts, packages/ui-kit/src/interactions/ServerInteraction.ts
Removed wildcard re-export of deprecations; added viewId field to ReportErrorsServerInteraction.
TypeScript build config
packages/ui-kit/tsconfig.build.json
Added removeComments: false to preserve comments in build outputs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'refactor(ui-kit): Remove UiKit deprecations' accurately summarizes the main objective of removing deprecated types and methods from the ui-kit package, which aligns with the changeset and the comprehensive refactoring work shown across multiple files.
Linked Issues check ✅ Passed The PR fulfills the linked issue objectives by removing deprecated types (IBlock, IElement, ButtonStyle, ElementType, etc.), converting enums to objects (TextObjectType, LayoutBlockType, BlockContext), removing deprecated public exports from deprecations.ts, and updating method names to snake_case variants (datePicker→datepicker, staticSelect→static_select) across all affected packages. The code adheres to erasable syntax constraints by eliminating TypeScript enums.
Out of Scope Changes check ✅ Passed All changes are directly related to removing UiKit deprecations and migrating to erasable syntax. Minor changes like tsconfig.json updates (erasableSyntaxOnly, removeComments) and method renames (text→renderTextObject) are all in support of the deprecation removal objective and do not introduce unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.86%. Comparing base (ea73f1c) to head (44ca5fa).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 60.36% <ø> (+0.02%) ⬆️
e2e-api 48.77% <ø> (+0.03%) ⬆️
unit 71.55% <81.25%> (+0.03%) ⬆️

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

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

@tassoevan tassoevan force-pushed the feat/ui-kit-refactor branch 3 times, most recently from 2b0dd4a to c4a3850 Compare March 3, 2026 06:30
@tassoevan tassoevan modified the milestone: 8.3.0 Mar 3, 2026
@tassoevan tassoevan changed the title poc: feat(ui-kit): Remove UiKit deprecations refactor(ui-kit): Remove UiKit deprecations Mar 3, 2026
@tassoevan tassoevan force-pushed the feat/ui-kit-refactor branch 2 times, most recently from 0134b04 to 9851a5d Compare March 3, 2026 15:14
@tassoevan tassoevan added this to the 8.3.0 milestone Mar 3, 2026
@tassoevan tassoevan marked this pull request as ready for review March 3, 2026 19:07
@tassoevan tassoevan requested review from a team as code owners March 3, 2026 19:07
@tassoevan
Copy link
Copy Markdown
Member Author

/jira ARCH-2021

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
packages/ui-kit/src/interactions/ServerInteraction.ts (1)

100-110: Consider using typia.createIs<ServerInteraction>() instead of manual OR chain.

The composite isServerInteraction function manually ORs all individual type guards. Using typia.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 0 for every field loses per-field positional identity in renderer output. Using i keeps 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

📥 Commits

Reviewing files that changed from the base of the PR and between b7ff7b2 and 9851a5d.

📒 Files selected for processing (48)
  • .changeset/healthy-dragons-crash.md
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/apps-engine/src/definition/messages/IMessageRaw.ts
  • packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx
  • packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
  • packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
  • packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx
  • packages/fuselage-ui-kit/tsconfig.json
  • packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx
  • packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx
  • packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx
  • packages/livechat/src/components/uiKit/message/index.tsx
  • packages/ui-kit/src/blocks/BlockElementType.spec.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/blocks/ButtonStyle.ts
  • packages/ui-kit/src/blocks/ElementType.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.spec.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.ts
  • packages/ui-kit/src/blocks/TextObjectType.spec.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/deprecations.ts
  • packages/ui-kit/src/blocks/isActionsBlockElement.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/blocks/isInputBlockElement.ts
  • packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/index.ts
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/isNotNull.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/rendering/BlockRenderers.ts
  • packages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.ts
  • packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/ui-kit/src/rendering/renderBlockElement.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/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.ts
  • packages/ui-kit/src/blocks/isActionsBlockElement.ts
  • packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/livechat/src/components/uiKit/message/index.tsx
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx
  • packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
  • packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.ts
  • packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx
  • packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/rendering/renderBlockElement.ts
  • packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/apps-engine/src/definition/messages/IMessageRaw.ts
  • packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx
  • packages/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.ts extension for test files (e.g., login.spec.ts)

Files:

  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/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.json
  • packages/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.ts
  • packages/ui-kit/src/blocks/isActionsBlockElement.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/rendering/renderBlockElement.ts
  • packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/apps-engine/src/definition/messages/IMessageRaw.ts
  • packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/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.ts
  • packages/ui-kit/src/blocks/isActionsBlockElement.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/rendering/renderBlockElement.ts
  • packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/apps-engine/src/definition/messages/IMessageRaw.ts
  • packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/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.md
  • packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/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.tsx
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/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.md
  • apps/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.md
  • packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
  • apps/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.tsx
  • packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx
  • apps/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.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/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.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/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-kit is marked as major (breaking surface cleanup), while related consumers are minor, 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 dispatchActionConfig checks 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 of LayoutBlock['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 from LayoutBlockType while 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 BlockElementType strongly 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-constituents is appropriate here. While ModalView['id'], BannerView['viewId'], and ContextualBarView['id'] likely all resolve to string, 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: Verify erasableSyntaxOnly compatibility and preserved strictness diagnostics.

This is likely correct for the erasable-syntax migration, but confirm the repo TypeScript version supports erasableSyntaxOnly and that noImplicitReturns/noImplicitThis are 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) to surfaceRenderer.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 i for 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 renderTextObject with 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 BlockContext values 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.BLOCK to typeof BlockContext.BLOCK is correct. With the enum-to-const-object migration, typeof BlockContext.BLOCK properly 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 to BlockElementRenderer<T> | undefined correctly handles the polymorphic return type.


14-14: LGTM!

The optional chaining with nullish coalescing provides clean, readable null handling while maintaining the correct this context 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.type switch and MRKDWN case 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.type keeps the same accepted element set and return behavior.

packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx (1)

18-25: MRKDWN case 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.type directly 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.

renderContextBlockElement is correctly used in the per-item mapping path.

apps/meteor/client/views/modal/uikit/ModalBlock.tsx (3)

15-15: Type-only UiKit import 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 direct handleKeyDown(e) call improve type clarity cleanly.

Also applies to: 164-164


181-181: Modal text rendering migration is consistent.

Using modalParser.renderTextObject for 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 renderTextObject and 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(...) ?? null keeps 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: Defaulting renderTextObject context to BlockContext.NONE is 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 !== null will retain undefined values if any upstream renderer returns them. If that is possible in this pipeline, prefer value != null to filter both null and undefined.

packages/apps-engine/src/definition/messages/IMessageRaw.ts (2)

1-1: blocks typing remains compatible with the deprecation cleanup.

Lines 1 and 38 look consistent with the refactor goal and keep the IMessageRaw.blocks surface 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 like LayoutBlock extracts only the common interface (properties shared by all members), producing a narrower type. Simplifying to type IBlock = LayoutBlock would 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 where Array<IBlock | Block> relies on this narrowing to represent a distinct type.

Likely an incorrect or invalid review comment.

@tassoevan tassoevan force-pushed the feat/ui-kit-refactor branch from 6d2fd40 to 44ca5fa Compare March 3, 2026 21:09
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1)

181-181: Consider replacing raw parser context literals with named constants.

0/1 are 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 element shadows the outer element parameter in both actions and context methods. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6d2fd40 and 44ca5fa.

📒 Files selected for processing (48)
  • .changeset/healthy-dragons-crash.md
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/apps-engine/src/definition/messages/IMessageRaw.ts
  • packages/fuselage-ui-kit/src/blocks/ContextBlock.Item.tsx
  • packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
  • packages/fuselage-ui-kit/src/hooks/useUiKitState.ts
  • packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx
  • packages/fuselage-ui-kit/tsconfig.json
  • packages/livechat/src/components/uiKit/message/ButtonElement/index.tsx
  • packages/livechat/src/components/uiKit/message/ContextBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/ImageBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/OverflowElement/index.tsx
  • packages/livechat/src/components/uiKit/message/SectionBlock/index.tsx
  • packages/livechat/src/components/uiKit/message/StaticSelectElement/index.tsx
  • packages/livechat/src/components/uiKit/message/index.tsx
  • packages/ui-kit/src/blocks/BlockElementType.spec.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/blocks/ButtonStyle.ts
  • packages/ui-kit/src/blocks/ElementType.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.spec.ts
  • packages/ui-kit/src/blocks/LayoutBlockType.ts
  • packages/ui-kit/src/blocks/TextObjectType.spec.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/deprecations.ts
  • packages/ui-kit/src/blocks/isActionsBlockElement.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/blocks/isInputBlockElement.ts
  • packages/ui-kit/src/blocks/isSectionBlockAccessoryElement.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/index.ts
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/isNotNull.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/rendering/BlockRenderers.ts
  • packages/ui-kit/src/rendering/ConditionalBlockFiltersEngine.ts
  • packages/ui-kit/src/rendering/LayoutBlockRenderer.ts
  • packages/ui-kit/src/rendering/SurfaceRenderer.ts
  • packages/ui-kit/src/rendering/renderBlockElement.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/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.tsx
  • packages/ui-kit/src/interactions/ServerInteraction.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/blocks/isInputBlockElement.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/livechat/src/components/uiKit/message/index.tsx
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/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.ts extension for test files (e.g., login.spec.ts)

Files:

  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/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.tsx
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/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.tsx
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/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.ts
  • packages/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.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/blocks/isInputBlockElement.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/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.ts
  • packages/ui-kit/src/rendering/renderTextObject.ts
  • packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts
  • packages/ui-kit/src/blocks/isInputBlockElement.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/blocks/layout/InfoCardBlock.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/ui-kit/src/blocks/layout/VideoConferenceBlock.ts
  • packages/ui-kit/src/blocks/isContextBlockElement.ts
  • packages/ui-kit/src/rendering/BlockContext.ts
  • packages/ui-kit/src/blocks/BlockElementType.ts
  • packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts
  • packages/ui-kit/src/blocks/TextObjectType.ts
  • packages/ui-kit/src/blocks/layout/PreviewBlock.ts
  • packages/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.ts
  • apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx
  • packages/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.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/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.ts
  • packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts
  • packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts
  • packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts
  • packages/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 + satisfies to keep TextObjectType erasable while preserving strict key/value alignment with TextObject['type'].

apps/meteor/client/views/room/contextualBar/uikit/UiKitContextualBar.tsx (1)

93-93: LGTM! Consistent migration to renderTextObject API.

The deprecated contextualBarParser.text() calls have been replaced with renderTextObject() across all three render sites (title, close button, submit button). The removal of the third BlockContext parameter 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 + satisfies constraint on Line 25 keeps the exported mapping aligned with BlockElement['type'] at compile time.

packages/ui-kit/src/blocks/isContextBlockElement.ts (1)

8-16: Type-guard discriminant update looks solid.

Using block.type directly and switching to TextObjectType.MRKDWN keeps this guard consistent with the refactored text type constants, with safe fallback behavior in default.

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: datepicker rename is clean and behavior-preserving.

This aligns with the deprecation cleanup and keeps runtime behavior unchanged.


107-113: static_select rename is consistent with UiKit element keys.

Implementation remains intact and matches the migration goal.


115-115: multi_static_select deprecation 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-only UiKit import 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 passing e directly 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 supports erasableSyntaxOnly (available since TS 5.0), and noImplicitReturns and noImplicitThis are inherited through the config chain: packages/tsconfig/base.json explicitly defines noImplicitReturns and enables noImplicitThis via strict: 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/renderTextObject adjustments 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 renderTextObject plus 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 renderTextObject and 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: ReportErrorsServerInteraction is a new type, not a breaking change.

The viewId field was introduced as mandatory when this type was first added. ActionManager.ts (lines 147-155) already expects and destructures viewId as a required field. There are no legacy producers in the codebase emitting type: 'errors' payloads without viewId, 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 the SurfaceRenderer base class.

The methods renderTextObject, renderSectionAccessoryBlockElement, renderActionsBlockElement, renderContextBlockElement, and renderInputBlockElement are all defined as public methods in SurfaceRenderer (the immediate parent of UiKitParserContextualBar) and properly inherited by the test class.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Mar 3, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 3, 2026
@ggazzo ggazzo merged commit 87f9262 into develop Mar 3, 2026
49 checks passed
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 3, 2026
@ggazzo ggazzo deleted the feat/ui-kit-refactor branch March 3, 2026 23:34
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to an unknown Git error Mar 3, 2026
TheRazorbill pushed a commit to TheRazorbill/Rocket.Chat that referenced this pull request Mar 4, 2026
Avanish-Gupta-CSE added a commit to Avanish-Gupta-CSE/Rocket.Chat that referenced this pull request Mar 15, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants