-
Notifications
You must be signed in to change notification settings - Fork 13.5k
fix: Missing BlockContext argument in renderTextObject call in SectionBlock #39493
Description
Description:
After the refactor in #39268 (refactor(ui-kit): Remove UiKit deprecations),
the renderTextObject call in SectionBlock.tsx is missing its required
third context argument, causing a TypeScript build error on the develop branch.
Steps to reproduce:
- Clone the repo and checkout develop
- Run yarn dev
- Observe the TypeScript error in @rocket.chat/fuselage-ui-kit compilation
Expected behavior:
@rocket.chat/fuselage-ui-kit compiles with 0 errors
Actual behavior:
src/blocks/SectionBlock.tsx:31:24 - error TS2554: Expected 3 arguments, but got 2.
31 {surfaceRenderer.renderTextObject(text, 0)}
renderTextObject requires: (textObject: TextObject, index: number, context: BlockContext)
An argument for 'context' was not provided.
Server Setup Information:
- Version of Rocket.Chat Server: 8.3.0-develop
- License Type: Community
- Number of Users:
- Operating System: Ubuntu
- Deployment Method: Local development
- Number of Running Instances:
- DB Replicaset Oplog:
- NodeJS Version: 22.16.0
- MongoDB Version: 8.0
Client Setup Information
- Desktop App or Browser Version: Chrome
- Operating System: Ubuntu
Additional context
Introduced by commit 87f9262 which replaced surfaceRenderer.text(text)
with surfaceRenderer.renderTextObject(text, 0) but omitted the required
third argument. Every other call to renderTextObject in the codebase
correctly passes UiKit.BlockContext.NONE as the third argument
(see ButtonElement.tsx, CalloutBlock.tsx, InputBlock.tsx etc).
Also requires changing the import from import type * as UiKit to
import * as UiKit since BlockContext is a runtime const, not a type.
Relevant logs:
N/A