Skip to content

feat(sandbox): set up sandbox for designer exploration - #127

Closed
cixzhang wants to merge 3 commits into
mainfrom
navi/feat/sandbox-setup
Closed

cixzhang wants to merge 3 commits into
mainfrom
navi/feat/sandbox-setup

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Sets up the sandbox app for designer vibe exploration per #126.

Changes

  • Sidebar navigation: New Sidebar.tsx component with page links, integrated into the root layout
  • Example pages: Buttons page (variants, sizes, states) and Form page (text inputs, checkboxes, switches)
  • Static export: Configured next.config.mjs with output: 'export', basePath env var, and images: {unoptimized: true} for GitHub Pages
  • PR enrichment: Updated generate-pr-comment.js to accept --sandbox-url and render a sandbox preview section
  • README: Full guide on adding pages, directory structure, deployment info
  • .gitignore: Fixed pages rule to only ignore root /pages (Pages Router), not src/app/pages/ (App Router)

CI Workflow Changes (needs manual apply)

The workflow file (.github/workflows/storybook.yml) couldn't be pushed due to OAuth token scope limitations. The changes need to be applied manually or with a token that has workflow scope. The diff adds:

  • Build Sandbox step after Storybook build (with SANDBOX_BASE_PATH env var)
  • Sandbox output copied to deploy/${SHORT_HASH}/sandbox/
  • sandbox_url output passed to PR enrichment
  • New Add sandbox link to PR comment step that detects changed sandbox pages and prepends links
Workflow diff

Key additions to the deploy job:

- name: Build Sandbox
  run: yarn workspace @xds/sandbox build
  env:
    SANDBOX_BASE_PATH: /${{ steps.urls.outputs.repo_name }}/${{ steps.urls.outputs.short_hash }}/sandbox

And in deployment:

mkdir -p deploy/${SHORT_HASH}/sandbox
cp -r apps/sandbox/out/* deploy/${SHORT_HASH}/sandbox/

PR enrichment detects changed sandbox pages:

- name: Add sandbox link to PR comment
  run: |
    SANDBOX_CHANGES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- apps/sandbox/src/app/pages/ | head -20)
    if [ -n "$SANDBOX_CHANGES" ]; then
      # Prepends sandbox preview section with links to changed pages
    fi

How to add a new page

  1. Create apps/sandbox/src/app/pages/<name>/page.tsx:
import {XDSVStack, XDSHeading, XDSText} from '@xds/core';

export default function MyPage() {
  return (
    <XDSVStack gap="space4">
      <XDSHeading level={1}>My Page</XDSHeading>
      <XDSText type="body">Content here</XDSText>
    </XDSVStack>
  );
}
  1. Add an entry to the pages array in src/app/Sidebar.tsx

The page appears in the sidebar and gets a unique URL in the PR deployment.

Closes #126


Crafted with care by Navi

- Add sidebar navigation layout with page links
- Add example pages (buttons, form) demonstrating XDS components
- Configure static export for GitHub Pages deployment
- Update generate-pr-comment.js to accept --sandbox-url parameter
- Update README with page creation guide and directory structure

Note: CI workflow changes (.github/workflows/storybook.yml) need to be
applied separately as they require workflow scope permissions.

Closes #126

Co-authored-by: Navi <navi@multimango.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 17, 2026
@github-actions

github-actions Bot commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 5.9KB 9.7KB 1.6KB

Accessibility Audit

Status: 43 accessibility violation(s) found.

XDSAspectRatio - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSAvatar - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSBadge - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSButton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCalendar - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCard - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSCenter - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCheckboxInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSCloseButton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDateInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDialog - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDivider - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSDropdownMenu - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSField - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSFontWrapper - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSGrid - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHStack - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHeading - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSHoverCard - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSIcon - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSLayout - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSLink - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSNumberInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSRadioList - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSection - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSSelector - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSkeleton - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSlider - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSStackItem - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSSwitch - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTabList - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTable - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSText - 2 issue(s)
  • critical: Form elements must have labels
    • Rule: label
  • serious: Links must have discernible text
    • Rule: link-name
XDSTextArea - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTextInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTimeInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTooltip - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTopNav - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSVStack - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name

Generated by PR Enrichment workflow | Storybook | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

I'm making updates to the examples so will revisit this later.

@cixzhang cixzhang closed this Feb 19, 2026
@cixzhang
cixzhang deleted the navi/feat/sandbox-setup branch February 20, 2026 14:41
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.

Sandbox: enable designer vibe exploration workflow

1 participant