Skip to content

fix: add missing BlockContext argument to renderTextObject in SectionBlock#39642

Open
Avanish-Gupta-CSE wants to merge 1 commit intoRocketChat:developfrom
Avanish-Gupta-CSE:fix/issue-39493-sectionblock-missing-context
Open

fix: add missing BlockContext argument to renderTextObject in SectionBlock#39642
Avanish-Gupta-CSE wants to merge 1 commit intoRocketChat:developfrom
Avanish-Gupta-CSE:fix/issue-39493-sectionblock-missing-context

Conversation

@Avanish-Gupta-CSE
Copy link
Copy Markdown

@Avanish-Gupta-CSE Avanish-Gupta-CSE commented Mar 15, 2026

Proposed changes (including videos or screenshots)

Adds the missing third context argument to the renderTextObject call in SectionBlock.tsx, fixing the TypeScript build error introduced by #39268.

Changes:

  1. packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx:
    • Changed import type * as UiKit to import * as UiKit (runtime import needed for BlockContext const enum)
    • Added UiKit.BlockContext.NONE as the third argument to surfaceRenderer.renderTextObject(text, 0, UiKit.BlockContext.NONE)

Context

After the refactor in #39268 (refactor(ui-kit): Remove UiKit deprecations), the renderTextObject signature changed to require 3 arguments: (textObject, index, context). The SectionBlock.tsx call was the only one in fuselage-ui-kit that wasn't updated — every other call (in ActionsBlock, CalloutBlock, ImageBlock, InputBlock, ButtonElement, SectionBlock.Fields, etc.) already passes UiKit.BlockContext.NONE as the third argument.

Issue(s)

Closes #39493

Steps to test or reproduce

  1. Checkout develop branch before this fix
  2. Run yarn dev — observe TS2554: Expected 3 arguments, but got 2 in SectionBlock.tsx
  3. Apply this fix
  4. Run yarn dev@rocket.chat/fuselage-ui-kit compiles with 0 errors

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Patched the SectionBlock component to include a previously missing context argument in text rendering operations. This fix ensures the component maintains proper context state throughout block operations, preventing rendering errors and improving overall stability of section block displays.

…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
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 15, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 15, 2026

🦋 Changeset detected

Latest commit: cbced24

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

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/meteor Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-voip Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer 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/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@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 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f208b1b-d717-4e13-8acb-3a7dd88e8a5d

📥 Commits

Reviewing files that changed from the base of the PR and between a834e17 and cbced24.

📒 Files selected for processing (2)
  • .changeset/fix-sectionblock-missing-context.md
  • packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
📜 Recent 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 (1)
**/*.{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/fuselage-ui-kit/src/blocks/SectionBlock.tsx
🧠 Learnings (1)
📚 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/fuselage-ui-kit/src/blocks/SectionBlock.tsx
🔇 Additional comments (2)
.changeset/fix-sectionblock-missing-context.md (1)

1-5: Changeset entry is accurate and correctly scoped.

The patch note clearly matches the implemented fix and target package.

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

2-2: Runtime import + renderTextObject arity fix look correct.

Line 2 correctly enables runtime access to UiKit.BlockContext, and Line 31 now passes the required third context argument in the same pattern used by sibling blocks.

Also applies to: 31-31


Walkthrough

A patch-level fix addresses a missing BlockContext argument in the renderTextObject call within SectionBlock.tsx. The import statement was updated to allow access to the runtime BlockContext constant, and the function call now includes the required third argument.

Changes

Cohort / File(s) Summary
Changeset
.changeset/fix-sectionblock-missing-context.md
Documents a patch-level fix for the missing BlockContext argument in SectionBlock.
SectionBlock Fix
packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx
Changed import from type-only to value import; added missing UiKit.BlockContext.NONE as third argument to renderTextObject call.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

type: chore

🚥 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 title clearly and accurately summarizes the main change: adding the missing BlockContext argument to renderTextObject in SectionBlock.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #39493: adds the third context argument to renderTextObject, converts the UiKit import to runtime, and ensures compilation without errors.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the TypeScript error in SectionBlock; no unrelated modifications are present.
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.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

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.

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Missing BlockContext argument in renderTextObject call in SectionBlock

1 participant