RocketChat / RocketChat/Rocket.Chat
fix: Missing BlockContext argument in renderTextObject call in SectionBlock
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
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 87f9262af4 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/blocks/SectionBlock.tsx and compare its renderTextObject call with the calls in ButtonElement.tsx, CalloutBlock.tsx, and InputBlock.tsx. Run yarn dev to reproduce the TypeScript error in @rocket.chat/fuselage-ui-kit. Done means the call supplies the required BlockContext value, the import supports it, and the package compiles with 0 errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100