fix: add missing BlockContext argument to renderTextObject in SectionBlock#39642
Conversation
…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
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: cbced24 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 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)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (1)📚 Learning: 2025-11-17T15:07:13.273ZApplied to files:
🔇 Additional comments (2)
WalkthroughA patch-level fix addresses a missing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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. Comment 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. |
Proposed changes (including videos or screenshots)
Adds the missing third
contextargument to therenderTextObjectcall inSectionBlock.tsx, fixing the TypeScript build error introduced by #39268.Changes:
packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx:import type * as UiKittoimport * as UiKit(runtime import needed forBlockContextconst enum)UiKit.BlockContext.NONEas the third argument tosurfaceRenderer.renderTextObject(text, 0, UiKit.BlockContext.NONE)Context
After the refactor in #39268 (
refactor(ui-kit): Remove UiKit deprecations), therenderTextObjectsignature changed to require 3 arguments:(textObject, index, context). TheSectionBlock.tsxcall was the only one infuselage-ui-kitthat wasn't updated — every other call (inActionsBlock,CalloutBlock,ImageBlock,InputBlock,ButtonElement,SectionBlock.Fields, etc.) already passesUiKit.BlockContext.NONEas the third argument.Issue(s)
Closes #39493
Steps to test or reproduce
developbranch before this fixyarn dev— observeTS2554: Expected 3 arguments, but got 2inSectionBlock.tsxyarn dev—@rocket.chat/fuselage-ui-kitcompiles with 0 errorsMade with Cursor
Summary by CodeRabbit