Skip to content

feat(cli): build starts a plain page from its family's default - #7276

Closed
josephfarina wants to merge 3 commits into
mainfrom
josephfarina/build-family-defaults
Closed

josephfarina wants to merge 3 commits into
mainfrom
josephfarina/build-family-defaults

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

User need

When someone asks astryx build for a plain table, like "orders table with customer, total and status", they should start from the table page that already does what most tables need. That's the filterable table. It has search, filter chips, saved views, bulk actions and a detail panel. Right now the start for an idea like that depends on incidental words. The same kind of ask lands on the grouped table, the searchable table or the collapsible multi-table page. Each of those is built for one specific job, and if you didn't ask for that job you have to strip it out.

Problem and solution fit

  • Families. Page templates already name a family in their category (Table - Filtering, Dashboard - Monitoring). Build reads the text before the spaced hyphen as the family.
  • One default per family, declared by the template. A page template can say it's its family's default with the new optional doc field isFamilyDefault. The filterable table and the analytics dashboard declare it. There's no list of defaults in build.
  • Family first. When build would start a whole page from a page whose family has a default, it starts from the default instead. The exception is when the idea names what that page is built for. That means a word from the page's own variant or display name, or a keyword no other page in its family has, that the default doesn't carry. Two words of the idea that the page matches and the default doesn't also count. A page search matched by name keeps its place, and the page the default displaced leads the alternatives.
  • Integrations join a family through their category. An integration can declare a default for its own family or stand in for ours. If two integrations both declare one family, that family has no default.
  • Parts of a page, changes to an existing page and app-shell starts don't change. A family nobody declares a default for doesn't change either.

Current specification

spec:AST-048 owns what build starts from. I added FR23 (family first), FR24 (one default per family, declared by the template) and DEC-10, with the decider marked josephfarina (proposed). The field is also in architecture:template-authoring's field table.

Public delta and caller burden

  • New optional page-template doc field isFamilyDefault: boolean. It needs a category. An integration page that sets it needs @astryxdesign/cli 0.7.1 or later, and integration verify reports family_default_needs_cli if the package's CLI range lets in an older one. Published 0.6.8 and 0.7.0 drop a page that sets the field and keep the rest of the package.
  • astryx build keeps its JSON shape. For a plain idea in a family with a default, start is the default, start.reason says why ("The Table family's default page: the idea names nothing table-page is built for."), and the displaced page is start.alternatives[0].
  • If no template declares a default, build's output doesn't change.

Some made-up ideas, before and after:

Idea Start before Start after
vendors table with contact and status table-collapsible table-filter (table-collapsible is the first alternative)
table of customer accounts with owner and plan table-collapsible table-filter
simple table of products with price table-collapsible table-filter
a weekly report of sales by region dashboard-scorecard dashboard
orders table with customer, total and status table-page table-page (totals are the searchable table's own keyword)
grouped table of tasks by owner table-grouped table-grouped
tree table of folders and files table-tree table-tree
comparison table of pricing plans table-comparison table-comparison
analytics dashboard with kpi tiles dashboard dashboard

One existing build test expected dashboard-scorecard for "a weekly report of sales by region". It now expects dashboard, since a plain report doesn't name anything the scorecard is built for.

Compatibility

Compatible, so the changeset is a patch [feat]. No released consumer has to change.

  • astryx build keeps its JSON shape. Which template is the start and which are the alternatives are ranking values, and spec:AST-048 FR11 and DEC-5 let a ranking change move them. Catalog values aren't stable identifiers either (spec:AST-017 FR10, FR11).
  • isFamilyDefault is a new optional field, so it only widens what a page template doc accepts (spec:AST-017 FR5). template --list --json doesn't change.
  • integration verify reports family_default_needs_cli only for a package that sets the new field, so no existing package starts failing. No package's CLI range changes.
  • Checked against current main after the 0.7.0 release. It merges cleanly and check:changesets passes. The CLI floor is 0.7.1, the next release after 0.7.0, since 0.7.0 shipped without this change.

Design and alternatives

See DEC-10. I didn't go with a default picked by ranking or kept in build's own code, because it drifts from the templates and an integration can't change it. I also didn't move the start to another family just because the idea's first words name it.

Evidence

  • Unit tests for family defaults and the family-first start on made-up catalogs. They cover a declared default, no declaration, app chrome, an integration over Astryx, two integrations, a named sibling, a sibling with two words of its own, the default itself and a family without a default.
  • Build tests on the shipped templates. A plain table idea starts from the filterable table and offers the displaced page next. Ideas that name grouping or a tree keep those pages.
  • Integration tests. An integration default stands in for ours in build, and an integration family starts plain ideas from its default and named ideas from its sibling.
  • Parser, integration verify and CLI floor tests for the new field.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run --project node packages/cli on this branch merged with current main. 392 files and 6284 tests pass, with the 2 expected failures. The same run on main on the same box passes too.
  • typecheck:json-api, typecheck:authoring, typecheck:template-docs, check:knowledge, check:changesets, check:cli-structure, readme:check, eslint on the changed paths and cli-api-types-verify all pass.
  • Published 0.6.8 and 0.7.0 drop an integration page that sets isFamilyDefault and keep the rest of the package. I checked both with a fixture integration.

Writing rubric results

  • R1 narration. FR23, FR24 and DEC-10 describe the system in the present tense. No "today", "before this record" or "when this ships" wording.
  • R2 research. No data, studies or option surveys in the record.
  • R3 evidence. No pull request is cited as evidence.
  • R4 rejected alternatives. DEC-10 has one Rejected: line covering a default kept outside the templates and moving the start to another family by its first words.
  • R5 change references. None.
  • R6 open questions. None added, none ruled.

A page template can now say it's the default start for its family with `isFamilyDefault`. The family is the category text before " - ". The filterable table and the analytics dashboard declare it.

When build would start from a page in a family that has a default, it starts from the default, unless the idea names what that page is built for. That means a word from its own variant or display name, or a keyword no other page in the family has, or two words of the idea the page matches and the default doesn't. The page that got displaced leads the alternatives. Parts, edits, and app-shell starts don't change.

Integrations can declare a default for their own family or stand in for ours. An integration page that sets the field needs CLI 0.6.8. AST-048 gets FR23, FR24 and DEC-10 (proposed).
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 13, 2026 6:22am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 10, 2026
@astracat-bot

astracat-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
📝 Draft — not reviewed automatically (for maintainers only) Oct 13, 2026, 6:35 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox are not both ready on the exact-head Vercel preview.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

44 of 448 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 238,081
Chat Full AI Chat probe dark 237,048
Markdown Default probe light 159,625
Markdown Default probe dark 158,986
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
TableRowExpansion Detail Panel neutral dark 5,150
TableRowExpansion Detail Panel neutral light 4,068

and 24 more.


Generated by PR Enrichment workflow | View full report

0.6.8 and 0.7.0 shipped without this change, and both still reject `isFamilyDefault` and drop that page. So the floor moves to 0.7.1, the next release after the 0.7 cut. The floor table row, the tests and the docs move with it.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Superseded by the build refactor (#7752); family defaults can return as a build tree branch.

@github-actions
github-actions Bot deleted the josephfarina/build-family-defaults branch October 22, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 94678ea6 Deployed Oct 13, 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. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant