Skip to content

feat(Stack): default direction to vertical - #1945

Merged
cixzhang merged 1 commit into
mainfrom
navi/feat/stack-default-vertical
May 2, 2026
Merged

feat(Stack): default direction to vertical#1945
cixzhang merged 1 commit into
mainfrom
navi/feat/stack-default-vertical

Conversation

@cixzhang

@cixzhang cixzhang commented May 2, 2026

Copy link
Copy Markdown
Contributor

What

Makes direction="vertical" the default for XDSStack, so <XDSStack> without a direction prop renders a vertical stack.

Why

Vertical is the overwhelmingly common case — 482 vertical vs 126 horizontal usages in the codebase. More importantly, LLMs frequently hallucinate bare <XDSStack> without specifying direction, which was previously a type error. Defaulting to vertical makes the zero-prop case just work.

Changes

  • XDSStack.tsx: direction prop is now optional, defaults to 'vertical'
  • XDSStack.test.tsx: Added test for default direction behavior
  • Stack.stories.tsx: Default story no longer passes explicit direction

Non-breaking

Existing code that passes direction="vertical" or direction="horizontal" is unaffected. Only the previously-invalid case of omitting direction is now valid.

XDSStack now defaults to direction='vertical' when omitted.

Vertical is the most common layout direction (482 vs 126 usages in the
codebase), and LLMs frequently hallucinate bare <XDSStack> without any
direction prop — which previously was a type error. Defaulting to
vertical makes the zero-prop case work correctly.
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xds-sandbox Ready Ready Preview, Comment May 2, 2026 0:43am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 2, 2026
@cixzhang
cixzhang enabled auto-merge (squash) May 2, 2026 00:46
@cixzhang
cixzhang merged commit a88ecf3 into main May 2, 2026
18 checks passed
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 17.4KB 27.1KB 4.0KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@github-actions
github-actions Bot deleted the navi/feat/stack-default-vertical branch May 2, 2026 06:47
cixzhang added a commit that referenced this pull request Jun 21, 2026
XDSStack now defaults to direction='vertical' when omitted.

Vertical is the most common layout direction (482 vs 126 usages in the
codebase), and LLMs frequently hallucinate bare <XDSStack> without any
direction prop — which previously was a type error. Defaulting to
vertical makes the zero-prop case work correctly.
cixzhang added a commit that referenced this pull request Jun 21, 2026
XDSStack now defaults to direction='vertical' when omitted.

Vertical is the most common layout direction (482 vs 126 usages in the
codebase), and LLMs frequently hallucinate bare <XDSStack> without any
direction prop — which previously was a type error. Defaulting to
vertical makes the zero-prop case work correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant