Repository navigation
fix(templates): order detail, work item detail and component docs read correctly with no script - #12012
Conversation
…d correctly with no script
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approval waits on an engineering owner's decision, and four fixes are needed either way.
No current spec governs how detail-page, work-item-detail and documentation-design paint with no script or on narrow screens. An engineering owner needs to decide whether these templates paint the narrow one-column layout first at every width, show the order and work item details after the main column instead of in a full-screen dialog, use section links instead of the picker on documentation-design, and keep the no-script check holding all three, accepting that desktop readers of a server-rendered app see the layout move to the side rail on hydration. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, or by naming the record that governs it; the author may do so as an engineering owner.
Required fixes:
- Add a
CI impact:line to the description for thenode-browser-contractsstep, since the pull request changes a CI script. - Give the inlined details a heading of their own (for example "Order details" and "Task details" at level 2), because in
detail-page/page.tsx:647the Notes, Customer and Fraud Analysis headings follow Timeline at level 4 and inwork-item-detail/page.tsx:898-903Details, Watchers and Linked items read as part of Comments and activity. - Correct the impact table's "(customer, notes, timeline)", because the moved order details are notes, customer and fraud analysis and the timeline was already in the main column.
- Correct "each page root is now
Layoutinstead of a fragment", because that holds fordetail-pageandwork-item-detailwhiledocumentation-designwas already rooted inLayout.
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
Claims:
- Title: the three templates read correctly with no script: verified (no-script test red on the base, green on the head).
- Changeset: narrow first paint at every width, the side rail on wide screens once script runs, details after the main column on narrow screens, section links instead of a picker: verified (
detail-page/page.tsx:621,:647;work-item-detail/page.tsx:861,:898-903;documentation-design/page.tsx:506,:583). - Before, with no script at 390 px, a 320, 340 or 163 px rail sat beside the page and the work item page was 413 px wide: verified (static render of the base).
- After, one 390 px column with no side region and working section links: verified (static render of the head and the no-script test).
- The order details that move are customer, notes and timeline: false (the panel is notes, customer and fraud analysis,
detail-page/page.tsx:561-604; the timeline is in the main column at:644). - The work item details (assignee, dates, labels, linked items) follow the main column: verified (
work-item-detail/page.tsx:749-845,:898-903). - With script on a desktop the three templates are unchanged after hydration: consistent with the hook (
useMediaQuery.ts:73-89); pixel identity not reproduced. - On narrow screens with script, details follow the main column instead of a dialog, and the panel toggle and "Show details" button show only where the rail exists: verified (
detail-page/page.tsx:281;work-item-detail/page.tsx:406). - Section links stay on top as links, as in
documentation-technical: verified (documentation-technical/page.tsx:49,:81). - Each template now passes the hook's server default
true: verified. - Core's
Layouthas no CSS-only panel fold at a breakpoint: consistent (it sets only a container type). - Removed: the narrow-screen dialogs and their state, the info icon and its doc entry, the outline picker and its scroll handler; no style or doc text change: verified (diff).
- Server-rendered desktops shift on hydration, client-rendered apps do not: consistent with the hook; not measured.
- The no-script check covers three more templates, fails for all three on the base and passes for all five on the head: verified.
- No console errors at 390 px with touch: not checked.
- The phone fit check passes: verified.
- The raw-tag count change on
documentation-designis a removed type argument: verified (no raw JSX tags on either side). - Each page root is now
Layoutinstead of a fragment: false fordocumentation-design. - Build replay start moves: not checkable from the repository.
- Public text carries no internal context: verified.
- Template and build tests pass: verified (78 files, 488 tests on the head).
Files:
.changeset/content-templates-noscript.md: clear..github/scripts/template-noscript-first-paint.browser.test.mjs: clear (the description needs its CI impact line).packages/cli/assets/templates/pages/detail-page/page.tsx: finding (inline details heading).packages/cli/assets/templates/pages/documentation-design/page.tsx: clear.packages/cli/assets/templates/pages/work-item-detail/page.tsx: finding (inline details heading).packages/cli/assets/templates/pages/work-item-detail/template.doc.mjs: clear.
…ing on narrow screens
|
/approve-spec 8fe79ec |
There was a problem hiding this comment.
Approved pending CI: CI's main workflow did not run on this head because the CI ceiling was full, so re-run all jobs (or push again) to get its checks.
The owner decision recorded on this head settles the narrow-first layout for these three templates, and the earlier fixes are in: the CI impact: line, a heading for the inlined order and task details, and the two description corrections. One optional suggestion: in detail-page, give the Notes, Customer and Fraud Analysis trigger headings accessibilityLevel={3}, so the outline under "Order details" does not skip a level.
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
Claims:
- Title: the three templates read correctly with no script: verified (the no-script test fails on the base for all three and passes on the head).
- Changeset: narrow first paint at every width, the side rail on wide screens once script runs, details after the main column on narrow screens, section links instead of a picker: verified (
detail-page/page.tsx:621,:647-652;work-item-detail/page.tsx:861,:898-904;documentation-design/page.tsx:506,:583). - Before, with no script at 390 px, a 320, 340 or 163 px rail sat beside the page and the work item page was 413 px wide: verified (static render of the base).
- After, one column; the order details (notes, customer, fraud analysis) under "Order details", the work item details (assignee, dates, labels, linked items) under "Task details", and the section links on top: verified (static render of the head;
detail-page/page.tsx:561-604,:649;work-item-detail/page.tsx:749-845,:901). - With script on a desktop the three templates are unchanged after hydration, pixel-identical at 1280 px: consistent with the code (the wide branch renders the base's wide tree); pixel identity not reproduced.
- On narrow screens with script the details follow the main column instead of a dialog, which a static copy cannot open: verified (the base's static render holds them in a closed dialog).
- The panel toggle and "Show details" button show only where the rail exists: verified (
detail-page/page.tsx:281;work-item-detail/page.tsx:406). - Section links stay on top as links, as in
documentation-technical: verified (documentation-design/page.tsx:583;documentation-technical/page.tsx:81). - Each template read the hook's server answer
falseand now passestrue: verified (useMediaQuery.ts:73). - The server render and a static copy paint narrow first, wide screens switch once script runs, client-rendered apps see no shift: verified from the hook's server and client snapshots.
- Core's
Layouthas no CSS-only panel fold at a breakpoint: consistent (it sets only a container type). - Removed: the narrow-screen dialogs and their state, the info icon and its doc entry, the outline picker and its scroll handler; no style, StyleX or doc text change: verified (diff).
course-detailandproduct-detailare unchanged and their collapsed sections need script: verified (defaultIsOpen={false}in both; neither file changes).- The no-script check covers three more templates, fails for all three on main and passes for all five: verified.
- CI impact: the step runs in
node-browser-contractson a standard runner and now checks five templates: verified (ci.yml:1403,:1489); the added seconds and the job-minute, runner-pool and concurrency figures: not reproduced (they cite CI's own analysis); time to green is stated as not measured. - The job runs in parallel: consistent (only the final status join waits on it).
- With script on a phone the details sit at the bottom and the section links on top: verified (narrow branch).
- No console errors at 390 px with touch: partly verified (the phone fit check renders each template in a built app at 390 px with touch and a mouse with no uncaught page error; console messages were not read).
- The phone fit check passes: verified (every ready page template at 390 px, touch and mouse, on the head).
- Rubric inputs: raw tags 1 to 0 on
documentation-designfrom a removed type argument, and thedetail-pageandwork-item-detailroots are nowLayout: verified (no raw JSX tags on either side). - Build start lists lose
DialogandSelector: verified (the lists come from each template's JSX); the replay start moves: not checkable from the repository. - Public text carries no internal context: verified.
- Formatting, lint and strict type checks are clean: lint verified (CI's Lint run passed on the head); the type check did not run in CI on this head.
- Template, golden-read and icon-declaration tests pass: verified (66 files, 291 tests on the head).
Files:
.changeset/content-templates-noscript.md: clear..github/scripts/template-noscript-first-paint.browser.test.mjs: clear.packages/cli/assets/templates/pages/detail-page/page.tsx: non-blocking note (heading level 3 skipped under "Order details").packages/cli/assets/templates/pages/documentation-design/page.tsx: clear.packages/cli/assets/templates/pages/work-item-detail/page.tsx: clear.packages/cli/assets/templates/pages/work-item-detail/template.doc.mjs: clear.
| {isNarrow && ( | ||
| <VStack gap={4}> | ||
| <Heading level={2}>Order details</Heading> | ||
| <PanelContent /> |
There was a problem hiding this comment.
Non-blocking: under this "Order details" heading (h2), the Notes, Customer and Fraud Analysis trigger headings in PanelContent (lines 564, 574 and 587) are h4, so the outline skips level 3. Giving them accessibilityLevel={3}, as work-item-detail does for its level-4 heading, keeps the outline people copy in order.
User impact
astryx buildstarts a shared record or reference page from these templates. A shared static copy runs no script, and three templates painted their desktop layout at every width: a side rail sat beside the page and squeezed it into a narrow column on a phone.detail-page(order detail)work-item-detaildocumentation-designWith script on a desktop, all three are unchanged: after hydration they are pixel-identical to main at 1280 px.
Narrow screens with script also change. On
detail-pageandwork-item-detail, the details now follow the main column instead of opening in a full-screen dialog behind a button. A static copy cannot open a dialog, so the dialog left that content unreachable without script. The panel toggle and the "Show details" button are shown only where the rail exists. Ondocumentation-design, the section links stay on top as links instead of a picker, the same asdocumentation-technical.Problem and solution fit
Each template read
useMediaQuery(...), whose server answer (false) is the desktop layout. Each now passes the hook's own server default,useMediaQuery(query, true). The server render and a static copy are mobile first, and wide screens switch to the rail once script runs. Core'sLayouthas no CSS-only way to fold a panel at a breakpoint, so the server answer decides the first paint.Removed with the change: the narrow-screen
Dialogs and their open state indetail-pageandwork-item-detail, the unused info icon (also removed from the doc's icon list), and the outlineSelectorand its scroll handler indocumentation-design. No styles, no StyleX and no doc text change.Tradeoff: in a server-rendered app (for example Next), a desktop reader's first paint is the narrow layout, and hydration then moves to the rail layout. Client-rendered apps see no shift. A CSS-driven collapse for
Layoutpanels in Core would remove the tradeoff.Not changed: on
course-detailandproduct-detail, module lessons, FAQ answers and product details sit in collapsed sections that a static copy cannot open. Core'sCollapsibleneeds script to open, so that fix belongs in Core.The no-script check
.github/scripts/template-noscript-first-paint.browser.test.mjsnow also coversdocumentation-design,detail-pageandwork-item-detail. On main it fails for all three: a side region beside the sections on a phone, and forwork-item-detaila page 413 px wide. With this change it passes for all five templates.CI impact: the existing "Template no-script first paint browser case" step in
node-browser-contracts(standard runner) now checks five templates instead of two, which adds about 10 s to that step. CI's pull-request analysis reports 180 job-minutes per update before and after (0), 67,168 runner-minutes a day before and after (0%), 46.6 average concurrent jobs before and after (0), and time to green not yet measured. The job runs in parallel and is not on the critical path.Evidence
work-item-detail); after, one column, 390 px wide, with no side region and working section links.detail-pageandwork-item-detail, and the section links sit on top ondocumentation-design.documentation-design(the removed state's type argument); otherwise unchanged; thedetail-pageandwork-item-detailroots are nowLayoutinstead of a fragment.astryx build(build replay sets, real and synthetic requests): the templates' component lists loseDialogandSelector, so a request that names a dialog now leans harder toward the dialog templates that still list it. Build ranks rarer components as stronger evidence, by design. On the training set two starts change. One request whose expected page is a settings page now starts at the settings dialog template (right to wrong), and one app-shell request moves from the order detail template to another wrong start; net one fewer right start. On the held-out set two wrong starts change to other wrong starts (net zero); on fresh requests nothing changes. Freezing the lists by keeping unused imports would hide the change, so the lists stay truthful.Scope
Components: cli (page templates), CI test
Testing
ASTRYX_TEMPLATE_NOSCRIPT_BROWSER=1 vitest run .github/scripts/template-noscript-first-paint.browser.test.mjs: 5 of 5 pass, and 3 fail on main as above.vitest run --project node packages/cli/api/template packages/cli/test/golden-reads.test.mjs packages/cli/test/template-icon-declarations.test.mjs: pass, except the two locale-example tests that also fail on main.