@reqvire-org/ads 0.5.16 → 0.5.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2717,7 +2717,7 @@ export const runtimeErrors = {
2717
2717
  guides: ["ads://guides/tokens", "ads://guides/layout"],
2718
2718
  repair: "Make the named element fluid (%, fr, min-width: 0 on flex/grid children, or a span of its owner's grid tracks instead of a fixed width, with a container-context grid where it must follow its region; cap a fixed frame with max-inline-size: 100%), let text wrap or truncate with text-overflow: ellipsis, or put it in an overflow-x: auto scroller.",
2719
2719
  emitters: ["src/render-audit.mts"],
2720
- situations: 'kind "document" | "viewport" | "clipped" (the "container" kind is reported as layout-overflow-narrow). Code passes guidanceUri ads://guides/tokens.'
2720
+ situations: `kind "document" | "viewport" | "clipped" | "broken-word" | "collapsed-scroller" | "escaped" (a control reaching past the painted box around it, a card's border or fill that does not clip it: let the row of controls keep its size and the text beside it give way, or let the row wrap) | "escaped-text" (the same for text; a review, since a bleed can be deliberate). The "container" kind is reported as layout-overflow-narrow. Code passes guidanceUri ads://guides/tokens.`
2721
2721
  },
2722
2722
  "layout-overflow-narrow": {
2723
2723
  group: "rendered-check",
@@ -2726,7 +2726,7 @@ export const runtimeErrors = {
2726
2726
  guides: ["ads://guides/tokens", "ads://guides/layout"],
2727
2727
  repair: "Make the element fluid (%, fr, min(100%, ...)), wrap it or scroll it with overflow-x: auto.",
2728
2728
  emitters: ["src/render-audit.mts"],
2729
- situations: "the same overflow kinds as layout-overflow, measured in the container render (first theme, widest viewport). Code passes guidanceUri ads://guides/tokens."
2729
+ situations: 'the same overflow kinds as layout-overflow, measured in the container render (first theme, widest viewport). A review, except kind "escaped": a control spilling over its own painted box is an error in a narrow pane too. Code passes guidanceUri ads://guides/tokens.'
2730
2730
  },
2731
2731
  "layout-shift": {
2732
2732
  group: "rendered-check",
@@ -44,7 +44,7 @@ export async function layoutOverflow({ nodeLimit, width: expected, container, sm
44
44
  }
45
45
  return found;
46
46
  function measure() {
47
- const width = document.documentElement.clientWidth, issues = [], counts = { document: 0, viewport: 0, container: 0, clipped: 0, "broken-word": 0, "collapsed-scroller": 0, escaped: 0, "block-clipped": 0, spilled: 0, overlap: 0, "focus-clipped": 0 }, pane = container ? scope.getBoundingClientRect() : { left: 0, right: width }, edge = container ? "container" : "viewport", selector = (element) => {
47
+ const width = document.documentElement.clientWidth, issues = [], counts = { document: 0, viewport: 0, container: 0, clipped: 0, "broken-word": 0, "collapsed-scroller": 0, escaped: 0, "escaped-text": 0, "block-clipped": 0, spilled: 0, overlap: 0, "focus-clipped": 0 }, pane = container ? scope.getBoundingClientRect() : { left: 0, right: width }, edge = container ? "container" : "viewport", selector = (element) => {
48
48
  const parts = [];
49
49
  for (let node = element;node !== scope; ) {
50
50
  const parent = node.parentElement;
@@ -239,7 +239,7 @@ export async function layoutOverflow({ nodeLimit, width: expected, container, sm
239
239
  break;
240
240
  }
241
241
  if (reach > 2)
242
- report("escaped", element, { overflow: Math.round(reach) });
242
+ report(control(element) ? "escaped" : "escaped-text", element, { overflow: Math.round(reach) });
243
243
  }
244
244
  }
245
245
  function measureFit() {
@@ -242,8 +242,8 @@ try {
242
242
  let narrowed = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths.at(-1) ?? request.overflowWidths[0] });
243
243
  if (narrowed.issues.length) {
244
244
  await page.setViewportSize({ width: request.overflowWidths[0], height: request.viewport.height });
245
- const folded = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths[0] });
246
- if (!folded.issues.length)
245
+ const folded = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths[0] }), total = (result) => Object.values(result.counts).reduce((sum, count) => sum + (count ?? 0), 0);
246
+ if (total(folded) < total(narrowed))
247
247
  narrowed = folded;
248
248
  }
249
249
  layout.push({ width: app.container, container: !0, ...narrowed });
@@ -264,9 +264,13 @@ const skipReasons = {
264
264
  fix: "Make the content fit, truncate it with text-overflow: ellipsis, or use overflow-x: auto if it should scroll."
265
265
  },
266
266
  escaped: {
267
- what: "a control or text reaches past the edge of the painted box around it (a card's border or fill), which does not clip it",
267
+ what: "a control reaches past the edge of the painted box around it (a card's border or fill), which does not clip it",
268
268
  fix: `Let the box hold it: keep a row of controls from shrinking below its buttons (give the text beside it the room to give way, extent: "fill" or truncation), or let the row wrap; do not let content spill over a card's edge.`
269
269
  },
270
+ "escaped-text": {
271
+ what: "text reaches past the edge of the painted box around it (a card's border or fill), which does not clip it",
272
+ fix: 'Let the box hold it: give the text room to wrap or truncate (extent: "fill", text-overflow), or keep the box from shrinking below it; a deliberate bleed stays a reviewed decision.'
273
+ },
270
274
  "collapsed-scroller": {
271
275
  what: "a scroll area that holds content is collapsed to nothing: everything in it is out of sight",
272
276
  fix: 'Give the scroll area a size: let it fill a parent that has a height (extent: "fill" in a stack given a height), or a minimum block size; check its parents for a height of 0.'
@@ -325,7 +329,7 @@ export function layoutOverflowFindings(runs, scenarios) {
325
329
  const { scenario, tag: rule, kind, widths, themes, brands, nodes, nodeCount } = group, container = rule === NARROW_RULE, sorted = [...widths].sort((a, b) => a - b);
326
330
  return {
327
331
  rule,
328
- severity: kind === "escaped" ? "review" : findingSeverity(rule),
332
+ severity: kind === "escaped" ? "error" : kind === "escaped-text" ? "review" : findingSeverity(rule),
329
333
  file: files.get(scenario) ?? scenario,
330
334
  line: 1,
331
335
  column: 1,
@@ -4,7 +4,8 @@ Adapted from Emil Kowalski's break-ui skill (MIT); see the skill README for cred
4
4
 
5
5
  ADS already proves the construction: `ads check` validates layout, tokens, contrast and
6
6
  accessibility rules, and the render audit fails horizontal overflow at 390, 768 and 1280 px
7
- (`layout-overflow`) and lists narrow-container overflow for review (`layout-overflow-narrow`).
7
+ (`layout-overflow`) and lists narrow-container overflow for review (`layout-overflow-narrow`),
8
+ except a control spilling over its own box (kind `escaped`), an error at any width.
8
9
  A stress test adds what no guard knows: **which real content and states break this UI**.
9
10
 
10
11
  ## Choose the work
@@ -71,7 +71,11 @@ The render audit renders each selected UI scenario in every brand and theme and
71
71
  runs axe-core, non-text contrast, layout overflow, layout shift, image shape,
72
72
  render states and first render (check `render-audit`). Its `a11y-axe`,
73
73
  `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the
74
- gate. An `a11y-incomplete` info item means axe could not decide that rule on those
74
+ gate. That includes kind `escaped`, a control reaching past the painted box
75
+ around it (a button over a card's border), also in the 240 px container render:
76
+ keep the row of controls at its size and let the text beside it truncate, or
77
+ let the row wrap below a width. Do not shrink the buttons or remove the narrow
78
+ specimen to clear it. Kind `escaped-text` is a review. An `a11y-incomplete` info item means axe could not decide that rule on those
75
79
  elements: check it by hand, using the reason it names (`bgGradient` is text over a
76
80
  gradient). An audit that cannot run (its browser could not be installed) fails with
77
81
  a `render-audit-unavailable` error naming the install command. A render that fails is retried on
@@ -71,7 +71,11 @@ The render audit renders each selected UI scenario in every brand and theme and
71
71
  runs axe-core, non-text contrast, layout overflow, layout shift, image shape,
72
72
  render states and first render (check `render-audit`). Its `a11y-axe`,
73
73
  `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the
74
- gate. An `a11y-incomplete` info item means axe could not decide that rule on those
74
+ gate. That includes kind `escaped`, a control reaching past the painted box
75
+ around it (a button over a card's border), also in the 240 px container render:
76
+ keep the row of controls at its size and let the text beside it truncate, or
77
+ let the row wrap below a width. Do not shrink the buttons or remove the narrow
78
+ specimen to clear it. Kind `escaped-text` is a review. An `a11y-incomplete` info item means axe could not decide that rule on those
75
79
  elements: check it by hand, using the reason it names (`bgGradient` is text over a
76
80
  gradient). An audit that cannot run (its browser could not be installed) fails with
77
81
  a `render-audit-unavailable` error naming the install command. A render that fails is retried on
@@ -71,7 +71,11 @@ The render audit renders each selected UI scenario in every brand and theme and
71
71
  runs axe-core, non-text contrast, layout overflow, layout shift, image shape,
72
72
  render states and first render (check `render-audit`). Its `a11y-axe`,
73
73
  `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the
74
- gate. An `a11y-incomplete` info item means axe could not decide that rule on those
74
+ gate. That includes kind `escaped`, a control reaching past the painted box
75
+ around it (a button over a card's border), also in the 240 px container render:
76
+ keep the row of controls at its size and let the text beside it truncate, or
77
+ let the row wrap below a width. Do not shrink the buttons or remove the narrow
78
+ specimen to clear it. Kind `escaped-text` is a review. An `a11y-incomplete` info item means axe could not decide that rule on those
75
79
  elements: check it by hand, using the reason it names (`bgGradient` is text over a
76
80
  gradient). An audit that cannot run (its browser could not be installed) fails with
77
81
  a `render-audit-unavailable` error naming the install command. A render that fails is retried on
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,116 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.18
4
+
5
+ <!-- ads-local-tests:start -->
6
+ Hot patch: the unit and integration groups; the browser group was not run.
7
+ Quick hot patch (on the owner's instruction, only the tests the fix may affect): unit render-audit-states.test.ts, render-audit-derived.test.ts, escaped-severity.test.ts; integration analysis-acceptance.test.mjs, analysis-contrast.test.mjs; not the whole unit or integration group. The changed audit worker runs only in tests/browser/render-audit.test.mjs, which passed 38/38 on this source separately.
8
+ Local verification: **23/23 passed** (unit 8, integration 15).
9
+ Tested commit: `e4c45f21f127335dc5526a93c5ebb527ea2c8b75`; Bun 1.4.4.
10
+ Completed 2026-11-26T17:00:38.367Z (46 seconds).
11
+
12
+ <!-- ads-local-test-proof
13
+ {
14
+ "schema": 3,
15
+ "version": "0.5.18",
16
+ "commit": "e4c45f21f127335dc5526a93c5ebb527ea2c8b75",
17
+ "sourceSha256": "473527688ce2848be8a4b35249172b0637db06fc1b036388222696a0698015b7",
18
+ "command": "bun run test:hotpatch",
19
+ "scope": "hotpatch",
20
+ "result": "pass",
21
+ "tests": 23,
22
+ "pass": 23,
23
+ "fail": 0,
24
+ "skipped": 0,
25
+ "groups": [
26
+ {
27
+ "name": "unit",
28
+ "tests": 8,
29
+ "pass": 8,
30
+ "fail": 0,
31
+ "skipped": 0,
32
+ "reportSha256": "6ef98ff08a6db45de3f6676848771b1037c5f332e58fd81901351b013044fe14"
33
+ },
34
+ {
35
+ "name": "integration",
36
+ "tests": 15,
37
+ "pass": 15,
38
+ "fail": 0,
39
+ "skipped": 0,
40
+ "reportSha256": "75d44a5587e03922ec264bc0d8868907f7c4653bcfb2a58a524ce25939f2939a"
41
+ }
42
+ ],
43
+ "testOverrides": {},
44
+ "bun": "1.4.4",
45
+ "completedAt": "2026-11-26T17:00:38.367Z",
46
+ "durationMs": 46056,
47
+ "logSha256": "4b465972476daa4b06cfc5e78613389de39596575e3db3166eb7dcc4c5a147cd"
48
+ }
49
+ -->
50
+ <!-- ads-local-tests:end -->
51
+
52
+ - *Fixed: page sections reported as escaping in the 240 px pane*: a layout
53
+ whose tiers follow the viewport (LinkCardGrid's three columns, two-column
54
+ pricing cards) kept its desktop layout in the pane render, which no screen
55
+ shows. That render now measures it at the 390 px viewport, where it folds,
56
+ whenever that reports less, not only when it is clean; what still does not
57
+ fit there is reported.
58
+
59
+ ## 0.5.17
60
+
61
+ <!-- ads-local-tests:start -->
62
+ Hot patch: the unit and integration groups; the browser group was not run.
63
+ Quick hot patch (urgent, on the owner's instruction): the unit group and 3 integration files related to the fixes (analysis-acceptance.test.mjs, local-test-proof.test.mjs, starter-check.test.ts), not the whole integration group.
64
+ Local verification: **897/897 passed** (unit 852, integration 45).
65
+ Tested commit: `6dfbb644e2402ef5bb39afc52ca41f4e1005991f`; Bun 1.4.4.
66
+ Completed 2026-11-26T15:13:39.662Z (75 seconds).
67
+
68
+ <!-- ads-local-test-proof
69
+ {
70
+ "schema": 3,
71
+ "version": "0.5.17",
72
+ "commit": "6dfbb644e2402ef5bb39afc52ca41f4e1005991f",
73
+ "sourceSha256": "7009dc5c80293958431615e1f5169d6684dcf719751c61220b59f57b6ea63953",
74
+ "command": "bun run test:hotpatch",
75
+ "scope": "hotpatch",
76
+ "result": "pass",
77
+ "tests": 897,
78
+ "pass": 897,
79
+ "fail": 0,
80
+ "skipped": 0,
81
+ "groups": [
82
+ {
83
+ "name": "unit",
84
+ "tests": 852,
85
+ "pass": 852,
86
+ "fail": 0,
87
+ "skipped": 0,
88
+ "reportSha256": "dbf35924b9db0f66e2214c4ef36f73a0c0fa321a6e282afd4131a07463470b5b"
89
+ },
90
+ {
91
+ "name": "integration",
92
+ "tests": 45,
93
+ "pass": 45,
94
+ "fail": 0,
95
+ "skipped": 0,
96
+ "reportSha256": "26889e4ce809e63ed3ef8a6cfa7145babe688b1607d67190404eb2d8a1764904"
97
+ }
98
+ ],
99
+ "testOverrides": {},
100
+ "bun": "1.4.4",
101
+ "completedAt": "2026-11-26T15:13:39.662Z",
102
+ "durationMs": 75470,
103
+ "logSha256": "2a36ffcaf5ae3c9302fe5344f331101669d972d6c33cf9558fe6a99a836823d8"
104
+ }
105
+ -->
106
+ <!-- ads-local-tests:end -->
107
+
108
+ - *Render audit: a control escaping its box is an error*: a `layout-overflow`
109
+ finding of kind `escaped` (a button reaching past the painted box around it,
110
+ such as a card's border in a narrow pane) now fails the gate, in the 240 px
111
+ container render too. Text doing the same is the new kind `escaped-text`,
112
+ which stays a review.
113
+
3
114
  ## 0.5.16
4
115
 
5
116
  <!-- ads-local-tests:start -->
package/docs/GUIDE.md CHANGED
@@ -631,10 +631,13 @@ capture shows the page as the showcase does.
631
631
 
632
632
  - Each `a11y-axe`, `a11y-non-text-contrast`, `a11y-text-scale`,
633
633
  `a11y-text-spacing-override`, `a11y-reflow`, `layout-overflow`, `layout-shift`
634
- and `img-shape` finding is an error that fails the gate, except a
635
- `layout-overflow` finding of kind `escaped` (a control or text reaching past
636
- the edge of the painted box around it, such as a button spilling over a
637
- card's border), which is a review while designs are read with it.
634
+ and `img-shape` finding is an error that fails the gate, including a
635
+ `layout-overflow` finding of kind `escaped` (a control reaching past the edge
636
+ of the painted box around it, such as a button spilling over a card's border
637
+ in a narrow pane). It is an error in the 240 px container render too, whose
638
+ other `layout-overflow-narrow` findings are reviews. Kind `escaped-text`
639
+ (text reaching past that edge) is a review: a deliberate bleed is possible,
640
+ so read it and decide.
638
641
  - Each `a11y-incomplete` finding is an info item that fails nothing: axe could
639
642
  not decide that rule on those elements, so check it by hand.
640
643
  - An audit that cannot run fails the gate with a `render-audit-unavailable`
@@ -674,7 +677,11 @@ What the audit measures in each render:
674
677
  - Scrollers, ellipsis text, carousels, pannable widgets, native text fields,
675
678
  fixed layers and visually hidden content are exempt.
676
679
  - Components and patterns are also rendered in a 240 px container. What does
677
- not fit a side pane is a `layout-overflow-narrow` review item.
680
+ not fit a side pane is a `layout-overflow-narrow` review item (an escaping
681
+ control is an error). A layout whose tiers follow the viewport (a page
682
+ section's grid) is measured in that container at the 390 px viewport, where
683
+ it folds, when that reports less: it never shows its desktop layout in a
684
+ pane. A container-context grid follows the pane at any viewport.
678
685
  - **Text scaling** (WCAG 1.4.4, 1.4.10, 1.4.12), once per scenario in the first
679
686
  theme and brand, because text does not follow colour. The passes add about a
680
687
  tenth to the audit's time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.5.16",
3
+ "version": "0.5.18",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {