Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-fans-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/fuselage-ui-kit': patch
---

fix: pass missing BlockContext argument to renderTextObject in SectionBlock
4 changes: 2 additions & 2 deletions packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Flex, Grid, GridItem } from '@rocket.chat/fuselage';
import type * as UiKit from '@rocket.chat/ui-kit';
import * as UiKit from '@rocket.chat/ui-kit';
import type { ReactElement } from 'react';
import { memo, useMemo } from 'react';

Expand Down Expand Up @@ -28,7 +28,7 @@ const SectionBlock = ({ className, block, surfaceRenderer }: SectionBlockProps):
<GridItem>
{text && (
<Box is='span' fontScale='p2' color='default'>
{surfaceRenderer.renderTextObject(text, 0)}
{surfaceRenderer.renderTextObject(text, 0, UiKit.BlockContext.NONE)}
</Box>
Comment on lines 29 to 32
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

SectionBlock is rendering the section's text with BlockContext.NONE. For a text object inside a section block, the correct semantic context is BlockContext.SECTION (this is how other renderers in the repo render section text), which keeps behavior consistent and avoids future context-specific rendering differences.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! However, every other block in this codebase
(CalloutBlock.tsx, InputBlock.tsx, ImageBlock.tsx, ActionsBlock.tsx,
PreviewBlock.tsx, InfoCard.tsx, and even SectionBlock.Fields.tsx)
uses BlockContext.NONE for renderTextObject calls. Using BlockContext.NONE
keeps this consistent with the rest of the codebase.

)}
{fields && <Fields fields={fields} surfaceRenderer={surfaceRenderer} />}
Expand Down