Skip to content

feat(template): add Tree Table page template - #6195

Merged
ernestt merged 2 commits into
mainfrom
template-table-tree
Sep 24, 2026
Merged

ernestt merged 2 commits into
mainfrom
template-table-tree

Conversation

@ernestt

@ernestt ernestt commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Note

Landing ahead of #6194, deliberately. This template was originally held
for that column-resize fix. #6194 is not converging, and nothing here breaks
without it, so this goes first and picks the improvements up whenever #6194
lands.

What that costs, measured by swapping useTableColumnResize to its main
version and back:

on main today with #6194
table scroll wrapper 6px overflow 0px
resize lines on header hover transparent painted

The overflow is a stray nested scrollbar inside the table; the second is the
discoverability of column resizing, which without #6194 is visible only once
the pointer is already inside the 8px hit area. Both are properties of the
plugin, not of this template
— no change here is needed either way, and no
change here would fix them.

What

A new page template, Tree Table, for the case where a table's rows form a hierarchy and every parent is a summary of what is under it.

The fixture is a code repository, chosen because it makes the rollup legible without explanation: a folder's "last commit" is self-evidently the newest commit beneath it, so the parent row visibly derives from its children rather than merely containing them. That is the property the template is demonstrating, and it is the one that is hard to show with flat sample data.

overview

What it demonstrates

useTableTreeData parents roll up the newest commit beneath them
useTableSortable sorting is scoped to siblings, so branches never interleave
useTableColumnResize columns resize, with the tree column held to a floor
custom plugin arrow keys walk the tree per the APG treegrid pattern
Markdown the folder's README renders below the table

Search prunes the tree to the branches that match and reports a live count, rather than filtering rows out of their context:

search

Selecting a folder retargets both the header trail and the README panel:

folder selected

Breadcrumbs wraps rather than truncates when it runs out of room, which in a single-row toolbar pushes the whole header taller. Past three crumbs the middle folds into a menu, so the trail keeps its height and both ends — the repo you are in and the folder you are looking at — stay visible:

trail menu

Narrow viewports collapse the search, branch/tag and social actions to icons on one shared breakpoint, and drop the About sidebar below the table:

narrow

Dark mode:

dark


Scorecard

Triage: new template, structural → full pass.

Category Max Score
Astryx component purity 30 30
Icon purity 15 15
Custom CSS 15 12
Layout & structure 15 15
Doc metadata 10 10
Image handling 5 5
Code quality 10 10
100 97 — A

Findings

  • Component purity 30/30. No raw HTML elements; every node is an Astryx component.
  • Icon purity 15/15. No inline SVG. All icons come from lucide-react through Icon, matching the existing template convention (theme-showcase and the theme icon sets). lucide-react is declared on apps/template-viewer so it no longer resolves only by hoisting.
  • Custom CSS 12/15. Three declarations, each carrying a comment for why a prop will not do:
    • selectedRow paints the selection as an inset shadow, because the zebra stripe sets background-color on the same row and would replace a background.
    • two paddingInline: 4px — one to bring Toolbar's inline padding onto the table's 16px content line (Toolbar has no padding prop), one inside TabList so its divider still spans the full card while the tabs inset.
  • Layout & structure 15/15. Roots in Layout with contentWidth, header in the header slot, About in the end slot, no app chrome. Links are inert.
  • Doc metadata 10/10. All six fields; four-slot description with base and -able forms of the load-bearing verbs, since the search stemmer does not relate them.
  • Image handling 5/5. No imagery — nothing to host or strip.
  • Code quality 10/10. 'use client', default export, self-contained imports, realistic fixture, clean typecheck and lint.

What would close the last 3 points: only a paddingInline prop on Toolbar and a padded-content variant of TabList would retire the two remaining spacing declarations. Both are core changes, out of scope here — the third declaration (selectedRow) has no prop-shaped equivalent and is the kind of escape hatch the category tolerates.

Lifecycle flag: this lands visible rather than hidden: true. Calling it out per the review instructions — it grades A, well clear of the B bar, so I have not staged it hidden. Happy to add the flag if you would rather it bake.

Notes for review

  • Row hover is off. The template is striped, and in the current theme the hover tint and the stripe resolve to the same value, so on every other row the hover was invisible; in dark mode it made the row lighter rather than more emphasised. Rather than ship a half-working affordance, rows rely on the link hover and the keyboard focus ring. The underlying issue — Table hover replacing the stripe's background-color instead of compositing with it — is a core one and not addressed here.
  • The Card around the table uses padding={0} deliberately: besides letting the stripes reach the border, it zeroes the container padding variables that Table's edge-bleed subtracts from its own margins, which is what keeps the gap above the table honest.

Test plan

  • tsc --noEmit and eslint clean.
  • Verified in Chromium, light and dark, at 1500 / 900 / 680px: trail collapse past three crumbs with the folded crumb in the menu, search pruning with the live count, folder selection retargeting the trail and README, arrow-key traversal, column resize floor on the tree column.
  • Confirmed the selection wash resolves to a real blue in both themes (rgb(196,221,251) light, rgba(158,183,255,.24) dark) and survives the zebra stripe.

@vercel

vercel Bot commented Sep 9, 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 Sep 23, 2026 11:37pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 9, 2026
github-actions Bot added a commit that referenced this pull request Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 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

No component packages changed.

Accessibility Audit

Status: 36 accessibility violation(s) found — 2 critical, 34 serious.

Button pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/19 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatReasoning - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatToolCalls - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Checkbox pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/33 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CheckboxList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/17 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ClickableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditor - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorPerf - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/2 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 13/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/21 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
GridMasonry - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Heading - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
LogStream - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
MediaTheme Auto - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Radio group pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RichTextEditor - 2 issue(s)
  • 🟠 serious: Ensure every ARIA input field has an accessible name
    • Rule: aria-input-field-name · Affects 2/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure every form element has a label
    • Rule: label · Affects 1/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
SelectableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/4 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Stepper - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/30 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TableGroupedRows - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 3/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
TableTree - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 8/9 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/23 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Theme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PopArt - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/6 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Thumbnail - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Timestamp - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/20 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

19 of 422 shot(s) changed. View the report

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
Slider Default probe light 15,617
Slider Default probe dark 15,615
Chat With Attachments probe light 12,964
Chat With Attachments probe dark 12,114
InputGroup With Typeahead probe light 11,012
InputGroup With Typeahead probe dark 9,189
ComplexSelector Tree list with search probe light 6,245
TextArea Vertical Form Alignment probe light 5,634
ComplexSelector Tree list with search probe dark 5,602
TextArea Vertical Form Alignment probe dark 5,047
ComplexSelector Fruit ripeness selector neutral light 4,007
ComplexSelector Fruit ripeness selector neutral dark 3,825
ToggleButton Group Single probe dark 1,538
ToggleButton Group Single probe light 1,538
MediaTheme On Dark neutral dark 838
Banner Collapsible Content (Expanded) probe dark 92
Banner Collapsible Content (Expanded) probe light 90
AlertDialog Delete neutral light 71
TableRowStatus Default neutral light 23
Slider — Default — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Slider — Default — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — With Attachments — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

@astracat-bot

astracat-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 24, 2026, 12:00 AM UTC

@humbertovirtudes humbertovirtudes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breadcrumb navigation can leave stale visible and semantic selection because selectedId is omitted from the keyboard plugin memo dependencies. The copyable interaction layer also lacks committed behavior tests for focus, traversal, search, selection, expansion, sorting, resizing, and tabs, while preview membership extends a manual map instead of the canonical registry. Please fix these issues and settle the ready-template decision before approval.

A page template for the case where a table's rows form a hierarchy and
every parent is a summary of what is under it. The fixture is a code
repository, because a folder's "last commit" is self-evidently the
newest commit beneath it — the parent row visibly derives from its
children rather than merely containing them, which is the property the
template exists to demonstrate and the one flat sample data cannot show.

Composes useTableTreeData (parents roll up), useTableSortable (sorting
scoped to siblings, so branches never interleave), useTableColumnResize
(tree column held to a floor), a small custom plugin for APG treegrid
arrow-key traversal, and Markdown for the folder README. Search prunes
the tree to matching branches and reports a live count rather than
lifting rows out of their context.

Registers in the docsite template map and the shadcn registry routes
lock. No core or library change.
@ernestt

ernestt commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main

Was conflicting against 42 commits of main. Rebuilt on 1d940e0 as a single commit rather than replaying through the branch's own merge commit, which is what made the conflicts messy.

It got smaller — 7 files to 5. Two of the branch's changes landed on main independently in the meantime:

  • apps/template-viewer/package.json — lucide-react is already there, so the dependency line is redundant
  • pnpm-lock.yaml — nothing left to change once that dependency is already locked

The three conflicts that were real:

file resolution
apps/docsite/src/components/templateComponents.ts main added work-item-detail in the same spot; both entries kept, table-tree before it
apps/template-viewer/package.json main moved @stylexjs/stylex to catalog:; took main's
internal/shadcn-registry/routes.lock.json re-inserted the template-table-tree entry in its sorted position

The template source itself — page.tsx and template.doc.mjs, 1711 of the 1736 lines — did not conflict and is unchanged.

Also updated the header note. It said "Land after #6194". Since that is not converging, it now says this is landing ahead of it on purpose, and keeps the measured table of what that costs (6px wrapper overflow, unpainted resize lines on header hover) — both plugin properties, unaffected either way by anything in this PR.

Verified: eslint clean, full pre-commit check suite green, astryx template --list shows Tree Table and astryx template table-tree emits the source. pnpm install --frozen-lockfile leaves the lockfile untouched, confirming it needs no entry.

josephfarina's approval was on the pre-rebase head, so it will need re-applying. humbertovirtudes' change request is untouched by this — it is about the keyboard-plugin memo dependency, the missing interaction tests, and preview membership going through the manual map instead of the canonical registry. None of those are addressed here; this is a rebase only.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two changes are needed before this new template is ready:

  • Fix selection synchronization in the keyboard plugin: the memoized row transform reads the selected folder but does not depend on it, so navigating through the breadcrumb can leave the old row highlighted and exposed as selected after the header and README move. Add the missing dependency, update the file-header comment that says the plugin has no selection, and add a regression test for selecting a folder and then navigating through a breadcrumb.
  • Register the Docsite live preview from canonical template registry data rather than extending the hand-maintained preview map, so the catalog and the preview cannot drift apart.

Compatibility-wise the addition is clean: it is purely additive, changes no shared component API, and the patch release note fits. The exact ready-state direction also still needs its owner decision.

[Automated review]

The template's local useTreeKeyboardNav paints both the cursor (roving
tabIndex) and the selection (aria-selected plus a washed row) from one
memoized transformBodyRow, but selectedId was missing from that memo's
dependency list.

Selecting from the table hid it: that path also expands the row, so
expandedIds changes, handleKeyDown is rebuilt, and the memo recomputes
for an unrelated reason. A breadcrumb click moves selection alone —
nothing else the memo watches changes — so the old row kept both the
tint and aria-selected while the header trail and README moved on. A
stale aria-selected is a wrong answer to a screen reader, not only a
stale tint, and a template is copy-paste source: shipped as-is, every
app built from it inherits the same defect.

Also corrects the file header, which claimed the rows carry "no
aria-selected, no selected-row tint" — the code has set both since the
selection wash was added, so the note read as a design decision the
implementation had already left behind.
@ernestt

ernestt commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the selection bug; pushing back on the other two

Pushed fddd5b2.

The selectedId dependency — real, and fixed

Both reviews found this and both are right. Traced it end to end before changing anything:

  • Selecting from the table → selectFolder also calls setExpanded → expandedIds changes → handleKeyDown is rebuilt → the memo recomputes. Selection appears to follow, which is why this survived review.
  • Clicking a breadcrumb (page.tsx:1568, 1579) → bare setSelectedFolderId. visibleData memoizes on [data, expandedIds, getId, getChildren, getIsExpandable, sortSiblings], so nothing the memo watches moves, handleKeyDown keeps identity, and the memo never recomputes.

The old row kept both the wash and aria-selected={true} while the trail and README moved on. selectedId is now in the dependency list.

Worth saying why this was worth fixing rather than noting: a stale aria-selected is a wrong answer to a screen reader, not just a stale tint, and a template is copy-paste source — shipped as-is, every app built from it inherits the defect.

I also corrected the file header, which astracat-bot was right to flag. It read "The rows carry a cursor, not a selection … no aria-selected, no selected-row tint" — the code has set both since the selection wash landed, so the note described a decision the implementation had already left behind.

Why lint did not catch it: @eslint-react/exhaustive-deps is scoped to packages/core/src/** (eslint.config.js:363). Templates are only in the no-console: off block. A separate question, but it is the reason this class of bug can reach a template at all.

The regression test — the harness does not exist, and I hit four walls proving it

I tried to write the test. It is not that it is hard; there is nowhere for it to go. No page template has a test today — 0 of 57. In order:

  1. packages/cli has no @testing-library/react — it is a devDep of packages/core and the root only.
  2. Placed beside the template, the root Vitest config routes packages/cli/** to the node project — plain node, no DOM, no StyleX transform.
  3. Moved to the docsite suite (which has Testing Library, jsdom and a real docsite-test job): @astryxdesign/core/Layout will not resolve, because the template lives inside @astryxdesign/cli where core is an optional peer.
  4. Added the core source aliases: Unexpected 'stylex.defineVars' call at runtime — the docsite suite has no @vitejs/plugin-react + StyleX babel pipeline, so core source cannot compile there.

Clearing that means either adding test deps to the CLI package, or giving the docsite suite a second StyleX pipeline, plus new include/exclude routing in the root config. That is a test-infrastructure change that should stand on its own and apply to all 57 templates — not ride a PR that happens to add the 58th. Happy to do it as a separate PR if there is appetite.

The asks for tests covering "focus, traversal, search, selection, expansion, sorting, resizing, and tabs" would be the first interaction tests in the template corpus, held to a bar nothing else in it meets.

Preview membership — the map is the convention, deliberately

templateComponents.ts is hand-maintained by design. Its own docblock says so:

SYNC: when a page template is added under packages/cli/assets/templates/pages/<slug>/, add a matching entry here.

That is enforced by check:sync, and all 54 entries follow it. It is manual because each value is a lazy(() => import('…')) whose specifier has to be statically analyzable for the bundler to split it — a generator cannot emit that from registry data without a codegen step. Converting it is a 54-entry refactor with a build-time story attached; it is not this template's to carry.

Ready-state

Genuinely open, and a human call rather than a diff — happy to follow whatever is decided.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new Tree Table template is ready to approve.

  • The breadcrumb selection fix is in: the row wash and aria-selected now follow the selected folder when it changes through a breadcrumb alone, and the file header correctly describes the cursor and the selection as separate things. Selecting from the table and navigating back through the trail now stay in step.
  • Compatibility is clean: the change is purely additive, changes no shared component or CLI behavior, and the patch release note fits. The Docsite preview entry follows the same registration every gallery-visible template uses today.

Two disclosed notes do not block this template: it lands ahead of the separate column-resize plugin work (a small wrapper overflow and unpainted resize lines until that lands, both plugin properties), and template interaction-test infrastructure does not exist for any page template yet — the author's offer to build it as its own change covering all templates is the right place for it.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 24, 2026
@ernestt
ernestt merged commit 7482949 into main Sep 24, 2026
40 checks passed
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.
josephfarina added a commit that referenced this pull request Sep 24, 2026
…iptors (#6498)

* Keep a topic's title when an integration extends it

`mergeTopic` took the extension's title and description whenever it stated
them, and every extension has to state both, so extending a topic renamed it:
with an integration extending `theme` installed, `astryx docs theme` printed
the extension's title instead of "Theme System". An extension now adds or
replaces sections and leaves the title and description alone. A topic that
`replaces` another still renames it. The authoring reference and the
integration guide say so, and tests cover both relationships.

* Author integration themes with typed descriptors

Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme
now ships a strongly typed same-stem `ThemeDoc` beside its source instead of
an entry in a central `themes/manifest.json` catalog, which was only ever in
canary. Theme discovery reads the descriptor, derives the source entry and
runtime export from the shared stem, parses the source without running it,
and keeps each theme directory together when it copies and packs it. New
component, topic, and template scaffolds emit typed `.doc.mjs` files;
released `.doc.ts`, `.doc.js` and `.template.*` inputs still load.

On top of #6315 as it stood:
- `ThemeDoc` joins the typed examples, the authoring self-docs and their
  field test, and the lock list; its relative imports name their files so
  the packed types still resolve under nodenext.
- The integration guide keeps #6290's palette detail (the request, the
  candidate and its receipt) and drops the catalog steps. Its drift test now
  checks the ThemeDoc fields and that the documented theme directory is
  exactly what discovery ships; `theme palette generate` no longer tells
  authors to list files in a catalog.
- The spec draft moves from AST-035 to AST-039, because #6265 already uses
  AST-035. That is bookkeeping, not a resolution: the two drafts describe
  overlapping rules, and which one governs is still undecided.

* Give every doctor integration warning its fix

`astryx doctor integration validate` already finds a contribution no root
reads, a codemod outside a version folder, a mis-named codemod folder, a
component source with no doc, and a doc with no source. It said what was
wrong and left the author to work out the fix. Each message now ends with it:
the root that reads the file (or the exact manifest line to declare its folder
as one), the version folder a codemod belongs in, or the file to add. A theme
descriptor's fix names the folder above its theme directory, since that is
the themes root. Codemod paths are shown relative to the package, not as
absolute paths.

* List every authored descriptor once, as compiler input

The doc compiler only saw reference topics. `collectDocInputs` lists every
descriptor a project reads, whatever root it comes from: components, hooks,
templates, themes, doc topics and their extensions, and the CLI's own
self-docs. Each input records the root that reads it, the name a reader asks
for, the package that contributes it, and where the file ships
(`<package>/<path>`), so nothing machine-specific reaches a compiled node.
Nothing reads the list yet; the next slices compile it.

A new test is the completeness check for what this repo ships. Every
`.doc.mjs` under Core's source and every directory the CLI's package.json
ships must be read exactly once, and nothing else may be. Mutating the list
(dropping hooks, unlisted docs, extensions, or a self-doc tree; keying
templates by title; skipping the duplicate check) fails it.

Writing it turned up two things. Ten core docs are read by
`component <Name>` but left out of `component --list`, because the list needs
a same-stem source. The test pins them, since listing them would change the
CLI's output. And templates are looked up by type and directory name, not by
title; three showcase blocks share a title with the block they show, which is
fine, but it means the title can never be an id.

* Compile every doc kind, and read every doc through the compiler

Until now only doc topics went through the doc compiler. Components, hooks,
templates, themes, and the CLI's own self-docs were each loaded by whichever
reader wanted them, with its own export order, its own translation merge, and
no check. Now every kind lowers through `lowerDoc` into one sealed node shape:
checked against its kind's parser, translated, carried as JSON, with package
provenance and no machine paths.

- `foundation/doc-compiler/read.mjs` is the one place that loads a doc file
  for reading, and `import.mjs` the one place that executes one. The
  component and hook loaders, search, template and theme discovery, the docs
  list, and the authoring self-docs now read compiled nodes. A new test fails
  if any other module starts executing modules.
- `compileDocs` compiles everything a project reads at once: 1,055 nodes for
  this repo, nine kinds, zero diagnostics, in every language. A bundle reads
  back through a sealed parser that rejects schema skew, unknown fields,
  machine paths, and non-JSON values.
- One diagnostic shape for every phase: a stable code that fixes its phase,
  severity, scope, and remediation, sorted into one order. A token reference
  that finds nothing is now a warning in the bundle.

Nothing a reader sees changes. Each reader keeps its own strictness: the
checked loaders still throw what they threw, and the unchecked ones still read
a doc that fails its parser. The overlay logic moved as is. Evidence: 2,939
CLI reads (every component, hook, template, topic, and section, text and
`--json`, in every language, plus search, build, and theme list) are
byte-identical to the base, and new golden snapshots of integration-doc reads
were recorded at the base and match.

* Move the typed-descriptor policy text to its own spec PR

The descriptor rule (every integration item owns one typed doc, and the
manifest never catalogs items) is a public-model decision, so it gets its own
draft spec PR and its own review instead of riding along with the code. This
removes the spec draft, the INV20 invariant, the contributing guidance, and
the AGENTS.md pointer from this PR. The theme code and the INV19 text that
describes it stay: they state what the code does. Test titles no longer name
the spec.

* cli: resolve provider precedence once, with a ledger

Project, upgrade, and markProviderConflicts each re-derived which package
wins a provider ID, and every drop path returned a shorter list with no
record. They now share one resolver,
foundation/integrations/provider-resolution.mjs. It returns the same
resolved list as before, plus a ledger keyed by real package directory with
one outcome per package: contributes, set-aside (winner and reason),
load-failed, or alias-of.

- Project.load resolves configured, autolinked, and local candidates in one
  pass and keeps the ledger (providerLedgerOf, internal).
- The autolink copy dedupe, an autolinked load failure, and a dependency
  key that repeats a loaded directory are ledger entries now, not silent
  skips.
- upgrade's loadProjectContext hands Project's list, the installed copy,
  and its extras to the same resolver under the codemod policy, on top of
  Project's ledger.
- markProviderConflicts and autolinkIntegrations keep their signatures and
  results.

No output changes. A seeded property test runs the real Project.load and
upgrade context over 200 generated projects. It checks that the ledger
accounts for every candidate exactly once, and that both agree on the
winner of every provider ID, except where the installed copy stands in for
the package being authored.

Two it.fails repros pin a disagreement that exists today: upgrade lets an
--integration extra with an autolinked package's name@version stand in for
it, from any directory, at the extras' position, so another extra can win
the ID in upgrade only.

* test(cli): inventory every doc route with a proposed placement

Add doc-routes.json: one row per built-in topic and section key, and one
row per provider and kind of typed descriptor (ids in
doc-routes.ids.json). Each row records the current CLI route, the
docsite URL, a proposed docs-graph placement, whether an alias is
needed, and a rationale.

doc-routes.test.mjs derives today's routes from the CLI and fails when
a route has no row, a row names a route that no longer exists, or a row
lacks a rationale or uses a placement form the proposal does not define.

* Document DebugEvent and GapReportHandler in astryx docs authoring

Both types are exported from @astryxdesign/cli/authoring, but no self-doc
sat beside debug/type.ts or gap-report/type.ts, so astryx docs authoring
had no section for either. Add one for each, list them after the config
section, and hold them to the published types in the self-doc type test.

* Fail doctor when a public authoring type has no doc

checkAuthoringDocs now also traces every type @astryxdesign/cli/authoring
exports to the module that declares it, parsing index.d.ts and the modules
it re-exports with jscodeshift. The self-doc beside that module must be
listed in AUTHORING_SELF_DOCS, load, and render a section that
astryx docs authoring --index lists, and a listed self-doc must document a
type the package exports. Parsers are left out: they read these types and
are not a shape anyone writes.

A failure names each type, the module that declares it, and the self-doc
that is missing, unlisted, or not in the topic. A passing run prints
exactly what it printed before.

* Route the two new authoring sections, and give whole-repo tests room

The route inventory now has rows for `debug-event` and `gap-report-handler`,
the two authoring sections the doctor check added. The tests that compile or
import every doc in the repo get explicit timeouts, because on a busy machine
they ran past the 30 s default.

* Generate the CLI README from the CLI's self-docs

The README copied reference data by hand, and the copies had drifted: the
search options named a --detail flag that is really --verbose, and the config
and integration tables left out five fields.

- Every command gets a generated usage line, options and examples from its
  CommandDoc, and the API section lists every function in
  @astryxdesign/cli/api and @astryxdesign/cli/json from its FunctionDoc.
- The search options and the doctor integration table come from their
  CommandDocs. The config and integration tables and the copied "How it
  works" text become pointers to the `astryx docs` sections that serve them,
  checked against `astryx docs <topic> --index`.
- The generator writes only between markers, formatting each block on its
  own, so every other byte is kept. It checks each section's source comment,
  fails when a live command or an exported function has no doc, and warns
  about a doc for something that does not exist.
- --check names the drifted sections and the command that fixes them. The
  generator stays one script, the module the doc-load guard allows to import
  self-docs, and runs only when node runs it, not when a test imports it.

* Readers print the authored doc; only the whole-project compile is JSON

Adversarial testing found that routing reads through the compiler had changed
what readers print. Every reader got the doc after a JSON round trip, so a
BigInt, a cycle, a function, a date, `Infinity`, or a key set to `undefined`
changed or broke text output: `component Link --zh` lost its Props heading
for nine core components, and an integration doc with `10n` in it crashed
`component`. Checked loaders also threw a JSON error instead of the parser's
message, and accepted a theme descriptor as a component.

- `lowerDoc` now returns the view readers have always read: the authored
  export with its translation laid over it, uncopied and unconverted. Only
  the sealed node, which a whole-project compile collects, goes through JSON,
  and a value JSON cannot hold withdraws the node, never the view.
- Each reader keeps its old loader (a plain import for the unchecked readers,
  jiti for the checked ones), export order (`a ?? b ?? c`, empty value
  included), and strictness: the parser's error first, then a failed
  translation. Outside the themes root a theme descriptor is still an
  unsupported type, with the same message.
- Unchecked readers no longer run the parser at all, and reads no longer stat
  and resolve every file: a process lowers each file once, as Node's module
  cache holds it, and tries a file that failed to load again.
- `component` and `hook` detail reads hand out their own copy (containers
  copied with their descriptors, everything else shared), so a caller that
  edits a result no longer changes the next read.
- The bundle withdraws a node with a problem of its own, so every bundle
  reads back through its sealed parser; diagnostics never carry a machine
  path; a package with no name is named by its folder; two extension files
  from one package get their own inputs; a topic value JSON cannot hold is
  `not_json` like any other doc; and prototype names are not diagnostic codes.

* Make the doc-loads guard see every way a module runs code

The guard matched callee names, so 18 of the 23 ways a reviewer found to run a doc file got past it: a static doc import, a renamed or namespaced loader, a loader passed as a value, createRequire, a Worker, eval, and more. It now matches by what a module imports and how it uses it, scans every source file in the package, and lists each of the 42 modules that run code outside their static imports with exactly the sites it has, so a new site, a removed one, or a stale entry fails. The doc reader's headers now say what the guard enforces instead of claiming to be the only way a doc file runs.

* Read theme descriptors by their JSDoc, and keep bundled themes as cheap as main

Fixes for the round-1 findings in the typed theme descriptor and template
suffix work.

- Two template specs for one stem list twice and read as ambiguous again,
  as on main, and a core page keeps the released precedence (.template.*,
  then .doc.ts, before .doc.mjs). Nothing is dropped silently.
- The ThemeDoc check reads the JSDoc TypeScript reads for the default
  export: the last JSDoc before it, or a parenthesized cast. A @typedef or
  @import alias counts. A line comment, a string, or a comment after the
  export no longer does.
- A blank name, displayName, or description fails with its field named.
  __proto__ fails like any unknown key. A BigInt no longer reads as a string.
- Theme messages name the package and the file: a symlinked descriptor, a
  nested second descriptor, a name that does not match its folder.
- A dot-folder, or a folder with neither a descriptor nor a <name>Theme
  source, is not a theme. Discovery skips it and pack-check does not require
  it. A folder with a theme source and no descriptor still fails.
- theme add copies a bundled theme exactly as main did: its source files in
  main's order, without the CLI's descriptor. An integration theme still
  copies its whole directory, entry first.
- Bundled theme sources are checked by the bundle test, not on every run.
  The descriptor parser loads on the first read, and each read is kept for
  the process while the file's size and mtime hold. theme list goes from
  36% to 1% slower than main; the doc-loads guard lists the two lazy
  parser loads.
- The theme bundle generator and its check fail on a public theme package
  that has no descriptor, and name it.
- The integration guide says which released suffixes still load: a .doc.ts
  topic in an installed package is listed but cannot be read.

* Make every doctor integration Fix hold when followed

Each `Fix:` that `astryx doctor integration validate` prints now works when
followed as written, and a test follows it on a fixture and validates again.
Before, several led to a new error or pointed somewhere wrong:

- A theme descriptor at the package root was told to set `themes: './..'`,
  outside the package, and one in a top-level folder was told
  `themes: './'`, which reads every folder as a theme. Both now move the
  theme into themes/<slug>/.
- A component, topic or template fix never makes the package root a root.
  It never declares a folder that also holds another kind of doc, another
  root or an incomplete doc, and never swaps out a declared root that still
  holds contributions.
- A move takes the same-stem source along, asks for a missing one, and says
  how to separate the target root from any other root that also reads it.
- A component doc without its source names the real doc file (Foo.doc.ts)
  and never says to delete it. A doc of another type in the components root
  is told which root to change or where to move it.
- When the codemods root is the package root or holds another root, the
  manifest is never listed as a stray codemod and no folder is told to be
  renamed to a version; codemods get a folder of their own instead.
  Contribution metadata at the top of the codemods root is told where it
  belongs instead of being moved into a version folder.
- A hidden component doc no longer draws "add <Name>.doc.mjs" for a file
  that exists.
- An invalid codemod is named by its path inside the package.

The fix logic lives in foundation/integrations/contribution-fixes.mjs so the
component and codemod checks in foundation can use it; the static metadata
reader moved there with it. Messages that were already right are unchanged.

* Ask to rename a theme descriptor that is not a .doc.mjs file

Theme discovery reads only `.doc.mjs` descriptors, so a `sandTheme.doc.ts`
moved into themes/sand/ as its fix said still failed with "found 0". The fix
now also says to rename it. A theme source at the top of the codemods root is
recognized beside a descriptor of any doc suffix, not only `.doc.mjs`.

* Read a themes root the way theme discovery now does

Theme discovery skips dot-folders and folders with neither a descriptor nor a
<name>Theme source. The fix check for a would-be themes root now skips them
too, so a helper folder beside the themes no longer turns "set themes" into a
longer move. A folder that discovery reads as a theme but that is broken still
blocks it.

* Keep readers on the module's own doc, and never let a message break a read

Round-two testing found the edges where the reader copy still differed from
main: a doc nested thousands of levels deep overflowed the copy, and a Proxy
doc printed its target's text instead of the Proxy's. Component and hook reads
now return the module's own doc, exactly as main did.

A load error whose text held a malformed `file://` URL turned into "URI
malformed" when the diagnostic scrubbed its paths; scrubbing now leaves text it
cannot decode as it is. An error with an empty message no longer produces a
diagnostic its own bundle parser rejects. The bundle's header no longer claims
callers it does not have.

* Say the theme catalog shipped in 0.6.3, and hide README markers on the docsite

The changeset called the integration theme catalog canary-only, but 0.6.3
writes `themes/manifest.json`. It now says so, and what an integration that
still ships the catalog must do. The docsite's package page drops HTML
comments before rendering a README, as GitHub and npm do, so the generated
README's section markers no longer show as text. `integrationAddTheme` names
its own command, `integration add theme`.

* Lower every read afresh, as the readers always loaded

Readers shared one lowered view per file for the life of a process. A caller
that edited a `template()` result changed later reads, a doc's getters ran
once instead of on every read, and a failed translation rethrew one shared
error. Main loaded, parsed, and translated on every call, so each read now
does too; only the whole-project compile keeps its per-file memo. Node's
module cache still holds each file, so a read costs what it did on main.

* Keep the compiler's own error code out of the public error envelope

A topic value JSON cannot hold made `docs <topic> --json` report the compiler's internal `not_json` code instead of main's `ERR_UNKNOWN`, because the error carried it as `code`, which the envelope reads. The compiler now keeps its code under its own key. The component loader's header says what readers get now.

* Catch the obfuscation shapes worth catching, and say where the line is

A second pass at the guard found runners it could not see: a doc module
fetched from a `data:` URL, process.dlopen and process.execve, WebAssembly,
Function reached as a called `.constructor`, and eval or Function taken off
the global object by destructuring, through an alias, or with Reflect.get.
Each is one shape with one name, so each is now a site.

What is left out is now stated rather than implied: the scan claims every
ordinary way of running code, whatever the local names, and does not claim
that the rule cannot be evaded on purpose. A method name assembled at run
time still passes, and that is the documented boundary.

The self-test grows to 89 ways around the rule and 28 innocent snippets,
among them the shapes real code uses that these rules must not touch: a
constructor passed on or read for its name, process.cwd, {env} = process,
and WebAssembly.validate.

* Fill an existing theme folder, and keep junk and stray folders out of themes

Round-2 fixes for the typed theme descriptor work.

- `integration add theme` fills an existing folder again, as main did, and
  refuses only a file it would write.
- A theme's files leave out dot entries and files npm never publishes, at
  any depth (.DS_Store, ._*, .gitignore, .npmrc, *.orig, npm-debug.log,
  node_modules, CVS). pack-check no longer fails a correct package over them,
  theme add no longer copies them, and files beside the theme folders are no
  longer required.
- A blank description is accepted, as the released catalog accepted it.
- The ThemeDoc check finds tags the way TypeScript's JSDoc scanner does: a
  cast inside outer parentheses counts, and a code span no longer hides the
  real @type. {!T}, {?T}, {T=}, {(T)}, T | null, T | undefined, T & {},
  @Satisfies on a cast, @import {type ThemeDoc}, and typedef chains are
  accepted. @Satisfies on the export statement and `@import type {...}` are
  not, because TypeScript does not apply them.
- doctor integration validate warns about a folder under the themes root
  that looks like a theme but is not read as one, with a fix that holds: make
  it a theme, or rename it to a dot-folder. A folder another module imports
  is not flagged.
- The theme bundle generator runs when its path goes through a symlinked
  directory, and refuses a descriptor the CLI cannot read, naming the
  package.
- The integration guide says an installed package's component or topic
  .doc.ts cannot be read; it loads only when the package is linked from
  outside node_modules.

* Keep the doc-loads guard off the folders tests create and delete

The guard scans the whole package, so it could list a temporary __import_hint_integration_* folder that another test was deleting and fail at random. Every __* folder is test scaffolding, so the guard now skips it, and an import from one still counts as a site.

* Never let a doctor Fix move a contribution onto a taken name

Some `Fix:` lines from `astryx doctor integration validate` still broke
something when followed:

- A move into a root never checked the target. A theme slug the themes root
  already has, a topic name the docs root already has, or a component or
  template name its root already has led to a second descriptor, "both define
  the topic", or an overwritten file. The same holds when a fix first moves
  a root out of the components root and then moves a file into it. The fix now names what already holds
  the name and asks for a new slug or name.
- Moving a theme whose source imports a file outside its folder left that
  import pointing outside, which discovery rejects. The fix now names each
  such file to copy in and the import to change.
- A folder was offered as the components root while it held a `.tsx` no doc
  covers, which then drew a new warning. Such a folder, one that holds a name
  twice, or a theme that imports from outside it, is no longer offered as a
  root.
- "Add <Name>.doc.mjs" now also says how to stop another root that reads the
  components root from reading the new doc too.
- A file at the top of the codemods root that a theme there imports is told
  to move with that theme, not into a version folder as a codemod.

Messages that were already right are unchanged.

* Treat any thrown value as a failure, undefined included

The compiler recorded a failure by its value, so a doc whose check threw
`undefined` read as a pass: `integration pack --check` called a package ready
that main failed, and a translation that threw `undefined` printed English.
A failure is now a flag beside the value, for loads, checks, and
translations alike. Describing a thrown value never throws in its place, so a
reader rethrows what the doc threw, as main did.

* Scan every folder that can ship; skip only test scaffolding

Skipping every __* folder kept the guard off the temporary folders a test
deletes mid-scan, but it also stopped it reading code in a folder like
__generated__, which ships. The guard now skips __tests__, __fixtures__, and
folders tests create with mkdtemp, and scans the rest.

* Keep the compiler-boundary test off folders other tests delete

The test that keeps compiler functions out of api/ and clients/ walked every folder, so it could open a file in a temporary folder the import-hint test was deleting and fail with ENOENT. It now skips folders created with mkdtemp, as the doc-loads guard does.

* Convert the 0.6 theme catalog with a codemod, and call its removal breaking

0.6.3 shipped `integration add theme` writing a central themes/manifest.json
catalog, so dropping it breaks every integration package made with it. The
changeset is now [breaking], so the next release is a minor, and a codemod
staged for that release converts a package: `astryx upgrade --from 0.6.3
--path . --apply` writes each theme's typed descriptor from its catalog entry
and removes the catalog. It plans the whole package first and changes nothing
when an entry cannot convert. A themes root that still holds the catalog now
names that command.

It is the first core project codemod: it plans whole-file writes and deletions
under the package instead of rewriting the files it is handed, and the runner
applies or previews the plan as one unit. Integration codemods keep the file
contract. `integration add theme` and the codemod render descriptors through
one function, and a test holds a second theme to touching no shared file.

* List the Tree Table template main added in the doc route inventory

Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55.

* Record the per-item descriptor rule this change follows (AST-039)

The catalog question is decided (no central item catalog in any form), so the
spec comes back from its separate PR and ships with the code it describes. Adds
the AST-039 draft record, INV24 in the CLI architecture, the typed-doc and
no-catalog rules in the CLI conventions, and a pointer in AGENTS.md. FR11
forbids a catalog file under a root, a per-item map or list in the integration
manifest, and a hand-synced registry, for every kind; DEC-4 records why and
supersedes AST-035 DEC-1.

* Keep the CLI README as main has it, plus a pointer to the CLI's own docs

The README is the entry point for agents, so it stays short. This drops the
generated command reference and API function list this branch had added, with
their generator code and tests, and goes back to main's generator and its three
tables. A new hand-written section names the command that prints each kind of
CLI doc: --help, manifest --json, docs authoring, docs cli-integrations, and
docs. The only other change from main is the generated ERR_THEME_INVALID row,
which follows the theme descriptor change.

* Fail doctor when a CLI doc has no namespace, or one no topic reads

Every command, API function, schema, and enum doc the CLI ships has a
`namespace` field, and nothing read it. A new doctor check, CLI docs, loads
them through the compiler and fails when one has no namespace, names one no
`astryx docs` topic reads (cli/commands and cli/api go to `astryx docs cli`,
authoring to `astryx docs authoring`), or disagrees with the authoring topic's
list. INV25 in the CLI architecture records the rule.

On this commit the check fails on this repo on purpose, with 83 findings: the
41 API function docs have no namespace, and 42 docs name "cli", which no topic
reads (34 commands, 5 authoring schemas, 2 enums, the output schema). The
tests record them; the next commit fixes them and adds the reader.

* Give every CLI doc a namespace, and read the cli ones with astryx docs cli

Each command doc now declares cli/commands and each API function doc, enum,
and the output schema cli/api; the five schemas `astryx docs authoring` reads
declare authoring. The new `astryx docs cli` topic is built from the cli/...
docs like the authoring topic is from its self-docs: one section per doc,
keyed commands-<name> and api-<name>, with usage, options, parameters,
returns, throws, examples, and links between a command and the function it
runs. The doctor check now passes: all 95 CLI docs are readable, 78 in
`astryx docs cli` and 17 in `astryx docs authoring`.

The route inventory lists the topic and its 78 sections under the cli
namespace. The docsite does not publish the topic yet, because /docs/cli is
the @astryxdesign/cli package page. The README points to the topic, and the
namespace field's docs say what it now does.

* Keep main's latest README and tests working on this branch

Main moved 70 commits while this PR was open. The CLI README keeps main's
new text (apiVersion, --verbose) under the pointer section. Main's new
theme-add binary test now installs a typed descriptor instead of the 0.6
catalog, and its integration-add controls test reads the template's own doc.
The load guard lists the three places main now runs code outside its static
imports (the manifest command doc, twice, and @babel/parser), and the golden
component read shows main's plain "-" for an empty default.

---------

Co-authored-by: Joey Farina <[email protected]>
@github-actions
github-actions Bot deleted the template-table-tree branch September 25, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — fddd5b27 Deployed Sep 23, 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