Skip to content

feat(cli): frame-first layout guidance — new docs layout topic, agent rules, principles anti-patterns - #3315

Merged
cixzhang merged 1 commit into
mainfrom
layout-guidance
Jul 4, 2026
Merged

cixzhang merged 1 commit into
mainfrom
layout-guidance

Conversation

@thedjpetersen

@thedjpetersen thedjpetersen commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

An analysis of six product-scale demo apps built on the design system (popular app inspired) showed that layout quality — real app frames instead of "card soup" (a padded scroll column of Card-wrapped sections with decorative Badges) — came from three things the apps encoded themselves: frame-first structure with explicit region budgets, a container policy where dense data renders as rows (the Linear- and Slack-style apps used zero Cards), and written responsive contracts. None of that knowledge existed in astryx's guidance surfaces: the principles anti-patterns were all token/styling rules, and the agent cheat sheet said nothing about page structure.

This PR moves that layout knowledge into the design system's guidance pipeline so every consumer inherits it.

What

  • New astryx docs layout topic (+ dense variant, auto-discovered by the docs command and the agent cheat sheet topic list):
    • Frame-first workflow with region px budgets (side nav 240–280, rail 64–72, inspector 340–420, facet rail 220–260)
    • App-archetype table mapping archetype → frame → container policy
    • Cards-vs-Rows do/don't (Card = widgets/galleries/settings groups; dense data = Table or List/Item rows, edge-to-edge)
    • Inspector-panel pattern (LayoutPanel + useResizable) and the responsive-contract convention
  • Agent cheat sheet (astryx init --features agents): three new RULES lines — frame first, dense data = rows not Card-wrapped items, StatusDot/Token over decorative Badge
  • docs principles: frame-first + rows rules and two new anti-patterns (Card-wrapped list items, Badge as decoration), with dense and zh translations kept positionally aligned

Testing

  • astryx docs layout / --dense render correctly; topic auto-appears in docs listing and the generated cheat sheet
  • astryx init --features agents output includes the new rules
  • vitest run packages/cli: all agent-docs (48), docs (7), and detail-level (12) tests pass; the 6 failures in the full sweep are pre-existing on main (verified via stash)

Companion PR: the incident-console template demonstrates these rules in a full page.

…es, principles anti-patterns

Adds the layout knowledge that steers generation away from card-soup
output and toward product-grade app frames:

- New `astryx docs layout` topic (+ dense variant): frame-first
  workflow, region px budgets, app-archetype table (frame + container
  policy per archetype), cards-vs-rows do/dont, inspector-panel
  pattern, responsive-contract convention.
- Agent cheat sheet (astryx init --features agents): three new RULES
  lines — frame first, dense data = rows not Card-wrapped items,
  StatusDot/Token over decorative Badge.
- Principles doc: frame-first + rows rules and two new anti-patterns
  (Card-wrapped lists, decorative Badge), with dense and zh
  translations kept aligned.

Patterns distilled from an analysis of six product-scale demo apps
built on the design system, where container choice consistently
tracked the product archetype (dense tools used zero Cards) and layout
quality came from frame-first structure with explicit region budgets.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 1, 2026
@vercel

vercel Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 1, 2026 8:50pm

Request Review

@github-actions

github-actions Bot commented Jul 1, 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
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


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

@cixzhang

cixzhang commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

This seems pretty good. Were you able to vibe test these docs to show some improvements to layouts?

@cixzhang
cixzhang merged commit 8adfe39 into main Jul 4, 2026
15 checks passed
@github-actions
github-actions Bot deleted the layout-guidance branch July 12, 2026 06:57

This branch was successfully deployed

1 active deployment
Preview — 701ba827 Deployed Jul 1, 2026 by vercel[bot]
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.

3 participants