Commit 2a61116
* fix(spec): elide an over-wide enum inside a docs inline shape summary, with a count of what was hidden (#5340)
`formatType()` capped how many KEYS an inline object summary prints
(`INLINE_KEY_LIMIT = 4`) but never capped how wide one key's TYPE could be, so a
long enum reached through a summary printed every member into a single table
cell. Filed on `BulkActionDef.params` (~900 chars); the corpus measurement found
worse — the 261-member error-code vocabulary inlined into `error` shapes on 80
rows across 13 `api/*.mdx` pages, at 6242 characters in one cell.
An `Enum<…>` body rendered below a summary's `{ … }` is now cut to
`INLINE_ENUM_WIDTH_LIMIT` (80 characters) and the count of what was cut is
printed in its place: `Enum<'text' | 'textarea' | … +42 more>`. The count is the
safety property — a silent prefix would leave the page looking complete while it
was not, which is a worse defect than a wide cell for pages that are the
authoritative input for AI authors (ADR-0033).
Only a SECOND copy is cut. `ctx.inShapeSummary` is set once, where a summary
renders a child, and inherited downward; a schema's own row, a union variant on
its own row (`Enum<…> | string`), a top-level `Record<string, Enum<…>>` and an
array of a top-level enum all still print every member. For 457 of the 805
in-shape occurrences that is where the elided copy's full list still lives, on
the same page.
The 80 is measured, not chosen: across 216 pages / 8541 type cells / 1768 enum
occurrences the in-shape population is bimodal and its per-character density
collapses at 80 (3.6/char over (64,80], 1.6 over (80,100], 0.5 over (100,200]).
An elision must also pay for its own marker, so a body a member or two over
budget is left whole and the limit is not a cliff at exactly 81.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wsZeReNTqiceBfLb5Pyf5
* chore(docs): regenerate reference pages for the inline-enum elision (#5340)
`pnpm --filter @objectstack/spec gen:schema && gen:docs` output only — no hand
edits (`content/docs/references/` is AUTO-GEN).
42 pages, 144 rows, one direction: every changed row is shorter (462,140
characters removed in total, largest single row -6266) and every one carries a
`… +N more` marker — no row was silently truncated and none grew. Cells over 900
characters 76 → 4, over 200 characters 246 → 145, p99 cell width 643 → 247,
p95 unchanged at 145.
The widest cell left is `api/contract.mdx` `code` at 6092 — the error-code
vocabulary on its OWN row, deliberately untouched because it is the only full
copy of that list on the page.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wsZeReNTqiceBfLb5Pyf5
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 939f579 commit 2a61116
45 files changed
Lines changed: 635 additions & 146 deletions
File tree
- .changeset
- content/docs/references
- ai
- api
- automation
- cloud
- data
- integration
- kernel
- qa
- security
- studio
- system
- ui
- packages/spec/scripts
- lib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments