Repository navigation
Component docs: playground.mobile for a phone-width render (AppShell's mobile layout) - #12477
Conversation
…th render; AppShell declares its mobile layout there
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| AppShell · Storybook | 98.8 kB (0) · 14.4 kB CSS (0) | 1,173 (0) | ✗ · ✓ · ✓ |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
Inheritance checked against the 5 newest reports of other pull requests.
Package size:
- @astryxdesign/cli 5.38 MB packed (+536 B); no new dependencies
- @astryxdesign/core 7.65 MB packed (+177 B); no new dependencies
API changes: cli +1 · ~0 · −0
1 API change (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./authoring · Types · interface ComponentPlaygroundConfig |
mobile?: Record<string, unknown> |
import type {ComponentPlaygroundConfig} from '@astryxdesign/cli/authoring'; const x: ComponentPlaygroundConfig = {mobile: …} |
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: ComponentPlaygroundConfig.phone is a new field on the published @astryxdesign/cli/authoring type, and no current spec decides the playground config fields or the field's name (phone, or the "mobile" wording that appShellMobile and defaultIsMobile already use). An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so.
These need changes whatever the decision:
- The changeset, the field's JSDoc, the component doc type's
playgrounddescription and AppShell's doc comment say the theme editor's part census rendersphone, but the census never reads it (packages/cli/api/theme-edit/_project.mjscopies onlydefaults,wrapperandoverlay), so either ship the reader with a test here or drop the census claim from all four places. ComponentPlaygroundConfig.phoneis a public API row outside this pull request's declared scope (the title has no conventional-commit scope and the body no## Scopesection), so name it under## ScopewithComponents: ComponentPlaygroundConfig.
Non-blocking: the JSDoc says values are primitives or ElementDescriptors, but its own example is a plain config object.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim:
playground.phonedeclares a phone-viewport render's props, merged overdefaults: verified as a declaration (packages/cli/authoring/doctypes/base/type.ts:322-334); no code merges or renders it yet. - Claim: the theme editor's part census renders it: false; the census copies only
defaults,wrapperandoverlay(packages/cli/api/theme-edit/_project.mjs:237-245). - Claim: AppShell declares its mobile layout there: verified (
packages/core/src/AppShell/AppShell.doc.mjs:189). - Claim: AppShell's playground defaults are unchanged: verified (the diff adds only
phone; the new test checks it). - Claim: AppShell's mobile layout renders only when it reports a phone breakpoint, so server-side renders miss it: verified (
AppShell.tsx:639-642,useMediaQuery.ts:87). - Claim: the census misses those parts: verified (
_parts.mjs:188-193renders fromdefaults). - Claim: the component doc type's
playgrounddescription namesphone: verified (component.doc.mjs:190). - Claim: the new test covers the type, the doc-type text, AppShell's value and its unchanged defaults, and passes: verified (2 of 2 pass).
- Claim:
typecheck:authoringand Prettier pass: verified. - Claim: the census reader ships separately: not in this repository at this head, which matches the missing reader.
- Claim: no spec record changes: verified.
- File
.changeset/cli-playground-phone.md: false census claim. - File
packages/cli/authoring/doctypes/base/type.ts: new field awaiting an owner decision; false census claim and the values sentence in its JSDoc. - File
packages/cli/authoring/doctypes/component/component.doc.mjs: false census claim. - File
packages/cli/authoring/doctypes/component/playground-phone.test.mjs: clear. - File
packages/core/src/AppShell/AppShell.doc.mjs: declared props fit AppShell's contract; its comment repeats the census claim.
|
Owner decision (engineering owner, covering this pull request): the authoring type's playground config gains an optional, additive |
|
/approve-spec f0dbc71 |
… one line in cli-surface INV7
|
/approve-spec 0a7902d |
There was a problem hiding this comment.
Changes requested: two fixes, both small. The field's direction is settled, since the new CLI surface sentence carries an engineering owner's /approve-spec for this head.
DOCS_VERSIONinpackages/cli/api/theme-edit/_project.mjsstays 8 although the cached component docs now carrymobile, so a project whose editor cache an earlier CLI wrote for the same Core keeps entries without it and the census never renders AppShell's mobile layout; bump it to 9, as thedescription, propdefaultandvarsfields did.- The description says the component doc type's
playgrounddescription namesphone, butcomponent.doc.mjsnamesmobile; update that bullet.
Non-blocking: the new INV7 sentence says "the tools that render docs read it", which is true only of the theme editor's census today; the JSDoc's "Values are primitives or ElementDescriptors" leaves out the plain config object its own example uses; and ## Writing rubric results would be complete with one line per rubric item (R1–R7), all of which find nothing in the added sentence.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: AppShell's mobile layout renders only at a phone breakpoint, so server-side doc renders miss it: verified (
AppShell.tsx:639-642,useMediaQuery.ts:73-84). - Claim: the census missed those parts, so a theme could not reach them: verified; with the new item TopNav's mobile-bar mode and the open drawer's paint enter the census.
- Claim:
playground.mobileis an optional field holding a phone render's props, merged overdefaults: verified (type.ts:322-334). - Claim: AppShell declares its mobile layout and its playground defaults are unchanged: verified (
AppShell.doc.mjs:189,playground-mobile.test.mjs). - Claim: the authoring typecheck passes: verified.
- Claim: the component doc type's
playgrounddescription namesphone: false; it namesmobile(component.doc.mjs:190). - Claim: the tests cover the type, the doc-type text, AppShell's value and its unchanged defaults: verified.
- Claim: the editor reads
mobileand its catalog renders it over the demo as one more census item, so the mobile-only parts are recorded: verified on a fresh editor cache; not where an earlier CLI's cache for the same Core is reused (_project.mjs:82). - Claim: the CLI surface record gains one sentence naming the field: verified (
cli-surface.md:169-171). - Claim: the test plan's four tests, the typecheck and Prettier pass: verified.
- Claim: the scope names
ComponentPlaygroundConfig: verified. - Release note: the field holds a second render's props merged over
defaults, the census renders it, AppShell declares its mobile layout, its defaults are unchanged: verified, with the cache caveat above. - Writing rubric results: one sentence instead of the seven item lines (non-blocking).
- File
.changeset/cli-playground-mobile.md: clear. - File
docs/architecture/cli-surface.md: owner-approved sentence; "the tools that render docs" is broader than the code (non-blocking). - File
packages/cli/api/theme-edit/_parts.mjs: clear. - File
packages/cli/api/theme-edit/_project.mjs:DOCS_VERSIONnot bumped (blocking). - File
packages/cli/api/theme-edit/theme-census-mobile-layout.test.mjs: clear; it checks the catalog, not the census (non-blocking). - File
packages/cli/authoring/doctypes/base/type.ts: values sentence (non-blocking). - File
packages/cli/authoring/doctypes/component/component.doc.mjs: clear. - File
packages/cli/authoring/doctypes/component/playground-mobile.test.mjs: clear. - File
packages/core/src/AppShell/AppShell.doc.mjs: clear.
…NV7 and the field's JSDoc say what reads it and what it holds
|
/approve-spec f061053 |
There was a problem hiding this comment.
Changes requested: one fix. The playground.mobile field, the census reader and AppShell's declaration match the INV7 sentence an engineering owner approved for this head, and the earlier cache-version and wording points are fixed.
- The last commit deletes two current passages from
docs/architecture/cli-surface.md(the bullet saying a hosted render outside a project takes the packages its root'spackage.jsonlists, with the matching clause of the enumeration bullet, and thefoundation/render/client-bundle.mjsline in Owning code), so the record now contradictsspec:AST-081FR3 and the shipped code; restore them exactly as onmain, keeping only the new INV7 sentence.
Once they are restored, the description's "one line in INV7" holds as written.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: AppShell's phone layout renders only at a phone breakpoint, so server-side doc tools never see it: verified (
AppShell.tsx:638-642,useMediaQuery.ts:73-89). - Claim:
playground.mobileis an optional field holding phone-render props merged overdefaults: verified (type.ts:322-334,_parts.mjs:470). - Claim: AppShell declares
mobile: {mobileNav: {defaultIsMobile: true, isOpen: true}}and its playground defaults are unchanged: verified (AppShell.doc.mjs:189,playground-mobile.test.mjs). - Claim: the authoring type documents the field with an example and the authoring typecheck passes: verified (
type.ts:322-334;typecheck:authoringpasses). - Claim: the component doc type's
playgrounddescription namesmobile: verified (component.doc.mjs:190). - Claim: the tests cover the type, the description, AppShell's declaration and its unchanged defaults: verified (
playground-mobile.test.mjs). - Claim: the theme editor reads
mobileand renders it over the demo as one more census item: verified (_project.mjs:239-244,_parts.mjs:459-472,theme-census-mobile-layout.test.mjs). - Claim: the CLI surface record changes by one INV7 line naming the field: false (the file also loses base lines 675-682 and 782).
- Claim: test plan (4 tests pass, authoring typecheck, prettier): verified (all pass at this head).
- Claim: scope names
ComponentPlaygroundConfigonly: verified (the only public API row). - Claim: writing rubric over the one added INV7 sentence: incomplete (it does not cover the deleted passages).
- Changeset: the field holds phone-render props merged over defaults, the census renders it, AppShell declares its mobile layout with unchanged defaults: verified (same evidence; the patch
[feat]entry passes the changeset check). - File
.changeset/cli-playground-mobile.md: clear. - File
docs/architecture/cli-surface.md: finding (deleted passages). - File
packages/cli/api/theme-edit/_parts.mjs: clear. - File
packages/cli/api/theme-edit/_project.mjs: clear. - File
packages/cli/api/theme-edit/theme-census-mobile-layout.test.mjs: clear (non-blocking: it asserts the catalog item, not the census output). - File
packages/cli/authoring/doctypes/base/type.ts: clear. - File
packages/cli/authoring/doctypes/component/component.doc.mjs: clear. - File
packages/cli/authoring/doctypes/component/playground-mobile.test.mjs: clear. - File
packages/core/src/AppShell/AppShell.doc.mjs: clear.
… the playground.mobile sentence
|
/approve-spec cbd7a1d |
There was a problem hiding this comment.
Approved pending CI: the CI run on this head found no room under the CI ceiling and was cancelled, so its required checks have not run yet; re-run CI before this merges.
The playground.mobile field, the census reader and AppShell's declaration match the INV7 sentence an engineering owner approved for this head, and the two cli-surface passages from the last round are restored exactly as on main. One optional suggestion is inline: the field's JSDoc could say that the census renders on the server with no viewport, so the props select the phone layout themselves, as defaultIsMobile does.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: AppShell's phone layout renders only when it reports a phone breakpoint, so server-side doc tools never saw it: verified (
AppShell.tsx:638-645,useMediaQuery.ts:73-89). - Claim: the census missed what that layout draws: verified with one nuance; the drawer and top nav were already recorded from their own entries, while TopNav's mobile-bar paint, the menu button and the drawer's contents inside AppShell were not (census built with and without the new item).
- Claim:
playground.mobileis an optional field holding the phone render's props, merged overdefaults: verified (type.ts:322-334,_parts.mjs:470); the merge is one level deep. - Claim: AppShell declares
mobile: {mobileNav: {defaultIsMobile: true, isOpen: true}}and its playground defaults are unchanged: verified (AppShell.doc.mjs:189,playground-mobile.test.mjs). - Claim: the authoring type documents the field with an example and
typecheck:authoringpasses: verified (type.ts:322-334; the typecheck exits 0). - Claim: the component doc type's
playgrounddescription namesmobile: verified (component.doc.mjs:190). - Claim: the tests cover the contract, the doc type text, AppShell's declaration and its unchanged defaults: verified (
playground-mobile.test.mjs, 2 tests pass). - Claim:
_project.mjsreadsmobileand_parts.mjsrenders it over the demo as one more census item: verified (_project.mjs:239-244,_parts.mjs:462-472,theme-census-mobile-layout.test.mjs, 2 tests pass). - Claim:
cli-surfaceINV7 gains one sentence naming the field: verified (cli-surface.md:169-172; the rest of the record equalsmain). - Claim: test plan (4 tests,
typecheck:authoring, prettier): verified (4 pass; typecheck exits 0; prettier reports no change). - Claim: the writing rubric results for the INV7 sentence: verified (present tense, no pull request, history or status text).
- Changeset: a patch for the CLI and Core adding
playground.mobile, rendered by the census, with AppShell's mobile layout declared and its defaults unchanged: verified (as above). - File
.changeset/cli-playground-mobile.md: clear. - File
docs/architecture/cli-surface.md: clear. - File
packages/cli/api/theme-edit/_parts.mjs: clear. - File
packages/cli/api/theme-edit/_project.mjs: clear. - File
packages/cli/api/theme-edit/theme-census-mobile-layout.test.mjs: clear. - File
packages/cli/authoring/doctypes/base/type.ts: one non-blocking wording suggestion (inline). - File
packages/cli/authoring/doctypes/component/component.doc.mjs: clear. - File
packages/cli/authoring/doctypes/component/playground-mobile.test.mjs: clear. - File
packages/core/src/AppShell/AppShell.doc.mjs: clear.
| * drawer open state interactive, and notes the simulation under the | ||
| * rendered component (#4983). */ | ||
| appShellMobile?: boolean; | ||
| /** Props merged over `defaults` for a second render at a phone viewport |
There was a problem hiding this comment.
Non-blocking: the census, the only reader, renders this on the server with no viewport, so the phone layout appears only because these props select it (defaultIsMobile: true becomes useMediaQuery's server answer). A doc author whose component switches layout in script could declare props that rely on the viewport and get a desktop render. Consider adding: "The census renders it on the server, with no viewport, so these props select the phone layout themselves, as defaultIsMobile does."
…inks, so the census draws them in their menu placement
|
/approve-spec 1797c8b |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
playground.mobile, the census reader and AppShell's phone-layout props match the CLI surface sentence an engineering owner approved for this head. The two TopNav links added to AppShell's props render as rows in the phone menu, so the theme editor now flags a light link on a dark top bar there and offers a fix that paints the menu; every earlier fix still holds.
- Non-blocking: the field's JSDoc (
packages/cli/authoring/doctypes/base/type.ts:322) promises "a second render at a phone viewport", but the census renders on the server with no viewport, so the props must select the phone layout themselves, asdefaultIsMobiledoes; one sentence saying so keeps doc authors from relying on the viewport.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: AppShell's phone layout renders only when it reports a phone breakpoint, so a server render never sees it: verified (
AppShell.tsx:638-645). - Claim: the theme editor's census missed those parts: verified in substance; the part names existed, but what they draw in the phone layout was missing (census with and without the field).
- Claim:
playground.mobileis an optional field holding the props of a second render, merged overdefaults: verified (type.ts:322-334,_parts.mjs:470; the merge is one level deep). - Claim: AppShell declares
mobileNav: {defaultIsMobile: true, isOpen: true}and its playground defaults are unchanged: verified (AppShell.doc.mjs:191,playground-mobile.test.mjs). - Claim: the authoring type documents the field with an example and the authoring typecheck passes: verified (
type.ts:322-333;typecheck:authoringexits 0). - Claim: the component doc type's
playgrounddescription namesmobile: verified (component.doc.mjs:190). - Claim: tests cover the contract, the doc type, AppShell's declaration and its unchanged defaults: verified (
playground-mobile.test.mjs). - Claim: the editor reads
mobileand its catalog renders it as one more census item: verified (_project.mjs:239-244,_parts.mjs:459-472,theme-census-mobile-layout.test.mjs). - Claim: the CLI surface record gains one sentence naming the field: verified (
cli-surface.md:169-172, the only change againstmain). - Claim: test plan (the two test files, 4 tests; the authoring typecheck; prettier): verified, all pass on this head.
- Claim: the scope is
ComponentPlaygroundConfig's new optional field: verified (the only public API change). - Claim: AppShell's mobile props give TopNav two links that the open phone menu draws as drawer rows, and the census sees them there: verified (
AppShell.doc.mjs:193-206,TopNav.tsx:291-313,TopNavItem.tsx:281-306; the census recordstop-nav-itemin drawer mode). - Claim: the theme editor uses that placement to keep a link colored for a dark top bar readable in the menu: verified (a dark top bar with light links lists the menu link at 1:1 with a fix that paints the menu; the base lists nothing for it).
- Claim: the writing rubric over the added record sentence finds no narration, history, status or open question: verified.
- Changeset: patch bumps for the CLI and Core: consistent with an additive optional type field and doc data.
- Changeset: the field holds the props of a second render at a phone viewport, merged over
defaults, and the census renders it: verified, with the non-blocking viewport note above. - Changeset: AppShell declares its mobile layout (menu button, open drawer) and its playground defaults are unchanged: verified.
- File
.changeset/cli-playground-mobile.md: clear. - File
docs/architecture/cli-surface.md: clear. - File
packages/cli/api/theme-edit/_parts.mjs: clear. - File
packages/cli/api/theme-edit/_project.mjs: clear. - File
packages/cli/api/theme-edit/theme-census-mobile-layout.test.mjs: clear. - File
packages/cli/authoring/doctypes/base/type.ts: non-blocking JSDoc note. - File
packages/cli/authoring/doctypes/component/component.doc.mjs: clear. - File
packages/cli/authoring/doctypes/component/playground-mobile.test.mjs: clear. - File
packages/core/src/AppShell/AppShell.doc.mjs: clear.






A component whose layout changes at phone width had no way to say what that layout is in its doc. AppShell's mobile layout (the menu button in the top bar, the open drawer) only renders when AppShell reports a phone breakpoint, so tools that render docs server-side never see it; the theme editor's part census, which records what each part draws, misses those parts, and a theme cannot reach them by role.
playground.mobileis an optional doc-type field: the props of a second render at a phone viewport, merged overdefaults. AppShell declaresmobile: {mobileNav: {defaultIsMobile: true, isOpen: true}}; its playgrounddefaults(what the docsite playground shows) are unchanged.packages/cli/authoring/doctypes/base/type.ts:ComponentPlaygroundConfig.mobile?: Record<string, unknown>, documented with an example (authoring contract;typecheck:authoringpasses).component.doc.mjs(the component doc type's own doc): theplaygrounddescription namesmobile.AppShell.doc.mjs: declares its phone layout.Test: the contract types it, the doc type describes it, AppShell declares it and its defaults stay as they were.
api/theme-edit/_project.mjsreadsmobile, and_parts.mjs's catalog renders it over the demo as one more census item, so the parts only the mobile layout draws are recorded.docs/architecture/cli-surface.mdINV7: one line naming the field.Test plan:
vitest playground-mobile.test.mjs theme-census-mobile-layout.test.mjs(4 pass),pnpm -F @astryxdesign/cli typecheck:authoring, prettier.Scope
ComponentPlaygroundConfig(new optional fieldmobile).Phone menu links
AppShell's
playground.mobilealso gives its TopNav two links, so the open phone menu draws them as its own rows (TopNavItem'smode=drawer) and the census sees that placement; the theme editor uses it to keep a link colored for a dark top bar readable in the menu.Writing rubric results
Record rubric over the one sentence added to
cli-surfaceINV7: