Skip to content

fix(templates): order detail, work item detail and component docs read correctly with no script - #12012

Merged
josephfarina merged 3 commits into
mainfrom
josephfarina/content-templates-noscript
Nov 16, 2026
Merged

josephfarina merged 3 commits into
mainfrom
josephfarina/content-templates-noscript

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

User impact

astryx build starts 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.

Template No script, 390 px, before After
detail-page (order detail) A 320 px side rail beside the order; the main column a sliver One column; the order details (notes, customer and fraud analysis) follow the main column under an "Order details" heading
work-item-detail A 340 px property rail beside the work item; the page 413 px wide One column; the details (assignee, dates, labels, linked items) follow the main column under a "Task details" heading
documentation-design A 163 px "On this page" rail beside the article One column with the section links on top

With 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-page and work-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. On documentation-design, the section links stay on top as links instead of a picker, the same as documentation-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's Layout has 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 in detail-page and work-item-detail, the unused info icon (also removed from the doc's icon list), and the outline Selector and its scroll handler in documentation-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 Layout panels in Core would remove the tradeoff.

Not changed: on course-detail and product-detail, module lessons, FAQ answers and product details sit in collapsed sections that a static copy cannot open. Core's Collapsible needs script to open, so that fix belongs in Core.

The no-script check

.github/scripts/template-noscript-first-paint.browser.test.mjs now also covers documentation-design, detail-page and work-item-detail. On main it fails for all three: a side region beside the sections on a phone, and for work-item-detail a 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

  • No script, 390 px: before, a side region beside the page on all three (and 413 px wide on work-item-detail); after, one column, 390 px wide, with no side region and working section links.
  • Script, phone: after, the details sit at the bottom of the page on detail-page and work-item-detail, and the section links sit on top on documentation-design.
  • Script, 1280 px: pixel-identical before and after for all three (same md5).
  • No console errors at 390 px with touch. The phone fit check (every ready page template at 390 px, touch and mouse) passes.
  • Template rubric inputs: raw tags 1 -> 0 on documentation-design (the removed state's type argument); otherwise unchanged; the detail-page and work-item-detail roots are now Layout instead of a fragment.
  • astryx build (build replay sets, real and synthetic requests): the templates' component lists lose Dialog and Selector, 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

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • prettier, eslint and a strict TypeScript check on each template: clean.
  • 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.

@vercel

vercel Bot commented Nov 16, 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 Nov 16, 2026 9:40am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 16, 2026, 9:54 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 8fe79ec

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 pull request needs a maintainer check before review continues.

Automated review (maintainer link)

@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.

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 the node-browser-contracts step, 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:647 the Notes, Customer and Fraud Analysis headings follow Timeline at level 4 and in work-item-detail/page.tsx:898-903 Details, 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 Layout instead of a fragment", because that holds for detail-page and work-item-detail while documentation-design was already rooted in Layout.
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 Layout has 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-design is a removed type argument: verified (no raw JSX tags on either side).
  • Each page root is now Layout instead of a fragment: false for documentation-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.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8fe79ec

@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.

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 false and now passes true: 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 Layout has 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-detail and product-detail are 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-contracts on 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-design from a removed type argument, and the detail-page and work-item-detail roots are now Layout: verified (no raw JSX tags on either side).
  • Build start lists lose Dialog and Selector: 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.

Automated review (maintainer link)

{isNarrow && (
<VStack gap={4}>
<Heading level={2}>Order details</Heading>
<PanelContent />

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.

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.

@josephfarina
josephfarina merged commit f58f304 into main Nov 16, 2026
126 of 132 checks passed
@github-actions
github-actions Bot deleted the josephfarina/content-templates-noscript branch November 17, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 8fe79eca Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant