Skip to content

feat: Allow all children in Row#3532

Merged
FrederikBolding merged 4 commits intomainfrom
fb/allow-box-in-row
Jul 9, 2025
Merged

feat: Allow all children in Row#3532
FrederikBolding merged 4 commits intomainfrom
fb/allow-box-in-row

Conversation

@FrederikBolding
Copy link
Copy Markdown
Member

@FrederikBolding FrederikBolding commented Jul 9, 2025

Allow BoxChildStruct as child of Row. This enables a bunch of additional use-cases for Row by allowing any component as its child.

@FrederikBolding FrederikBolding marked this pull request as ready for review July 9, 2025 09:56
@FrederikBolding FrederikBolding requested a review from a team as a code owner July 9, 2025 09:56
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.26%. Comparing base (304ada7) to head (b3c0b47).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3532   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files         411      411           
  Lines       11618    11619    +1     
  Branches     1810     1810           
=======================================
+ Hits        11416    11417    +1     
  Misses        202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding changed the title feat: Allow Box in Row feat: Allow all children in Row Jul 9, 2025
cursor[bot]

This comment was marked as outdated.

@FrederikBolding FrederikBolding enabled auto-merge July 9, 2025 10:40
@FrederikBolding FrederikBolding disabled auto-merge July 9, 2025 10:40
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs a JSDoc update for children

Copy link
Copy Markdown
Contributor

@GuillaumeRx GuillaumeRx left a comment

Choose a reason for hiding this comment

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

We also need to add Value to BoxChildStruct

@FrederikBolding FrederikBolding enabled auto-merge July 9, 2025 10:48
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: TypeScript and Runtime Validation Mismatch

The RowChildren TypeScript type and its JSDoc were updated to allow 'any component', but runtime validation in validation.ts still restricts Row children to ValueStruct and BoxChildStruct. This discrepancy causes TypeScript-valid components to fail runtime validation and results in misleading documentation.

packages/snaps-sdk/src/jsx/components/Row.ts#L6-L13

*/
export type RowChildren = GenericSnapElement;
/**
* The props of the {@link Row} component.
*
* @property label - The label of the row.
* @property children - The content of the row. This can be any component.

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@FrederikBolding FrederikBolding added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit 23bbcf9 Jul 9, 2025
120 checks passed
@FrederikBolding FrederikBolding deleted the fb/allow-box-in-row branch July 9, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants