Skip to content

Support grid layouts in the STACK flow component - #39

Open
DonOmalVindula wants to merge 1 commit into
thunder-id:mainfrom
DonOmalVindula:fix/stack-grid-layout
Open

Support grid layouts in the STACK flow component#39
DonOmalVindula wants to merge 1 commit into
thunder-id:mainfrom
DonOmalVindula:fix/stack-grid-layout

Conversation

@DonOmalVindula

@DonOmalVindula DonOmalVindula commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Purpose

The STACK flow component in @thunderid/react always renders its children as a flex row/column, so layouts like a 2 x 2 button grid (four login options, two per row) are impossible even though the EmbeddedFlowComponent.items property ("Number of items across the main axis (for Stack grid-like layouts)") already exists in @thunderid/javascript. This PR makes the renderer honor items.

Approach

  • In AuthOptionFactory's Stack case, items is the number of slots across the main axis and direction picks that axis: row (default) makes it the column count (items: 2 with four buttons renders a 2 x 2 grid), and column makes it the row count with children flowing into further columns.
  • Grid mode requires items >= 2. Stacks with a single slot or no items keep the existing flex layout unchanged, so flows authored before this change render exactly as before.
  • items is parsed defensively from the SDK's string | number type: malformed values ("2invalid"), zero, and negatives fall back to flex, and the slot count is clamped so a mistyped value cannot render thousands of cells.
  • These are the same semantics as the ThunderID flow builder canvas and the product Gate renderer, which share a getStackGridSx helper in the companion PR.

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DonOmalVindula, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f21898d3-57b0-42ae-bb2b-befa6cd1fc0c

📥 Commits

Reviewing files that changed from the base of the PR and between 0d057c0 and 774e089.

⛔ Files ignored due to path filters (2)
  • packages/react/.vitest-attachments/c9891740f128573b74ff197ffdd73f48e9bb07c3.png is excluded by !**/*.png
  • packages/react/.vitest-attachments/f8145b8d341b7f08ed6850e534f440a2b03a5c2e.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • packages/react/src/components/presentation/auth/AuthOptionFactory.tsx
  • packages/react/src/components/presentation/auth/__tests__/AuthOptionFactory.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Honor the items property on STACK flow elements so children can be laid
out in an n-column grid (e.g. a 2 x 2 grid with items: 2). Non-numeric
or absent values keep the existing flex layout.

Refs thunder-id/thunderid#3703
@DonOmalVindula
DonOmalVindula force-pushed the fix/stack-grid-layout branch from fcb9de7 to 774e089 Compare July 27, 2026 09:28
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.

1 participant