You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d89a681
Browse filesBrowse the repository at this point in the historyBrowse files
fix(docs): make the code header earn its space, and lead six pages with the example (#401)
* docs: title the fenced blocks that are really files
139 fenced code blocks across the docs carried no `title=`, so every one
rendered a header bar blank except for its Copy button. Title the ten
that name a file a reader would actually create, and leave the rest
alone.
The bar for inclusion is that the snippet is a complete module — its own
imports, its own export — or that the prose already names the file. That
covers the copy-this-into-your-project recipes (ThemeProvider.tsx,
SystemThemeProvider.tsx, DensityPicker.tsx, useDensity.ts,
useDensityHeights.ts), the three whole-grid recipes (People.tsx,
EventGrid.tsx, OrdersGrid.tsx), the install block (Terminal), and the
one fence whose page already says "`columns.ts` calls
`createColumnHelper<Service>()`".
Everything else stays untitled on purpose: type signatures, two-line
`@import` pairs, JSX prop illustrations, and headless call sequences have
no honest filename, and inventing one would teach a reader something
false about where the code goes.
Metadata only — no code inside any fence changed, and no prose reflowed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* docs: lead six pages with their running example
Rule 1 of the examples-first spec is that the first substantial thing after
the intro paragraph is an `<Example>`, not prose. These six pages opened with
4-16 lines of prose first, and `cell-presentations.mdx` was the worst of them:
five paragraphs of abstract claims ("They are opt-in, never automatic", "None
of them speaks in colour alone") before the reader saw a single thing happen.
Each page keeps a one-or-two-sentence intro and then shows the grid. The
displaced prose is rewritten to point at what the reader just saw rather than
to set up something they have not seen yet — the colour-alone claim now names
the three columns you can check it against, the delta's flat case names the
MSFT row that carries it, and selection's two-slice split is explained through
the two captions the reader has already watched move independently.
No examples added or removed, no headings renamed (`cell-renderers#render`,
`cell-renderers#telling-it-apart-in-the-dom` and `selection#selection-model`
all have inbound links), and no factual claim dropped.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(docs): give the code header something to say, and stop saying it twice
The fence header was blank on every page in the docs. The design doc's call
was that a lone language tag is "nothing worth its space" — but that assumed
some fences would be titled, and none were: all 139 carried a language and
zero carried a title, so the bar rendered as a 38px band with a Copy button
floated at its right and nothing else. Show the title where an author gave
one, fall back to the language, and draw the fallback as a quiet uppercase
label rather than in the filename's own type. A language that names nothing
(text, plaintext) still shows no tag; the bar stays, because Copy has to live
somewhere other than floating over the code.
A multi-file example stacked three bars between its title and its first line
of code, and the third one reprinted the filename the file tab one row above
was already showing. The surface now prints a filename only when nothing else
names the file — ExampleShell withholds the path when it renders the tab
strip, so the surface never counts files itself — and the line count and
expand control move up beside the view tabs. With nothing left in it, the
surface renders no header at all rather than an empty band.
Measured on a production build, /docs/grid/cell-presentations:
multi-file example 239px -> 201px of chrome above the first line of code,
three bars down to two; fence 51px -> 51px, its one bar now reading "TSX"
instead of nothing. No affordance dropped: Copy, Copy file, Copy for agent,
.md, Expand and both tablists are all still present, with the roving
tabindex on each tablist untouched.
Records the reversal in the design doc (§1a, §1b) and replaces the tests that
pinned the old decision.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(docs): make the code header earn its space, and lead six pages with the example
- CodeSurface: show filename, else the language tag; nothing for
language-less fences. Every one of the 139 fences was untitled, so the
bar rendered blank rather than restrained.
- ExampleShell: drop the filename when the file-tab strip already names it,
and move line count + Expand into the toolbar. Three bars became two.
- Title the 12 fences that map to a real file; leave fragments untitled.
- Restructure six pages to lead with their example.
- Fix a range-selection comment claiming a section had 'just taught' a shape
it describes 13 lines later.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments