@capagents/forgeqe 3.1.1 → 3.1.2

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.
Files changed (247) hide show
  1. package/HOW_TO_USE.md +435 -78
  2. package/README.md +21 -6
  3. package/THIRD_PARTY_NOTICES.md +210 -1
  4. package/dist/docs-site/CREDITS.md +6 -0
  5. package/dist/docs-site/architecture-map/index.html +1 -1
  6. package/dist/docs-site/docs/app-theme.css +100 -8
  7. package/dist/docs-site/docs/architecture/index.html +210 -214
  8. package/dist/docs-site/docs/area-api/index.html +350 -0
  9. package/dist/docs-site/docs/area-automated-tests/index.html +967 -0
  10. package/dist/docs-site/docs/area-browser/index.html +430 -0
  11. package/dist/docs-site/docs/area-data/index.html +605 -0
  12. package/dist/docs-site/docs/area-desktop/index.html +755 -0
  13. package/dist/docs-site/docs/area-mobile/index.html +631 -0
  14. package/dist/docs-site/docs/area-operations/index.html +1069 -0
  15. package/dist/docs-site/docs/area-pull-requests/index.html +208 -0
  16. package/dist/docs-site/docs/area-quality/index.html +365 -0
  17. package/dist/docs-site/docs/area-release/index.html +320 -0
  18. package/dist/docs-site/docs/area-setup/index.html +1192 -0
  19. package/dist/docs-site/docs/area-systems/index.html +207 -0
  20. package/dist/docs-site/docs/area-test-cases/index.html +694 -0
  21. package/dist/docs-site/docs/containers/index.html +97 -104
  22. package/dist/docs-site/docs/cost-architecture/index.html +108 -112
  23. package/dist/docs-site/docs/custom-agents-first-run/index.html +19 -23
  24. package/dist/docs-site/docs/desktop/index.html +172 -162
  25. package/dist/docs-site/docs/desktop-ci/index.html +26 -33
  26. package/dist/docs-site/docs/evidence/index.html +253 -257
  27. package/dist/docs-site/docs/feature-test-prompts/index.html +66 -70
  28. package/dist/docs-site/docs/get-started/index.html +495 -0
  29. package/dist/docs-site/docs/graphify/index.html +42 -46
  30. package/dist/docs-site/docs/guardrails/index.html +17 -21
  31. package/dist/docs-site/docs/index.html +17 -6729
  32. package/dist/docs-site/docs/mobile/index.html +155 -162
  33. package/dist/docs-site/docs/model-routing/index.html +44 -51
  34. package/dist/docs-site/docs/overview/index.html +176 -0
  35. package/dist/docs-site/docs/product-graph/index.html +52 -55
  36. package/dist/docs-site/docs/product-knowledge/index.html +11 -15
  37. package/dist/docs-site/docs/product-views/index.html +53 -57
  38. package/dist/docs-site/docs/reference/index.html +379 -0
  39. package/dist/docs-site/docs/search.js +1 -1
  40. package/dist/docs-site/docs/using/index.html +480 -0
  41. package/dist/docs-site/docs/web-app/index.html +147 -93
  42. package/dist/docs-site/security/index.html +930 -0
  43. package/dist/docs-site/security/security-theme.css +161 -0
  44. package/dist/docs-site/security/security.js +1465 -0
  45. package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
  46. package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
  47. package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
  48. package/dist/forgeqe.js +1902 -1895
  49. package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
  50. package/dist/web/assets/Agent-CPhmZdFX.js +8 -0
  51. package/dist/web/assets/AgentWork-BXdN9xgi.js +2 -0
  52. package/dist/web/assets/ApiTests-Do3xLjfB.js +10 -0
  53. package/dist/web/assets/Browse-WVkJT6Bs.js +2 -0
  54. package/dist/web/assets/Chat-CDc9UcQX.js +3 -0
  55. package/dist/web/assets/CommandPalette-BAZm62lV.js +1 -0
  56. package/dist/web/assets/Compare-Br6n9T9L.js +1 -0
  57. package/dist/web/assets/Cost-BBUyBu3Y.js +1 -0
  58. package/dist/web/assets/Data-Ch2DPEWp.js +6 -0
  59. package/dist/web/assets/Desktop-Qzoq-cQv.js +1 -0
  60. package/dist/web/assets/DesktopReview-CF_jQYAM.js +1 -0
  61. package/dist/web/assets/Evidence-C72Lj5_Q.js +1 -0
  62. package/dist/web/assets/Explore-ObkEpUyS.js +2 -0
  63. package/dist/web/assets/Features-CQzNo_WP.js +1 -0
  64. package/dist/web/assets/Flags-0-RniPJm.js +2 -0
  65. package/dist/web/assets/Flaky-BPJvNLCA.js +1 -0
  66. package/dist/web/assets/Impact-CfccsL_k.js +3 -0
  67. package/dist/web/assets/Jobs-T6m4zhDy.js +5 -0
  68. package/dist/web/assets/KindPage-BDUvWe2p.js +6 -0
  69. package/dist/web/assets/Migration-Dqeh4x5u.js +2 -0
  70. package/dist/web/assets/PageAgent-DNjzIgeY.js +1 -0
  71. package/dist/web/assets/Product-nYV_scOV.js +7 -0
  72. package/dist/web/assets/Production-CGSbEWVa.js +1 -0
  73. package/dist/web/assets/Quality-BIypojZm.js +1 -0
  74. package/dist/web/assets/Readiness-BlRjwJRg.js +1 -0
  75. package/dist/web/assets/Record-v2KLI-_Z.js +1 -0
  76. package/dist/web/assets/Regression-B-jSt4Jz.js +5 -0
  77. package/dist/web/assets/RelationGraph-8J98lOVG.js +1 -0
  78. package/dist/web/assets/Reports-GI4u6SyW.js +2 -0
  79. package/dist/web/assets/Response-mhBThq2b.js +9 -0
  80. package/dist/web/assets/Responsive-DXu7Ra7K.js +3 -0
  81. package/dist/web/assets/RunDiff-D0SHDNp0.js +1 -0
  82. package/dist/web/assets/Runs-C1Gjdi9M.js +2 -0
  83. package/dist/web/assets/Settings-BGGeuvyF.js +21 -0
  84. package/dist/web/assets/Steps-D-YG0eJy.js +2 -0
  85. package/dist/web/assets/TestCases-DC4w77eQ.js +1 -0
  86. package/dist/web/assets/TestData-CvKWRVVV.js +2 -0
  87. package/dist/web/assets/TestDebt-D8YzN29_.js +1 -0
  88. package/dist/web/assets/TestManagement-C5cDCqrD.js +1 -0
  89. package/dist/web/assets/Tosca-BGUv3RiJ.js +3 -0
  90. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +1 -0
  91. package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
  92. package/dist/web/assets/coverage-BMP6ELFJ.js +5 -0
  93. package/dist/web/assets/dataParts-DbeCj9ga.js +3 -0
  94. package/dist/web/assets/diff-BStuTmsN.js +2 -0
  95. package/dist/web/assets/families-BBFFrUlo.js +1 -0
  96. package/dist/web/assets/filters-CnAMr286.js +1 -0
  97. package/dist/web/assets/fold-D_O_VZui.js +1 -0
  98. package/dist/web/assets/head-CRo48rPt.js +1 -0
  99. package/dist/web/assets/highlight-BcFZIf59.js +4 -0
  100. package/dist/web/assets/index-B3JsM7tv.js +64 -0
  101. package/dist/web/assets/index-CafApcbZ.css +2 -0
  102. package/dist/web/assets/input-CtzK50ZF.js +1 -0
  103. package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
  104. package/dist/web/assets/line-icons-rdF8DYDJ.js +1 -0
  105. package/dist/web/assets/logos-D4oVWzqa.js +1 -0
  106. package/dist/web/assets/palette-DAaGSao7.js +1 -0
  107. package/dist/web/assets/paletteCommands-Co-RlQ8q.js +1 -0
  108. package/dist/web/assets/parts-D357Wolo.js +1 -0
  109. package/dist/web/assets/productParts-B8oHRCJF.js +1 -0
  110. package/dist/web/assets/qualityParts-BLkmIfDY.js +1 -0
  111. package/dist/web/assets/recordTest-Cez2sDJO.js +1 -0
  112. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  113. package/dist/web/assets/route-BloYJWgw.js +1 -0
  114. package/dist/web/index.html +12 -6
  115. package/docs/ARCHITECTURE.md +1 -1
  116. package/docs/BASAL.md +1 -1
  117. package/docs/DESKTOP.md +20 -1
  118. package/docs/EVIDENCE.md +1 -1
  119. package/docs/MOBILE.md +4 -4
  120. package/docs/PRODUCT_KNOWLEDGE.md +2 -0
  121. package/docs/WEB_APP.md +114 -51
  122. package/docs/user-guide.html +404 -81
  123. package/forgeqe.example.yaml +3 -3
  124. package/package.json +1 -1
  125. package/prompts/page-differs.md +1 -1
  126. package/prompts/requests-rule.md +1 -1
  127. package/prompts/test-reviewer.md +1 -1
  128. package/prompts/test-rules.md +3 -4
  129. package/skills/web-guidance/LICENSE +202 -0
  130. package/skills/web-guidance/SKILL.md +76 -0
  131. package/skills/web-guidance/UPSTREAM +67 -0
  132. package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
  133. package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
  134. package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
  135. package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
  136. package/skills/web-guidance/references/css/responsive-design.md +16 -0
  137. package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
  138. package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
  139. package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
  140. package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
  141. package/skills/web-guidance/references/forms/forms.md +415 -0
  142. package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
  143. package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
  144. package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
  145. package/skills/web-guidance/references/forms/slider.md +184 -0
  146. package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
  147. package/skills/web-guidance/references/forms/switch.md +60 -0
  148. package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
  149. package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
  150. package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
  151. package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
  152. package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
  153. package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
  154. package/skills/web-guidance/references/performance/performance.md +384 -0
  155. package/skills/web-guidance/references/privacy/privacy.md +247 -0
  156. package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
  157. package/skills/web-guidance/references/security/passkey-management.md +310 -0
  158. package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
  159. package/skills/web-guidance/references/security/passkey-registration.md +186 -0
  160. package/skills/web-guidance/references/security/passkeys.md +39 -0
  161. package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
  162. package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
  163. package/skills/web-guidance/references/security/security.md +390 -0
  164. package/skills/web-guidance/references/security/trusted-types.md +141 -0
  165. package/skills/web-guidance/references/security/validate-origins.md +197 -0
  166. package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
  167. package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
  168. package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
  169. package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
  170. package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
  171. package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
  172. package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
  173. package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
  174. package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
  175. package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
  176. package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
  177. package/skills/web-guidance/references/ui-components/accordion.md +343 -0
  178. package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
  179. package/skills/web-guidance/references/ui-components/carousel.md +206 -0
  180. package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
  181. package/skills/web-guidance/references/ui-components/dialog.md +218 -0
  182. package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
  183. package/skills/web-guidance/references/ui-components/menu.md +415 -0
  184. package/skills/web-guidance/references/ui-components/navbar.md +281 -0
  185. package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
  186. package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
  187. package/skills/web-guidance/references/ui-components/progress.md +181 -0
  188. package/skills/web-guidance/references/ui-components/spinner.md +179 -0
  189. package/skills/web-guidance/references/ui-components/tabs.md +371 -0
  190. package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
  191. package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
  192. package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
  193. package/skills/web-guidance/references/visual-design/color.md +43 -0
  194. package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
  195. package/dist/web/assets/AgentWork-DwAI0_Of.js +0 -2
  196. package/dist/web/assets/ApiTests-C0vFSHmM.js +0 -10
  197. package/dist/web/assets/Browse-5jfdtRc5.js +0 -2
  198. package/dist/web/assets/Chat-B3uhI94O.js +0 -3
  199. package/dist/web/assets/CommandPalette-D2J4nf5y.js +0 -1
  200. package/dist/web/assets/Compare-CN75w1p9.js +0 -1
  201. package/dist/web/assets/Cost-QoxyjR95.js +0 -1
  202. package/dist/web/assets/Data-BAvkcBVt.js +0 -6
  203. package/dist/web/assets/Desktop-BXdOIalN.js +0 -1
  204. package/dist/web/assets/DesktopReview-Bl2SrPP0.js +0 -1
  205. package/dist/web/assets/Evidence-BJ_I52CD.js +0 -1
  206. package/dist/web/assets/Explore-D9AuyTip.js +0 -2
  207. package/dist/web/assets/Features-CusGMDR9.js +0 -1
  208. package/dist/web/assets/Flags-CycGFuUP.js +0 -2
  209. package/dist/web/assets/Flaky-BcSzJogN.js +0 -1
  210. package/dist/web/assets/Impact-CJHnyZ21.js +0 -3
  211. package/dist/web/assets/Jobs-4xcFzEFo.js +0 -5
  212. package/dist/web/assets/KindPage-BielEIej.js +0 -6
  213. package/dist/web/assets/Migration-NwanKpJg.js +0 -2
  214. package/dist/web/assets/PageAgent-CNw4NXva.js +0 -1
  215. package/dist/web/assets/Product-DS3LJZ4P.js +0 -7
  216. package/dist/web/assets/Production-D3zsyNIS.js +0 -1
  217. package/dist/web/assets/Quality-Ctj2YpC4.js +0 -1
  218. package/dist/web/assets/Readiness-DGcRr_co.js +0 -1
  219. package/dist/web/assets/Record-Cc-wGe_Y.js +0 -1
  220. package/dist/web/assets/Regression-DcsbrRa1.js +0 -5
  221. package/dist/web/assets/Reports-BkCn0-Sf.js +0 -2
  222. package/dist/web/assets/Response-BP0UwQcW.js +0 -9
  223. package/dist/web/assets/Responsive-C8U7dumd.js +0 -3
  224. package/dist/web/assets/RunDiff-BhABuhF_.js +0 -1
  225. package/dist/web/assets/Runs-OwdWEYBv.js +0 -2
  226. package/dist/web/assets/Steps-BvzbQyoD.js +0 -2
  227. package/dist/web/assets/TestCases-CLq_6JA5.js +0 -1
  228. package/dist/web/assets/TestData-B0oKAhp6.js +0 -2
  229. package/dist/web/assets/TestDebt-8NLQ5YV_.js +0 -1
  230. package/dist/web/assets/TestManagement-2LYQ7vsN.js +0 -1
  231. package/dist/web/assets/Tosca-DfvMpPTG.js +0 -3
  232. package/dist/web/assets/WhatsNew-BGFNGwqN.js +0 -1
  233. package/dist/web/assets/families-DYlN5v0i.js +0 -1
  234. package/dist/web/assets/filters-faaSnoIq.js +0 -1
  235. package/dist/web/assets/fold-CUjwWAK3.js +0 -1
  236. package/dist/web/assets/frame-BLPdAXUq.js +0 -13
  237. package/dist/web/assets/head-CsTxBsO0.js +0 -1
  238. package/dist/web/assets/index-CxiCvGZq.js +0 -78
  239. package/dist/web/assets/index-dOIsrzhD.css +0 -2
  240. package/dist/web/assets/line-icons-CwZWt93L.js +0 -1
  241. package/dist/web/assets/logos-dGuc1jIM.js +0 -1
  242. package/dist/web/assets/markdown-BI3F-SJ1.js +0 -10
  243. package/dist/web/assets/paletteCommands-QJiCuUEr.js +0 -1
  244. package/dist/web/assets/parts-CdF1f7yS.js +0 -1
  245. package/dist/web/assets/productParts-hNLD9fN0.js +0 -1
  246. package/dist/web/assets/qualityParts-CT25lBWU.js +0 -1
  247. package/dist/web/assets/recordTest-P792aBUt.js +0 -1
@@ -0,0 +1,40 @@
1
+ # Platform Controls Dismiss Dialog
2
+
3
+ When a modal dialog is open, users expect to use familiar controls to dismiss them: pressing the <kbd>Esc</kbd> key on a keyboard, using the back button or gesture on mobile platforms, or a dismiss gesture with assistive technologies.
4
+
5
+ When the `<dialog>` element was first introduced, it could be dismissed with the <kbd>Esc</kbd> key, but not other platform controls such as a back button/gesture on mobile. With the addition of the `closedby` attribute for `<dialog>` elements, the extended behavior of responding to more platform-specific controls for close requests has been applied for `<dialog>` elements that are opened in a modal state (i.e. when opened imperatively with the `<dialog>` element’s `showModal()` method in JavaScript or declaratively with the `show-modal` invoker command). So, there is no specific change developers need to make if they are already using the `<dialog>` element.
6
+
7
+ ```html
8
+ <!-- MANDATORY: must be opened with either `showModal()` with JavaScript or the `show-modal` command using declarative command invokers in order respond to close requests including platform-specific controls. -->
9
+ <dialog aria-labelledby="example">
10
+ <h1 id="example">Example</h1>
11
+ <p>Modal that can be dismissed with close requests.</p>
12
+ </dialog>
13
+ ```
14
+
15
+ When opened in a modal state, a dialog without the `closedby` attribute responds to close requests the same as explicitly setting the `closedby` attribute to `closerequest`.
16
+
17
+ ```html
18
+ <!-- This is unnecessary as it is the default behavior for modal dialogs -->
19
+ <dialog closedby="closerequest" aria-labelledby="example">
20
+ <h1 id="example">Example</h1>
21
+ <p>Modal that can be dismissed with close requests.</p>
22
+ </dialog>
23
+ ```
24
+
25
+ If you also want “light dismiss” behavior, then you must set `closedby` to `any`:
26
+
27
+ ```html
28
+ <dialog closedby="any" aria-labelledby="example">
29
+ <h1 id="example">Example</h1>
30
+ <p>Modal that can be dismissed with close requests and light dismiss.</p>
31
+ </dialog>
32
+ ```
33
+
34
+ ## Fallback strategies
35
+
36
+ Browser support for <dialog closedby>: Limited availability.
37
+ Supported by: Chrome 134 (Mar 2025), Edge 134 (Mar 2025), and Firefox 141 (Jul 2025).
38
+ Unsupported in: Safari.
39
+
40
+ `<dialog>` elements opened in a modal state can already be dismissed with <kbd>Esc</kbd>, so there is no fallback necessary. There is no good way to implement close requests from mobile back button/gestures, so it is simpler to embrace this feature as a progressive enhancement, especially given that there are other inclusive means to dismiss the modal dialog. Similarly, light dismiss behavior for a `<dialog>` element using `closedby="any"` can be considered a progressive enhancement.
@@ -0,0 +1,59 @@
1
+ # Prevent the Page Underneath a Modal Dialog from Scrolling
2
+
3
+ When a `<dialog>` element is opened as a modal using `showModal()`, the browser promotes it to the top layer and marks the rest of the document inert. While that blocks pointer clicks and keyboard focus on the underlying page, it does not prevent scrolling:
4
+
5
+ 1. Scrolling while the pointer or touch gesture is over the `::backdrop` scrolls the page underneath.
6
+ 2. Scrolling inside the `<dialog>` chains to the underlying page once the dialog reaches its scroll boundary—or immediately if the dialog's content does not overflow.
7
+
8
+ Per the CSS Overscroll Behavior specification, `overscroll-behavior` applies to **all scroll container elements**, including non-scrollable scroll containers (elements with `overflow: hidden`, or `overflow: auto` whose content does not currently overflow). By combining `overscroll-behavior: contain` on the `<dialog>` with `overflow: hidden` and `overscroll-behavior: contain` on `dialog::backdrop`, you can prevent the underlying page from scrolling using pure CSS.
9
+
10
+ ## Implementation
11
+
12
+ ### 1. Contain scroll chaining on the `<dialog>`
13
+
14
+ The user-agent stylesheet sets `overflow: auto` on `<dialog>`, making it a scroll container by default. Apply `overscroll-behavior: contain` (or `none`) to `dialog:modal` (or `dialog`).
15
+
16
+ ### 2. Turn `::backdrop` into a scroll container and contain its scroll
17
+
18
+ By default, `dialog::backdrop` has `overflow: visible`, which means it is **not** a scroll container and ignores `overscroll-behavior`. You must set `overflow: hidden` on `dialog::backdrop` to make it a non-scrollable scroll container, and pair it with `overscroll-behavior: contain` so scroll gestures performed over the backdrop are trapped and do not reach the document underneath.
19
+
20
+ ## Example Code
21
+
22
+ ```css
23
+ dialog:modal {
24
+ /* MANDATORY: Prevent scroll gestures inside the modal (even when its content
25
+ does not overflow) from chaining to the underlying page. */
26
+ overscroll-behavior: contain;
27
+ }
28
+
29
+ dialog::backdrop {
30
+ /* MANDATORY: ::backdrop defaults to overflow: visible (not a scroll container).
31
+ Set overflow: hidden so it becomes a non-scrollable scroll container that
32
+ honors overscroll-behavior. */
33
+ overflow: hidden;
34
+ overscroll-behavior: contain;
35
+ }
36
+ ```
37
+
38
+ ## Best Practices & Constraints
39
+
40
+ - **MANDATORY**: Set `overscroll-behavior: contain` on the `<dialog>` element itself (using the `dialog:modal` selector) and the `dialog::backdrop`. Without this declaration, scroll gestures over the backdrop or inside the dialog will still chain to the page.
41
+ - **MANDATORY**: Set `overflow: hidden` (or `overflow: auto`) on `dialog::backdrop` so that it becomes a scroll container. Without this declaration `::backdrop` defaults to `overflow: visible` and `overscroll-behavior` will have no effect.
42
+ - **DO NOT** use `overflow: clip` or `overflow: visible` on `dialog::backdrop` or `dialog`. Neither value establishes a scroll container, so `overscroll-behavior` will not apply.
43
+ - **DO NOT** apply `overflow: hidden` or `position: fixed` to `<html>` or `<body>` to lock background scrolling when a dialog opens. Mutating root overflow removes the page scrollbar (causing horizontal layout shift), can reset or jump the page scroll position, and can break `position: sticky` elements on the underlying page.
44
+
45
+ ## Fallback Strategies
46
+
47
+ Browser support for overscroll-behavior: Limited availability.
48
+ Supported by: Chrome 144 (Jan 2026), Edge 144 (Jan 2026), and Firefox 150 (Apr 2026).
49
+ Unsupported in: Safari.
50
+
51
+ While the `overscroll-behavior` CSS property is supported across all major browsers for scroll containers that have overflowing content, respecting `overscroll-behavior` on **non-scrollable** scroll containers is a newer specification that cannot be feature detected.
52
+
53
+ **DO NOT** attempt to feature-detect non-scrollable container support with `@supports (overscroll-behavior: contain)` or `CSS.supports('overscroll-behavior', 'contain')`. All modern browsers support the `overscroll-behavior: contain` property syntax and return `true`, even if they only enforce it when content overflows.
54
+
55
+ Instead, treat scroll containment on non-scrollable scroll containers as a **progressive enhancement**:
56
+
57
+ - In browsers that support `overscroll-behavior` on non-scrollable scroll containers, background page scrolling is completely prevented both over `dialog::backdrop` and inside the `<dialog>` (whether or not its content overflows).
58
+ - In browsers that do not yet support `overscroll-behavior` on non-scrollable scroll containers, `overscroll-behavior: contain` on `dialog` still prevents scroll chaining whenever the dialog's own content overflows and is scrollable. Meanwhile, `showModal()` still traps keyboard focus and marks the background document `inert`.
59
+ - Relying on progressive enhancement is recommended over legacy workarounds that apply `overflow: hidden` or `position: fixed` to `<html>` or `<body>`, because it does not remove the root scrollbar, cause horizontal layout shifts, jump the page scroll position, or break `position: sticky` elements on the underlying page.
@@ -0,0 +1,141 @@
1
+ # Search hidden content
2
+
3
+ Web interfaces often hide content from view to improve the user experience, save screen space, or increase page performance. Traditional methods like `display: none` or `visibility: hidden` work to hide content visually, but they also make that content completely inaccessible to screen readers and browser features like "Find in page".
4
+
5
+ To hide content visually but still allow it to be searchable by users and enable it to be deep linked to via URL fragments and "Scroll to Text Fragment" links, you can use either the HTML `<details>` element or the `hidden="until-found"` attribute. The `<details>` element is generally recommended as it's simpler to implement and maintain, but there are some more complex cases where `<details>` is not sufficient and `hidden="until-found"` is required.
6
+
7
+ For example:
8
+
9
+ - If you want full control over the styling of the show/hide mechanism.
10
+ - If the UI controls to show/hide the content are in another part of the DOM.
11
+ - If you don't want to support hiding the content after it's shown.
12
+
13
+ ## How to implement
14
+
15
+ The `<details>` element has searchable and accessible text by default, and no special implementation is required. Prefer using `<details>` over `hidden="until-found"` if possible.
16
+
17
+ If you need to use `hidden="until-found"` instead, follow these instructions:
18
+
19
+ 1. **Apply the attribute:** Add the `hidden="until-found"` HTML attribute directly to the elements containing the content that should be hidden from view.
20
+ 2. **Synchronize UI state:** If the interface has related states that depend on the content's visibility (e.g., updating ARIA attributes, toggling open/close CSS classes, or rotating accordion icons):
21
+ - You **MUST** add an event listener for the `beforematch` event.
22
+ - Register the `beforematch` event listener directly on the element carrying the `hidden="until-found"` attribute. Since the event bubbles, you may alternatively use event delegation by registering a single listener on a parent element (such as a tab container) to manage multiple hidden sections at once.
23
+ - Inside the event listener, execute the logic to synchronize related UI elements (such as closing other open tabs or changing the state of a toggle button).
24
+
25
+ ## Example code
26
+
27
+ **Goal:** Render a hidden container where the content remains invisible to the user until they search for a word within that section.
28
+
29
+ ### Using `<details>` element
30
+
31
+ ```html
32
+ <details>
33
+ <summary>Click to expand</summary>
34
+ <p>This content is visually hidden.</p>
35
+ </details>
36
+ ```
37
+
38
+ #### Mutually exclusive disclosures
39
+
40
+ When handling mutually exclusive content regions, like an exclusive accordion, use the native HTML `<details>` element with a shared `name` attribute.
41
+
42
+ ```html
43
+ <div class="accordion-group">
44
+ <!-- The name attribute creates an exclusive disclosure group -->
45
+ <details class="disclosure" name="my-accordion">
46
+ <summary>Section 1</summary>
47
+ <p>Section 1 content</p>
48
+ </details>
49
+
50
+ <details class="disclosure" name="my-accordion" open>
51
+ <summary>Section 2</summary>
52
+ <p>Section 2 content</p>
53
+ </details>
54
+
55
+ <details class="disclosure" name="my-accordion">
56
+ <summary>Section 3</summary>
57
+ <p>Section 3 content</p>
58
+ </details>
59
+ </div>
60
+ ```
61
+
62
+ ### Using `hidden="until-found"` attribute
63
+
64
+ ```html
65
+ <!-- The browser automatically removes hidden="until-found" upon a search match -->
66
+ <div class="hidden-container" hidden="until-found">
67
+ <p>This content is visually hidden.</p>
68
+ </div>
69
+ ```
70
+
71
+ #### Custom mutually exclusive disclosures
72
+
73
+ When handling custom mutually exclusive regions controlled by external buttons, ensure only the matched panel remains visible. In the `beforematch` event handler, you MUST synchronize related ARIA states such as setting `aria-expanded="true"` on the controlling button.
74
+
75
+ ```html
76
+ <div class="custom-accordion">
77
+ <div class="controls">
78
+ <button aria-expanded="true" aria-controls="panel-1" id="btn-1">Section 1</button>
79
+ <button aria-expanded="false" aria-controls="panel-2" id="btn-2">Section 2</button>
80
+ </div>
81
+
82
+ <div id="panel-1" class="panel">
83
+ <p>Section 1 content (visible)</p>
84
+ </div>
85
+
86
+ <div id="panel-2" class="panel" hidden="until-found">
87
+ <p>Section 2 content (hidden)</p>
88
+ </div>
89
+ </div>
90
+ ```
91
+
92
+ ```javascript
93
+ const accordion = document.querySelector('.custom-accordion');
94
+
95
+ accordion.addEventListener('beforematch', (e) => {
96
+ // Hide all panels and synchronize button states before the browser reveals the matched panel
97
+ accordion.querySelectorAll('.panel').forEach((panel) => {
98
+ if (panel !== e.target) {
99
+ panel.hidden = 'until-found';
100
+ }
101
+ });
102
+ accordion.querySelectorAll('button').forEach((btn) => {
103
+ const controls = btn.getAttribute('aria-controls');
104
+ btn.setAttribute('aria-expanded', controls === e.target.id ? 'true' : 'false');
105
+ });
106
+ });
107
+ ```
108
+
109
+ ## Best practices for `hidden="until-found"`
110
+
111
+ - **DO** apply borders, padding, and backgrounds to nested child wrappers rather than directly to the element with the `hidden="until-found"` attribute. This prevents unintended layout shifts or visual remnants while the element is hidden.
112
+ - **DO NOT** apply `display: none`, `visibility: hidden`, or any associated `display` or `visibility` CSS properties directly to elements with the `hidden="until-found"` attribute. This breaks the native functionality and permanently hides the content from the search index.
113
+ - **DO NOT** use `hidden="until-found"` for sensitive information, internal data tokens, or irrelevant data that should not be exposed via search.
114
+ - **DO NOT** use `hidden="until-found"` as a replacement for "screen reader only" (.sr-only) text.
115
+
116
+ ## Browser support and fallback strategies
117
+
118
+ Baseline status for <details>: Widely available. It's been Baseline since 2020-01-15.
119
+ Supported by: Chrome 12 (Jun 2011), Edge 79 (Jan 2020), Firefox 49 (Sep 2016), and Safari 6 (Jul 2012).
120
+
121
+ Browser support for hidden="until-found": Limited availability.
122
+ Supported by: Chrome 102 (May 2022), Edge 102 (May 2022), and Firefox 148 (Feb 2026).
123
+ Unsupported in: Safari.
124
+
125
+ **DO NOT** avoid `hidden="until-found"` because of missing browser support, as its accessibility benefits far outweigh the cost of implementing a fallback.
126
+
127
+ #### `hidden="until-found"` fallback
128
+
129
+ For standard UI elements like accordions or "Read more" sections, use JavaScript to feature-detect and show all content if the feature is unsupported.
130
+
131
+ ```javascript
132
+ if (!('onbeforematch' in HTMLElement.prototype)) {
133
+ // Expand all hidden content for unsupported browsers
134
+ document.querySelectorAll('[hidden="until-found"]').forEach((el) => {
135
+ el.removeAttribute('hidden');
136
+ // MANDATORY: also update any aria references to this element.
137
+ });
138
+ }
139
+ ```
140
+
141
+ For mutually exclusive UI paradigms (like custom exclusive panels where content shares the same visual region), the fallback should extract and display all content linearly below the main interactive area, using URL anchor fragments to allow users to navigate directly to the respective sections.
@@ -0,0 +1,140 @@
1
+ # Sortable Table
2
+
3
+ Use this pattern to let users sort a data table by clicking its column headers. Start from a complete, semantic `<table>` that is readable without JavaScript, then enhance it.
4
+
5
+ This guide covers the header controls, sort state, sorting logic, and applying the new order to the DOM. For keeping state inside rows while they move, see `move-dom-element-without-losing-state`. For other narrow-screen table patterns, see `responsive-table` (references/ui-atoms/responsive-table.md).
6
+
7
+ For sorting lists and card grids that are not tables, see `dynamic-sort`.
8
+
9
+ ## Header markup
10
+
11
+ * **MANDATORY:** Put a `<button type="button">` inside each sortable `<th scope="col">`. Do not make the `<th>` itself clickable, and do not use `<a>` or `role="button"`.
12
+ * Set `aria-sort="ascending"` or `aria-sort="descending"` on the `<th>` of the currently sorted column only, and remove it from all other headers. Do not set `aria-sort="none"`, and do not put `aria-sort` on the button.
13
+ * Leave non-sortable columns as plain `<th>` text with no button. Keep their padding, alignment and font weight matching the sortable headers: drop the cell padding only on `th:has(> button)`, since the button supplies it.
14
+ * Keep the table's `<caption>` as its accessible name, and keep data rows in a `<tbody>` so sorting reorders only body rows and never the `<thead>` row.
15
+ * Use a decorative icon for the sort direction (`aria-hidden="true"`, `currentColor`, see `icons`). Drive its appearance from `th[aria-sort]` in CSS, not from extra classes or JavaScript. The icon is visual only and hidden from assistive technology, so always convey the sort state with `aria-sort` on the `<th>`.
16
+ * Give the button a minimum 24px target and a `:focus-visible` outline. Make it fill the cell.
17
+
18
+ ## Wire buttons with invoker commands
19
+
20
+ Use `commandfor` pointing at the table and a custom `--sort` command (custom commands must start with `--`). Handle it with one `command` listener on the table instead of a click listener per button. `event.source` is the button that was activated.
21
+
22
+ ```html
23
+ <th scope="col" data-type="number">
24
+ <button type="button" commandfor="planets" command="--sort">
25
+ Moons
26
+ </button>
27
+ </th>
28
+ ```
29
+
30
+ ```javascript
31
+ table.addEventListener('command', (event) => {
32
+ if (event.command !== '--sort') return;
33
+
34
+ const th = event.source.closest('th');
35
+ const direction = th.getAttribute('aria-sort') === 'ascending' ? 'descending' : 'ascending';
36
+
37
+ for (const header of table.tHead.rows[0].cells) header.removeAttribute('aria-sort');
38
+ th.setAttribute('aria-sort', direction);
39
+
40
+ const rows = sortRows([...tbody.rows], th.cellIndex, th.dataset.type, direction);
41
+ reorderWithTransition(rows);
42
+ // One message per sort; the status element must already be in the DOM.
43
+ status.textContent = `Sorted by ${event.source.textContent.trim()}, ${direction}, ${rows.length} rows`;
44
+ });
45
+ ```
46
+
47
+ * The first activation sorts ascending; each repeat toggles direction. Switching columns starts ascending again.
48
+ * Keep focus on the header button that was activated.
49
+
50
+ ## Compare values correctly
51
+
52
+ * Compare text with `Intl.Collator` (`numeric: true, sensitivity: 'base'`), not `<` or `localeCompare` in a loop.
53
+ * Compare numbers, dates and currency as numbers. Read the raw value from a `data-value` attribute (or `<time datetime>`) when the displayed text is formatted, for example `12,104` or `$1.2k`.
54
+ * Declare the type per column with `data-type` rather than guessing from content.
55
+ * `Array.prototype.sort` is stable, so equal rows keep their previous relative order.
56
+
57
+ ```javascript
58
+ const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });
59
+
60
+ function sortRows(rows, index, type, direction) {
61
+ const factor = direction === 'ascending' ? 1 : -1;
62
+ // Prefer the raw value when the displayed text is formatted.
63
+ // This reads the DOM on every comparison; for large tables, read each row's value once before sorting.
64
+ const value = (row) => row.cells[index].dataset.value ?? row.cells[index].textContent.trim();
65
+ return rows.sort((a, b) =>
66
+ factor * (type === 'number' ? value(a) - value(b) : collator.compare(value(a), value(b)))
67
+ );
68
+ }
69
+ ```
70
+
71
+ ## Reorder the existing rows
72
+
73
+ **MANDATORY:** Move the existing `<tr>` elements within the `<tbody>`. Do not rebuild the table or `<tbody>` with `innerHTML` or a re-render: that discards focus and state inside rows and breaks view transitions, which match old and new elements by identity. Never move the header row.
74
+
75
+ ```javascript
76
+ // Moving every row to the end in sorted order is enough; no need to compute minimal moves.
77
+ function reorder(container, orderedRows) {
78
+ for (const row of orderedRows) container.moveBefore(row, null);
79
+ }
80
+ ```
81
+
82
+ **DO NOT** fake the order with CSS `order`; DOM order must match visual order for keyboard and screen reader users.
83
+
84
+ ## Optionally animate the reorder
85
+
86
+ Animation is an enhancement; the sort works without it. For when to animate, reduced-motion handling and rapid-click behavior, see `dynamic-sort`. Skip it for large tables.
87
+
88
+ ```css
89
+ tbody tr {
90
+ /* Derives a unique name from each row's identity. */
91
+ view-transition-name: match-element;
92
+ }
93
+
94
+ @media (prefers-reduced-motion: reduce) {
95
+ ::view-transition-group(*),
96
+ ::view-transition-old(*),
97
+ ::view-transition-new(*) {
98
+ animation: none;
99
+ }
100
+ }
101
+ ```
102
+
103
+ ```javascript
104
+ // Scoped to the table so the rest of the page stays interactive during the animation.
105
+ function reorderWithTransition(rows) {
106
+ table.startViewTransition(() => reorder(tbody, rows));
107
+ }
108
+ ```
109
+
110
+ * **DO NOT** put `aria-live` on the table: it would announce every moved row. Use the single `role="status"` element instead, hidden visually (not with `display: none`) using `clip-path: inset(50%)` and a 1px size.
111
+
112
+ ## Narrow screens
113
+
114
+ Wrap the table in a horizontally scrollable container (`overflow-x: auto`) with `role="region"`, an accessible name from the caption via `aria-labelledby`, and `tabindex="0"` so keyboard users can scroll it. Give the table a `min-inline-size` so columns do not collapse.
115
+
116
+ ## Common mistakes
117
+
118
+ * **DO NOT** re-render the `<tbody>` or `<table>` on sort; it discards focus and state and breaks view transitions.
119
+ * **DO NOT** put `aria-live` on the table, or announce each row.
120
+ * **DO NOT** leave `aria-sort` on more than one header.
121
+ * **DO NOT** change the button's label to describe the action ("Sort ascending"). Keep the column name; `aria-sort` conveys state.
122
+ * **DO NOT** sort formatted strings when the underlying values are numbers or dates.
123
+
124
+ ## Fallbacks
125
+
126
+ Baseline status for Invoker commands: Newly available. It's been Baseline since 2025-12-12.
127
+ Supported by: Chrome 135 (Apr 2025), Edge 135 (Apr 2025), Firefox 144 (Oct 2025), and Safari 26.2 (Dec 2025).
128
+
129
+ If your Baseline target does not support invoker commands, add a `click` listener to each header button that runs the same sort function. Behavior is identical. The buttons do nothing without JavaScript either way, so add them from script if the table must stay fully readable without it.
130
+
131
+ Browser support for Element-scoped view transitions: Limited availability.
132
+ Supported by: Chrome 147 (Apr 2026) and Edge 147 (Apr 2026).
133
+ Unsupported in: Firefox and Safari.
134
+
135
+ Browser support for moveBefore(): Limited availability.
136
+ Supported by: Chrome 133 (Feb 2025), Edge 133 (Feb 2025), and Firefox 144 (Oct 2025).
137
+ Unsupported in: Safari.
138
+
139
+ If your Baseline target does not support `moveBefore()` or element-scoped view transitions, follow the fallbacks in `dynamic-sort`; the table still sorts and the announcement is unchanged.
140
+