diff --git a/.agent/skills/basalt-html/parts/icons.json b/.agent/skills/basalt-html/parts/icons.json
index 2a8d11fa..748d4ebe 100644
--- a/.agent/skills/basalt-html/parts/icons.json
+++ b/.agent/skills/basalt-html/parts/icons.json
@@ -1 +1 @@
-{"notice":"/*! The icon paths below are from Phosphor Icons (@phosphor-icons/react):\nMIT License\n\nCopyright (c) 2020 Phosphor Icons\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/","icons":{"Command":["M180,140H164V116h16a40,40,0,1,0-40-40V92H116V76a40,40,0,1,0-40,40H92v24H76a40,40,0,1,0,40,40V164h24v16a40,40,0,1,0,40-40ZM164,76a16,16,0,1,1,16,16H164ZM60,76a16,16,0,0,1,32,0V92H76A16,16,0,0,1,60,76ZM92,180a16,16,0,1,1-16-16H92Zm24-64h24v24H116Zm64,80a16,16,0,0,1-16-16V164h16a16,16,0,0,1,0,32Z"],"Option":["M236,192a12,12,0,0,1-12,12H160.94a19.89,19.89,0,0,1-17.88-11.06L92.58,92H32a12,12,0,0,1,0-24H95.06a19.89,19.89,0,0,1,17.88,11.06L163.42,180H224A12,12,0,0,1,236,192ZM152,92h72a12,12,0,0,0,0-24H152a12,12,0,0,0,0,24Z"],"Control":["M208.49,128.49a12,12,0,0,1-17,0L128,65,64.49,128.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,128.49Z"],"Sun":["M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"],"Moon":["M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"],"Info":["M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"],"Warning":["M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"],"ArrowRight":["M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"],"ArrowLeft":["M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"],"ArrowUp":["M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"],"ArrowDown":["M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"],"CaretUpDown":["M184.49,167.51a12,12,0,0,1,0,17l-48,48a12,12,0,0,1-17,0l-48-48a12,12,0,0,1,17-17L128,207l39.51-39.52A12,12,0,0,1,184.49,167.51Zm-96-79L128,49l39.51,39.52a12,12,0,0,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,0,0,17,17Z"],"Trash":["M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"],"Download":["M71.51,88.49a12,12,0,0,1,17-17L116,99V24a12,12,0,0,1,24,0V99l27.51-27.52a12,12,0,0,1,17,17l-48,48a12,12,0,0,1-17,0ZM224,116H188a12,12,0,0,0,0,24h32v56H36V140H68a12,12,0,0,0,0-24H32a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V136A20,20,0,0,0,224,116Zm-20,52a16,16,0,1,0-16,16A16,16,0,0,0,204,168Z"],"ArrowClockwise":["M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"],"CheckCircle":["M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"],"XCircle":["M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"],"GithubLogo":["M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"],"XLogo":["M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"],"LinkedinLogo":["M216,20H40A20,20,0,0,0,20,40V216a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V40A20,20,0,0,0,216,20Zm-4,192H44V44H212ZM112,176V120a12,12,0,0,1,21.43-7.41A40,40,0,0,1,192,148v28a12,12,0,0,1-24,0V148a16,16,0,0,0-32,0v28a12,12,0,0,1-24,0ZM96,120v56a12,12,0,0,1-24,0V120a12,12,0,0,1,24,0ZM68,80A16,16,0,1,1,84,96,16,16,0,0,1,68,80Z"],"InstagramLogo":["M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,72a24,24,0,1,1,24-24A24,24,0,0,1,128,152ZM176,20H80A60.07,60.07,0,0,0,20,80v96a60.07,60.07,0,0,0,60,60h96a60.07,60.07,0,0,0,60-60V80A60.07,60.07,0,0,0,176,20Zm36,156a36,36,0,0,1-36,36H80a36,36,0,0,1-36-36V80A36,36,0,0,1,80,44h96a36,36,0,0,1,36,36ZM196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Z"],"YoutubeLogo":["M170.49,117.91l-56-36A12,12,0,0,0,96,92v72a12,12,0,0,0,18.49,10.09l56-36a12,12,0,0,0,0-20.18ZM120,142V114l21.81,14Zm118.21-73.5a28.05,28.05,0,0,0-16.93-19.14C186.4,35.91,131.29,36,128,36s-58.4-.09-93.28,13.38A28.05,28.05,0,0,0,17.79,68.52C15.15,78.72,12,97.32,12,128s3.15,49.28,5.79,59.48a28.05,28.05,0,0,0,16.93,19.14C68.21,219.55,120.36,220,127.37,220h1.26c7,0,59.16-.45,92.65-13.38a28.05,28.05,0,0,0,16.93-19.14c2.64-10.2,5.79-28.8,5.79-59.48S240.85,78.72,238.21,68.52ZM215,181.46a4,4,0,0,1-2.34,2.77C182.78,195.76,132.27,196,128.32,196h-.39c-.53,0-53.64.17-84.56-11.77A4,4,0,0,1,41,181.46c-1.88-7.24-5-23.82-5-53.46s3.15-46.22,5-53.46a4,4,0,0,1,2.34-2.77C74.29,59.83,127.39,60,127.92,60h.15c.54,0,53.64-.17,84.56,11.77A4,4,0,0,1,215,74.54c1.88,7.24,5,23.82,5,53.46S216.85,174.22,215,181.46Z"],"EnvelopeSimple":["M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM193.15,68,128,127.72,62.85,68ZM44,188V83.28l75.89,69.57a12,12,0,0,0,16.22,0L212,83.28V188Z"],"TerminalWindow":["M72.5,150.63,100.79,128,72.5,105.37a12,12,0,1,1,15-18.74l40,32a12,12,0,0,1,0,18.74l-40,32a12,12,0,0,1-15-18.74ZM144,172h32a12,12,0,0,0,0-24H144a12,12,0,0,0,0,24ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"]}}
+{"notice":"/*! The icon paths below are from Phosphor Icons (@phosphor-icons/react):\nMIT License\n\nCopyright (c) 2020 Phosphor Icons\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/","icons":{"Command":["M180,140H164V116h16a40,40,0,1,0-40-40V92H116V76a40,40,0,1,0-40,40H92v24H76a40,40,0,1,0,40,40V164h24v16a40,40,0,1,0,40-40ZM164,76a16,16,0,1,1,16,16H164ZM60,76a16,16,0,0,1,32,0V92H76A16,16,0,0,1,60,76ZM92,180a16,16,0,1,1-16-16H92Zm24-64h24v24H116Zm64,80a16,16,0,0,1-16-16V164h16a16,16,0,0,1,0,32Z"],"Option":["M236,192a12,12,0,0,1-12,12H160.94a19.89,19.89,0,0,1-17.88-11.06L92.58,92H32a12,12,0,0,1,0-24H95.06a19.89,19.89,0,0,1,17.88,11.06L163.42,180H224A12,12,0,0,1,236,192ZM152,92h72a12,12,0,0,0,0-24H152a12,12,0,0,0,0,24Z"],"Control":["M208.49,128.49a12,12,0,0,1-17,0L128,65,64.49,128.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,128.49Z"],"Sun":["M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"],"Moon":["M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"],"Info":["M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"],"Warning":["M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"],"ArrowRight":["M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"],"ArrowLeft":["M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"],"ArrowUp":["M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"],"ArrowDown":["M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"],"CaretUpDown":["M184.49,167.51a12,12,0,0,1,0,17l-48,48a12,12,0,0,1-17,0l-48-48a12,12,0,0,1,17-17L128,207l39.51-39.52A12,12,0,0,1,184.49,167.51Zm-96-79L128,49l39.51,39.52a12,12,0,0,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,0,0,17,17Z"],"Trash":["M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"],"Download":["M71.51,88.49a12,12,0,0,1,17-17L116,99V24a12,12,0,0,1,24,0V99l27.51-27.52a12,12,0,0,1,17,17l-48,48a12,12,0,0,1-17,0ZM224,116H188a12,12,0,0,0,0,24h32v56H36V140H68a12,12,0,0,0,0-24H32a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V136A20,20,0,0,0,224,116Zm-20,52a16,16,0,1,0-16,16A16,16,0,0,0,204,168Z"],"ArrowClockwise":["M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"],"CheckCircle":["M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"],"XCircle":["M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"],"Circle":["M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"],"GithubLogo":["M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"],"XLogo":["M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"],"LinkedinLogo":["M216,20H40A20,20,0,0,0,20,40V216a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V40A20,20,0,0,0,216,20Zm-4,192H44V44H212ZM112,176V120a12,12,0,0,1,21.43-7.41A40,40,0,0,1,192,148v28a12,12,0,0,1-24,0V148a16,16,0,0,0-32,0v28a12,12,0,0,1-24,0ZM96,120v56a12,12,0,0,1-24,0V120a12,12,0,0,1,24,0ZM68,80A16,16,0,1,1,84,96,16,16,0,0,1,68,80Z"],"InstagramLogo":["M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,72a24,24,0,1,1,24-24A24,24,0,0,1,128,152ZM176,20H80A60.07,60.07,0,0,0,20,80v96a60.07,60.07,0,0,0,60,60h96a60.07,60.07,0,0,0,60-60V80A60.07,60.07,0,0,0,176,20Zm36,156a36,36,0,0,1-36,36H80a36,36,0,0,1-36-36V80A36,36,0,0,1,80,44h96a36,36,0,0,1,36,36ZM196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Z"],"YoutubeLogo":["M170.49,117.91l-56-36A12,12,0,0,0,96,92v72a12,12,0,0,0,18.49,10.09l56-36a12,12,0,0,0,0-20.18ZM120,142V114l21.81,14Zm118.21-73.5a28.05,28.05,0,0,0-16.93-19.14C186.4,35.91,131.29,36,128,36s-58.4-.09-93.28,13.38A28.05,28.05,0,0,0,17.79,68.52C15.15,78.72,12,97.32,12,128s3.15,49.28,5.79,59.48a28.05,28.05,0,0,0,16.93,19.14C68.21,219.55,120.36,220,127.37,220h1.26c7,0,59.16-.45,92.65-13.38a28.05,28.05,0,0,0,16.93-19.14c2.64-10.2,5.79-28.8,5.79-59.48S240.85,78.72,238.21,68.52ZM215,181.46a4,4,0,0,1-2.34,2.77C182.78,195.76,132.27,196,128.32,196h-.39c-.53,0-53.64.17-84.56-11.77A4,4,0,0,1,41,181.46c-1.88-7.24-5-23.82-5-53.46s3.15-46.22,5-53.46a4,4,0,0,1,2.34-2.77C74.29,59.83,127.39,60,127.92,60h.15c.54,0,53.64-.17,84.56,11.77A4,4,0,0,1,215,74.54c1.88,7.24,5,23.82,5,53.46S216.85,174.22,215,181.46Z"],"EnvelopeSimple":["M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM193.15,68,128,127.72,62.85,68ZM44,188V83.28l75.89,69.57a12,12,0,0,0,16.22,0L212,83.28V188Z"],"TerminalWindow":["M72.5,150.63,100.79,128,72.5,105.37a12,12,0,1,1,15-18.74l40,32a12,12,0,0,1,0,18.74l-40,32a12,12,0,0,1-15-18.74ZM144,172h32a12,12,0,0,0,0-24H144a12,12,0,0,0,0,24ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"]}}
diff --git a/.agent/skills/basalt-html/parts/manifest.json b/.agent/skills/basalt-html/parts/manifest.json
index 1d853b0b..75cdfd9b 100644
--- a/.agent/skills/basalt-html/parts/manifest.json
+++ b/.agent/skills/basalt-html/parts/manifest.json
@@ -1072,7 +1072,11 @@
"notification-text",
"notification-title",
"notification-line",
- "notification-time"
+ "notification-time",
+ "notification-head",
+ "notification-count",
+ "notification-caret",
+ "notification-entries"
],
"text": [
"Basalt\\s*\\.\\s*notifications\\b"
@@ -1087,9 +1091,10 @@
"icons": [
"CheckCircle",
"Warning",
- "XCircle"
+ "XCircle",
+ "Circle"
],
- "budget": 9550,
+ "budget": 12450,
"usage": 1100,
"builds": [
"popover",
diff --git a/.agent/skills/basalt-html/parts/notifications.css b/.agent/skills/basalt-html/parts/notifications.css
index af4eeacb..3f0daedc 100644
--- a/.agent/skills/basalt-html/parts/notifications.css
+++ b/.agent/skills/basalt-html/parts/notifications.css
@@ -1 +1 @@
-@layer basalt{.notifications-dot{position:absolute;top:var(--basalt-space-1-5);right:var(--basalt-space-1-5);width:var(--basalt-size-dot);height:var(--basalt-size-dot);border-radius:var(--basalt-radius-full);background:var(--basalt-text-primary);pointer-events:none}.popover.notifications:popover-open{display:flex}.popover.notifications{flex-direction:column;width:min(var(--basalt-size-toast-width),calc(100vw - 2 * var(--basalt-space-4)));max-width:none;max-height:var(--available-height, 100vh);padding:0;overflow:hidden}.notifications-head{display:flex;align-items:center;gap:var(--basalt-space-2);padding:var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-4);border-bottom:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.notifications-title{flex:none;line-height:var(--basalt-text-base-line-height)}.notifications-count{flex:1;min-width:0;font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);color:var(--basalt-text-secondary);font-variant-numeric:tabular-nums}.notifications-mark{flex:none}.notifications-foot{display:flex;justify-content:flex-end;padding:var(--basalt-space-2-5);border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.notifications-clear{margin-inline-end:auto}.notifications-empty{margin:0;padding:var(--basalt-space-6) var(--basalt-space-4);text-align:center;color:var(--basalt-text-secondary)}.notifications-scroll{position:relative;flex:1;min-height:0;overflow-y:auto}.notifications-list{margin:0;padding:var(--basalt-space-1-5);list-style:none}.notification{--_inset: var(--basalt-space-0-5);box-sizing:border-box;position:relative;isolation:isolate;display:grid;grid-template-columns:var(--basalt-size-dot) var(--basalt-size-icon-sm) minmax(0,1fr) auto;align-items:start;column-gap:var(--basalt-space-2-5);width:100%;margin:0;padding:calc(var(--basalt-space-2) + var(--_inset)) var(--basalt-space-3);border:0;border-radius:calc(var(--basalt-radius-md) + var(--_inset));background:none;color:var(--basalt-text-secondary);font:var(--basalt-font-weight-regular) var(--bh-base);text-align:start;text-decoration:none;cursor:pointer;user-select:none}@media(pointer:coarse){.notification{min-height:var(--basalt-size-tap-min);align-content:center}}.notification:before{content:"";position:absolute;inset:var(--_inset) 0;z-index:-1;border-radius:var(--basalt-radius-md);background-color:transparent;transition:background-color var(--basalt-duration-fast) var(--basalt-ease-out)}.notification:hover:before{background-color:var(--panel-plate);transition-duration:var(--basalt-duration-instant)}.notifications-scroll[data-keys] .notification:hover:before{background-color:transparent}.notification:focus-visible{outline:var(--basalt-size-focus-width) solid var(--basalt-border-focus);outline-offset:calc(var(--basalt-size-focus-offset) - var(--_inset))}.notification-dot{width:var(--basalt-size-dot);height:var(--basalt-size-dot);margin-top:calc((var(--basalt-text-base-line-height) - var(--basalt-size-dot)) / 2);border-radius:var(--basalt-radius-full)}.notification[data-unread] .notification-dot{background:var(--basalt-text-primary)}.notification-mark{display:grid;place-items:center;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);margin-top:calc((var(--basalt-text-base-line-height) - var(--basalt-size-icon-sm)) / 2)}.notification[data-status=success] .notification-mark{color:var(--basalt-status-success)}.notification[data-status=warning] .notification-mark{color:var(--basalt-status-warning)}.notification[data-status=danger] .notification-mark{color:var(--basalt-status-danger)}.notification-text{display:flex;flex-direction:column;min-width:0}.notification-title,.notification-line{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.notification[data-unread] .notification-title,.notification:hover .notification-title{color:var(--basalt-text-primary)}.notification-line{font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);color:var(--basalt-text-tertiary)}.notification-time{margin-top:calc(var(--basalt-space-0-5) / 2);font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--basalt-text-tertiary)}.notification:hover .notification-line,.notification:hover .notification-time{color:var(--basalt-text-secondary)}@media(prefers-reduced-motion:no-preference)and (forced-colors:none)and (hover:hover)and (pointer:fine){.notifications-scroll[data-glide] .notification:before{background-color:transparent}}@media(forced-colors:active){.notifications-dot,.notification[data-unread] .notification-dot{box-sizing:border-box;border:calc(var(--basalt-size-dot) / 2) solid;background:none}.notification[data-status] .notification-mark{color:CanvasText}.notification:hover{forced-color-adjust:none;background:Highlight;color:HighlightText}.notification:hover:before{background-color:transparent}.notification:hover :is(.notification-title,.notification-line,.notification-time,.notification-mark){color:HighlightText}}}
+@layer basalt{.notifications-dot{position:absolute;top:var(--basalt-space-1-5);right:var(--basalt-space-1-5);width:var(--basalt-size-dot);height:var(--basalt-size-dot);border-radius:var(--basalt-radius-full);background:var(--basalt-text-primary);pointer-events:none}.popover.notifications:popover-open{display:flex}.popover.notifications{flex-direction:column;width:min(var(--basalt-size-toast-width),calc(100vw - 2 * var(--basalt-space-4)));max-width:none;max-height:var(--available-height, 100vh);padding:0;overflow:hidden}.notifications-head{display:flex;align-items:center;gap:var(--basalt-space-2);padding:var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-4);border-bottom:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.notifications-title{flex:none;line-height:var(--basalt-text-base-line-height)}.notifications-count{flex:1;min-width:0;font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);color:var(--basalt-text-secondary);font-variant-numeric:tabular-nums}.notifications-mark{flex:none}.notifications-foot{display:flex;justify-content:flex-end;padding:var(--basalt-space-2-5);border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.notifications-clear{margin-inline-end:auto}.notifications-empty{margin:0;padding:var(--basalt-space-6) var(--basalt-space-4);text-align:center;color:var(--basalt-text-secondary)}.notifications-scroll{position:relative;flex:1;min-height:0;overflow-y:auto}.notifications-list{margin:0;padding:var(--basalt-space-1-5);list-style:none}.notification{--_inset: var(--basalt-space-0-5);box-sizing:border-box;position:relative;isolation:isolate;display:grid;grid-template-columns:var(--basalt-size-dot) var(--basalt-size-icon-sm) minmax(0,1fr) auto;align-items:start;column-gap:var(--basalt-space-2-5);width:100%;margin:0;padding:calc(var(--basalt-space-2) + var(--_inset)) var(--basalt-space-3);border:0;border-radius:calc(var(--basalt-radius-md) + var(--_inset));background:none;color:var(--basalt-text-secondary);font:var(--basalt-font-weight-regular) var(--bh-base);text-align:start;text-decoration:none;cursor:pointer;user-select:none}@media(pointer:coarse){.notification{min-height:var(--basalt-size-tap-min);align-content:center}}.notification:before{content:"";position:absolute;inset:var(--_inset) 0;z-index:-1;border-radius:var(--basalt-radius-md);background-color:transparent;transition:background-color var(--basalt-duration-fast) var(--basalt-ease-out)}.notification:hover:before{background-color:var(--panel-plate);transition-duration:var(--basalt-duration-instant)}.notifications-scroll[data-keys] .notification:hover:before{background-color:transparent}.notification:focus-visible{outline:var(--basalt-size-focus-width) solid var(--basalt-border-focus);outline-offset:calc(var(--basalt-size-focus-offset) - var(--_inset))}.notification-dot{width:var(--basalt-size-dot);height:var(--basalt-size-dot);margin-top:calc((var(--basalt-text-base-line-height) - var(--basalt-size-dot)) / 2);border-radius:var(--basalt-radius-full)}.notification[data-unread] .notification-dot{background:var(--basalt-text-primary)}.notification-mark{display:grid;place-items:center;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);margin-top:calc((var(--basalt-text-base-line-height) - var(--basalt-size-icon-sm)) / 2)}.notification[data-status=success] .notification-mark{color:var(--basalt-status-success)}.notification[data-status=warning] .notification-mark{color:var(--basalt-status-warning)}.notification[data-status=danger] .notification-mark{color:var(--basalt-status-danger)}.notification-text{display:flex;flex-direction:column;min-width:0}.notification-title,.notification-line{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.notification[data-unread] .notification-title,.notification:hover .notification-title{color:var(--basalt-text-primary)}.notification-line{font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);color:var(--basalt-text-tertiary)}.notification-time{margin-top:calc(var(--basalt-space-0-5) / 2);font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height);font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--basalt-text-tertiary)}.notification:hover .notification-line,.notification:hover .notification-time,.notification[data-status=pending] .notification-mark{color:var(--basalt-text-secondary)}.notification[data-current] .notification-title{color:var(--basalt-text-primary);font-weight:var(--basalt-font-weight-semibold)}.notification-head{display:flex;align-items:center;min-width:0}.notification-head>.notification-title{position:relative;flex:0 1 auto}.notification-count{flex:none;margin-inline-start:var(--basalt-space-1-5);font-variant-numeric:tabular-nums;color:var(--basalt-text-secondary)}.notification-caret{flex:none;margin-inline-start:var(--basalt-space-1);color:var(--basalt-text-secondary)}.notification[aria-expanded=true] .notification-caret{transform:rotate(90deg)}.notification[aria-expanded=false] .notification-caret:dir(rtl){transform:scaleX(-1)}.notification-entries{margin:0;padding:0;padding-inline-start:calc(var(--basalt-size-dot) + var(--basalt-size-icon-sm) + 2 * var(--basalt-space-2-5));list-style:none}@media(prefers-reduced-motion:no-preference)and (forced-colors:none)and (hover:hover)and (pointer:fine){.notifications-scroll[data-glide] .notification:before{background-color:transparent}}@media(forced-colors:active){.notifications-dot,.notification[data-unread] .notification-dot{box-sizing:border-box;border:calc(var(--basalt-size-dot) / 2) solid;background:none}.notification[data-status] .notification-mark{color:CanvasText}.notification:hover{forced-color-adjust:none;background:Highlight;color:HighlightText}.notification:hover:before{background-color:transparent}.notification-count,.notification-caret{color:CanvasText}.notification:hover :is(.notification-title,.notification-line,.notification-time,.notification-mark,.notification-count,.notification-caret){color:HighlightText}}}
diff --git a/.agent/skills/basalt-html/parts/notifications.js b/.agent/skills/basalt-html/parts/notifications.js
index 2d9dfd5e..29b2e6cb 100644
--- a/.agent/skills/basalt-html/parts/notifications.js
+++ b/.agent/skills/basalt-html/parts/notifications.js
@@ -1 +1 @@
-(function(m){"use strict";var n=m._,C=0,g={success:"CheckCircle",warning:"Warning",danger:"XCircle"},M=' ';function L(s,S){var i=S||{};typeof s=="string"&&(s=document.querySelector(s));var l="bh-notes-"+ ++C,f=i.label||"Notifications",o=i.entries||[];s.innerHTML=''+M+'
'+n.esc(f)+' Mark all as read Nothing yet.
';var c=s.firstElementChild,a=s.lastElementChild,E=c.querySelector(".notifications-dot"),q=a.querySelector(".notifications-count"),d=a.querySelector(".notifications-mark"),x=a.querySelector(".notifications-empty"),v=a.querySelector(".notifications-scroll"),y=a.querySelector(".notifications-list"),A=a.querySelector(".notifications-foot");A.innerHTML=(i.onClearAll?'Clear all ':"")+(i.viewAllHref?'View all ':'View all ');var H=A.lastElementChild,r=a.querySelector(".notifications-clear"),u;function p(){a.matches(":popover-open")&&a.hidePopover()}function k(){var e=o.reduce(function(t,b){return t+(b.unread?1:0)},0);c.setAttribute("aria-label",e>0?f+", "+e+" unread":f),E.hidden=e===0,q.textContent=e+" unread",e===0?d.setAttribute("aria-disabled","true"):d.removeAttribute("aria-disabled"),r&&(o.length===0?r.setAttribute("aria-disabled","true"):r.removeAttribute("aria-disabled")),x.hidden=o.length>0,v.hidden=o.length===0,y.innerHTML=o.map(function(t,b){var h=t.status||"neutral",w=t.href?"a":"button";return"<"+w+(t.href?' href="'+n.esc(t.href)+'"':' type="button"')+' class="notification" data-index="'+b+'"'+(t.unread?" data-unread":"")+' data-status="'+n.esc(h)+'">'+(g[h]?n.icon(g[h]):"")+' '+(t.unread?'Unread: ':"")+n.esc(t.title)+" "+(t.description?''+n.esc(t.description)+" ":"")+'"+n.esc(t.time)+" "+w+"> "}).join("")}return y.addEventListener("click",function(e){var t=e.target.closest(".notification");t&&(i.onSelect&&i.onSelect(o[Number(t.dataset.index)]),p())}),d.addEventListener("click",function(){d.getAttribute("aria-disabled")!=="true"&&i.onMarkAllRead&&i.onMarkAllRead()}),r&&r.addEventListener("click",function(){r.getAttribute("aria-disabled")!=="true"&&i.onClearAll()}),H.addEventListener("click",function(){i.onViewAll&&i.onViewAll(),p()}),a.addEventListener("toggle",function(e){e.newState==="open"?u=n.glide(v,v.firstElementChild,{active:".notification[data-hovered]",item:".notification"}):u&&(u(),u=null)}),k(),{element:a,button:c,setEntries:function(e){o=e||[],k()},open:function(){a.showPopover({source:c})},close:p}}m.notifications=L})(window.Basalt);
+(function(M){"use strict";var o=M._,T=0,L={success:"CheckCircle",warning:"Warning",danger:"XCircle",pending:"Circle"},j=' ',H=' ';function p(l){return!!(l.entries&&l.entries.length)}function S(l){var f=[];return l.forEach(function(i){if(!p(i))return f.push(i);var c=i.entries.filter(function(d){return d.status!=="danger"});c.length&&f.push(c.length===i.entries.length?i:Object.assign({},i,{entries:c})),i.entries.forEach(function(d){d.status==="danger"&&f.push(d)})}),f}function z(l,f){var i=f||{};typeof l=="string"&&(l=document.querySelector(l));var c="bh-notes-"+ ++T,d=i.label||"Notifications",u=S(i.entries||[]),k={};l.innerHTML=''+H+'
'+o.esc(d)+' Mark all as read Nothing yet.
';var h=l.firstElementChild,r=l.lastElementChild,B=h.querySelector(".notifications-dot"),R=r.querySelector(".notifications-count"),b=r.querySelector(".notifications-mark"),V=r.querySelector(".notifications-empty"),w=r.querySelector(".notifications-scroll"),g=r.querySelector(".notifications-list"),q=r.querySelector(".notifications-foot");q.innerHTML=(i.onClearAll?'Clear all ':"")+(i.viewAllHref?'View all ':'View all ');var I=q.lastElementChild,v=r.querySelector(".notifications-clear"),m;function C(){r.matches(":popover-open")&&r.hidePopover()}function P(t){return p(t)?t.entries.some(function(n){return!!n.unread}):!!t.unread}function E(t,n,e){var a=t.status||"neutral",s=e||!t.href?"button":"a",y=P(t),A=e?Number.isInteger(t.count)&&t.count>0?t.count:t.entries.length:0,N=''+(y?'Unread: ':"")+o.esc(t.title)+(e?', '+A+" times ":"")+" ";return"<"+s+(s==="a"?' href="'+o.esc(t.href)+'"':' type="button"')+' class="notification" data-index="'+n+'" data-id="'+o.esc(t.id)+'"'+(y?" data-unread":"")+' data-status="'+o.esc(a)+'"'+(t.current?' data-current aria-current="'+(s==="a"?"page":"true")+'"':"")+(e?' data-group aria-expanded="'+!!k[t.id]+'" aria-controls="'+e+'"':"")+'>'+(L[a]?o.icon(L[a]):"")+' '+(e?''+N+'×'+A+" "+j+" ":N)+(t.description?''+o.esc(t.description)+" ":"")+' "+o.esc(t.time)+" "+s+">"}function x(){var t=g.contains(document.activeElement)&&document.activeElement.dataset.id,n=u.reduce(function(e,a){return e+(p(a)?a.entries.filter(function(s){return s.unread}).length:a.unread?1:0)},0);h.setAttribute("aria-label",n>0?d+", "+n+" unread":d),B.hidden=n===0,R.textContent=n+" unread",n===0?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled"),v&&(u.length===0?v.setAttribute("aria-disabled","true"):v.removeAttribute("aria-disabled")),V.hidden=u.length>0,w.hidden=u.length===0,g.innerHTML=u.map(function(e,a){if(!p(e))return""+E(e,a)+" ";var s=c+"-g"+a;return""+E(e,a,s)+'"+e.entries.map(function(y,A){return""+E(y,a+"."+A)+" "}).join("")+" "}).join(""),t&&[].some.call(g.querySelectorAll(".notification"),function(e){return e.dataset.id===t&&(e.focus(),!0)})}return g.addEventListener("click",function(t){var n=t.target.closest(".notification");if(n){var e=n.dataset.index.split(".");if(n.hasAttribute("data-group")){var a=n.getAttribute("aria-expanded")!=="true";k[u[Number(e[0])].id]=a,n.setAttribute("aria-expanded",String(a)),document.getElementById(n.getAttribute("aria-controls")).hidden=!a;return}var s=u[Number(e[0])];i.onSelect&&i.onSelect(e.length>1?s.entries[Number(e[1])]:s),C()}}),b.addEventListener("click",function(){b.getAttribute("aria-disabled")!=="true"&&i.onMarkAllRead&&i.onMarkAllRead()}),v&&v.addEventListener("click",function(){v.getAttribute("aria-disabled")!=="true"&&i.onClearAll()}),I.addEventListener("click",function(){i.onViewAll&&i.onViewAll(),C()}),r.addEventListener("toggle",function(t){t.newState==="open"?m=o.glide(w,w.firstElementChild,{active:".notification[data-hovered]",item:".notification"}):m&&(m(),m=null)}),x(),{element:r,button:h,setEntries:function(t){u=S(t||[]),x()},open:function(){r.showPopover({source:h})},close:C}}M.notifications=z})(window.Basalt);
diff --git a/.agent/skills/basalt-html/parts/usage/notifications.md b/.agent/skills/basalt-html/parts/usage/notifications.md
index fc5f565a..45b78490 100644
--- a/.agent/skills/basalt-html/parts/usage/notifications.md
+++ b/.agent/skills/basalt-html/parts/usage/notifications.md
@@ -12,7 +12,6 @@ var centre = Basalt.notifications('#bell', {
```
-- The page owns the entries, their read state and persistence; call `setEntries` after any change; `onClearAll` adds Clear all. Entries run newest first. An entry with `href` is a link, one without is a button. `time` is the words you write ("2m ago"); `status` is `success`, `warning` or `danger`.
-- It is where a toast's `home: 'centre'` lives. Keep an entry's action reachable while it is valid.
-- Put it in a bar's end, 32px. The unread count is in the button's name, never drawn.
-- On touch a one-line entry is 44 tall, its line centred.
+- The page owns the entries and read state; call `setEntries` after a change; `onClearAll` adds Clear all. Newest first; `href` makes a link, else a button. `time` is your words ("2m ago"); `status`: `success`, `warning`, `danger`, `pending` (waiting; the title says it).
+- A group: `entries: [...]` on an entry, its title naming who and what; the row adds "×N" (`count`) and opens to them.
+- Home of a toast's `home: 'centre'`. In a bar's end, 32px; the unread count is in the button's name.
diff --git a/.agent/skills/basalt-html/parts/usage/search.md b/.agent/skills/basalt-html/parts/usage/search.md
index d1f5119e..b8dbc3da 100644
--- a/.agent/skills/basalt-html/parts/usage/search.md
+++ b/.agent/skills/basalt-html/parts/usage/search.md
@@ -17,7 +17,7 @@ A search dialog on the dialog's rules (`--usage dialog`): ` string}` to `ToastProvider` to say it in another language or other words; a toast with no action says nothing extra. Nothing extra is drawn, and it is said once. |
-| `NotificationCentre` | The durable copy a toast points to: a bell button with a dot (count in its name) opening a popover of `entries` (`{ id, title, description?, time, status?, unread?, href? }`), "Mark all as read", "View all" and, with `onClearAll`, "Clear all" at the footer's start. Presentational: you own the entries, their read state and the page. |
+| `NotificationCenter` (alias `NotificationCentre`) | The durable copy a toast points to: a bell button with a dot (count in its name) opening a popover of `entries` (`{ id, title, description?, time, dateTime?, status?, unread?, href?, current?, entries?, count? }`), "Mark all as read", "View all" and, with `onClearAll`, "Clear all" at the footer's start. `status` is `success`, `warning`, `danger` or `pending` (waiting: the empty ring, no colour). An entry with `entries` is a group: its row shows the title, "×N" (`count`, default `entries.length`) and a chevron, and opens in place to them. Presentational: you own the entries, the grouping, their read state and the page. |
+| `NotificationList` | The center's entries in the page: your notifications page (what "View all" opens) and, on a phone, the tab bar's destination (`TabBarItem` with `NotificationsGlyph` and its `dot`). A head band with the count and "Mark all as read" (`head={false}` drops it, for a list in a sidebar), the list named by `label` or `aria-labelledby`, `empty`. No popover, title, rim or glide. `current` on an entry is `aria-current` and its title at 600. `onClearAll` adds a foot with "Clear all" at its start. |
| `CommandMenu` | ⌘K: `groups` of `{ label, commands }`, each command `{ id, label, icon?, description?, shortcut?, keywords?, danger?, onSelect? }`; you bind the shortcut. A `description` is a second line, and is searched below the label; `danger` draws the command in the danger colour, as in `Menu`. `onSearchChange` hears what is typed and `search` controls it, so a command can carry the words ("Search this document for “budget”", with `keywords: [search]` so it stays found). Left uncontrolled, the search starts empty at every opening and `onSearchChange` hears `""` once the menu has closed; a controlled one is yours to clear (in `onOpenChange`). |
| `CommandList` | The same panel set in the page (no dialog): a level-1 panel whose field keeps focus, with a count in its foot. `label` names it; `detail={(command) => pane}` adds a preview beside the list (a push under 816px); `bindShortcut` gives it ⌘K. One command surface per page owns ⌘K. |
-| `SearchTrigger`, `SearchDialog`, `SearchResults`, `SearchResult` | Search by following links. `SearchTrigger` is a button shaped like a field (a 1px input boundary, the glyph and the word, 200 by 44) from 720 and a 44px icon button under it; it opens whatever you open. `SearchDialog` is a centred dialog: a `type="search"` field and a close button (one ×: the browser's is hidden), a count line (`count` is a string, drawn at once and spoken once) and a results area of a fixed height, a full result's, so the field and the count never move. `SearchResults` holds `SearchResult` links: each a tab stop, `media` (96 by 48 with `mediaShape="logo"`, 48 by 60 by default), a name and a `detail` line, a `trailing` value, as tall as its picture plus 6px above and below (never under 48). Enter in the field calls `onSubmit(query)`. There is no active row and no arrow-key movement. |
+| `SearchTrigger`, `SearchDialog`, `SearchResults`, `SearchResult` | Search by following links. `SearchTrigger` is a button shaped like a field (a 1px input boundary, the glyph and the word, 200 by 44) from 720 and a 44px icon button under it; it opens whatever you open. `SearchDialog` is a centred dialog: a `type="search"` field and a close button (one ×: the browser's is hidden), a count line (`count` is a string, drawn at once and spoken once) and a results area of a fixed height, a full result's, so the field and the count never move. `SearchResults` holds `SearchResult` links: each a tab stop, `media` (96 by 48 with `mediaShape="logo"`, 48 by 60 by default), a name and a `detail` line, a `trailing` value, as tall as its picture plus 6px above and below (never under 48). Enter in the field calls `onSubmit(query)`. There is no active row and no arrow-key movement. `logoRows` (3), `rows` (5) and `all` are a shop's presets: set your own. |
+| `SearchField`, `SearchPassages`, `SearchPassage`, `SearchMatch`, `markMatches` | Search in a page or a panel whose results come from your server. `SearchField` (`label`, `value`, `onValueChange`, `onSubmit`, `onEscape`, `clearLabel`, `controlSize`) is an Input in a `role="search"` form with the search glyph and a clear ×; the first Esc empties it, the next calls `onEscape`. `SearchPassages` is the ordered list (name it; `rows` and `lines` give it a fixed results budget that scrolls inside); a `SearchPassage` is a link (`href`) or button with `source` (who or where), `meta` (when) and the passage as children, `current` for the one shown. `markMatches(text, ranges)` marks a server's `[start, end)` ranges with `SearchMatch` (primary ink at 600, no fill) and never parses HTML. Draw the first load in a `LoadingShape` of stand-in passages; keep the last results while a changed query runs (`refreshing`). |
| `Listbox`, `ListboxGroup`, `ListboxOption` | One choice from a list that stays in the page: `role="listbox"` with one tab stop and `aria-activedescendant`, whose choice follows ↑ ↓ Home End. Options have a `detail` second line and a `trailing` cell; groups are named by their header. The chosen option has a chevron in its gutter and primary ink, never a heavier weight. Focus is a ring on the list's own box, 2px at +2 with radius 8 (DECISIONS 159: the owner, on a 2 to 2 deadlock in DECISIONS 157, Q2); `flush` draws it inside at −2 where the list meets a clipping edge. The rows scroll in a box inside the focused one (`.basalt-listbox-scroll`), so the corners clip nothing and a script that scrolls the list scrolls that box. |
| `OpenList`, `OpenListGroup`, `OpenListRow` | Rows that open (not a listbox). The name is a button stretched over the row; one row, the cursor, holds the tab stop; ↓ ↑ `j` `k`, Home `g`, End `G` move it and Enter opens. A row has `part`, `state` and `detail` cells, aligned down the list, and says what it `opens` into. `off` leaves a row in place that a filter does not match (unavailable to every input, DECISIONS 168: disabled ink, no cells, skipped by the cursor, `aria-disabled`, no hover step, a `not-allowed` cursor, and a press does not open it); count with a `FilterResult` outside the list. `OpenListGroup` is a named `group`, not a landmark. |
| `NoticeBar` | One short notice across the top of a page, above the header: a named region (`label`, not a live region), the level-1 fill with a divider under it, `title` in primary at 600. |
diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts
index b0a964df..394d319a 100644
--- a/packages/react/src/index.ts
+++ b/packages/react/src/index.ts
@@ -14,8 +14,8 @@ export { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuIte
export type { MenuCheckboxItemProps, MenuContentProps, MenuItemProps, MenuProps, MenuRadioGroupProps, MenuRadioItemProps, MenuRowProps, MenuSubmenuProps, MenuSubmenuTriggerProps, MenuTriggerProps } from "./menu";
export { Dialog, DialogActions, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "./dialog";
export type { DialogCloseProps, DialogContentProps, DialogProps, DialogSize, DialogTriggerProps } from "./dialog";
-export { SearchDialog, SearchResult, SearchResults, SearchTrigger } from "./search";
-export type { SearchDialogProps, SearchResultProps, SearchResultsProps, SearchTriggerProps } from "./search";
+export { markMatches, SearchDialog, SearchField, SearchMatch, SearchPassage, SearchPassages, SearchResult, SearchResults, SearchTrigger } from "./search";
+export type { MatchRange, SearchDialogProps, SearchFieldProps, SearchMatchProps, SearchPassageProps, SearchPassagesProps, SearchResultProps, SearchResultsProps, SearchTriggerProps } from "./search";
export { Drawer, DrawerSection, DrawerTrigger } from "./drawer";
export type { DrawerProps, DrawerSectionProps, DrawerTriggerProps } from "./drawer";
export { Listbox, ListboxGroup, ListboxOption } from "./listbox";
@@ -78,8 +78,8 @@ export { Checkbox, Radio, RadioGroup, Select, Switch } from "./choice";
export type { CheckboxProps, RadioGroupProps, RadioProps, SelectOption, SelectProps, SwitchProps } from "./choice";
export { ToastProvider, useToast } from "./toast";
export type { ToastAction, ToastApi, ToastHome, ToastProviderProps, ToastOptions, ToastPromiseOptions, ToastStatus, ToastUpdate } from "./toast";
-export { NotificationCentre } from "./notifications";
-export type { NotificationCentreProps, NotificationEntry } from "./notifications";
+export { NotificationCenter, NotificationCentre, NotificationList } from "./notifications";
+export type { NotificationCenterProps, NotificationCentreProps, NotificationEntry, NotificationListProps, NotificationStatus } from "./notifications";
export { CommandList, CommandMenu } from "./command";
export type { Command, CommandGroup, CommandListProps, CommandMenuProps } from "./command";
export { Sparkline } from "./sparkline";
diff --git a/packages/react/src/notifications.tsx b/packages/react/src/notifications.tsx
index dac29644..ef3d7840 100644
--- a/packages/react/src/notifications.tsx
+++ b/packages/react/src/notifications.tsx
@@ -1,44 +1,80 @@
import { CheckCircleIcon } from "@phosphor-icons/react/dist/csr/CheckCircle";
+import { CircleIcon } from "@phosphor-icons/react/dist/csr/Circle";
import { WarningIcon } from "@phosphor-icons/react/dist/csr/Warning";
import { XCircleIcon } from "@phosphor-icons/react/dist/csr/XCircle";
import * as React from "react";
import { Button, IconButton } from "./button";
import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "./feedback";
+import { ControlIcon, loadFlight } from "./control-icon";
+import { ChevronDownGlyph } from "./glyphs/chevron-down";
+import { ChevronRightGlyph } from "./glyphs/chevron-right";
import { NotificationsGlyph } from "./glyphs/notifications";
import { Icon } from "./icon";
import { GlidePlate } from "./plate";
+import { useReveal } from "./reveal";
import type { ToastStatus } from "./toast";
import type { Align, IconComponent, OpenChangeDetails, PopupActions, Side } from "./types";
+import { join } from "./utils";
+
+/**
+ * An entry's mark. Success, warning and danger are the toast's marks; `pending` (waiting on someone, in review, queued) is the empty ring of
+ * the same drawing, in secondary ink and no colour, because waiting is not a warning. Neutral draws none (its seat stays, so titles line up).
+ */
+export type NotificationStatus = ToastStatus | "pending";
export interface NotificationEntry {
/** Stable, for the list's keys. */
id: string;
- /** What happened, in one line: "Deploy finished". It is cut with an ellipsis if it is long; the whole text is still read. */
+ /** What happened, in one line: "Deploy finished". It is cut with an ellipsis if it is long; the whole text is still read. A group's title names who and what ("Sam, Priya and Marcus mentioned you"); Basalt adds the count. */
title: string;
- /** A secondary line: what it was about ("blacksand-api, production"). */
+ /** A secondary line: what it was about ("api, production"). */
description?: string;
- /** The time, as the app writes it ("2m ago", "Yesterday"). Basalt does not format dates. */
+ /** The time, as the app writes it ("2m ago", "Yesterday"). Basalt does not format dates. A group's time is its newest entry's. */
time: string;
/** The same moment for machines, as ``. */
dateTime?: string;
- /** Success, warning and danger draw the toast's marks. Neutral draws none (its seat stays, so titles line up). */
- status?: ToastStatus;
- /** Unread entries take a dot and primary ink. Read entries are the same row with the dot's seat empty and the title in secondary ink. */
+ /** The mark in the entry's 16px seat. The mark is never read: the title says it in words ("Waiting on you: approve the release"). */
+ status?: NotificationStatus;
+ /**
+ * Unread entries take a dot and primary ink. Read entries are the same row with the dot's seat empty and the title in secondary ink. A group's
+ * own flag is not read: it is unread while any of its entries is (see `entries`).
+ */
unread?: boolean;
- /** Where it goes. An entry with an `href` is a link, and one without is a button. */
+ /** Where it goes. An entry with an `href` is a link, and one without is a button. A group is always a button: it opens. */
href?: string;
+ /** The entry for the page on screen (a list of entries in a page or a sidebar): `aria-current`, and the title at 600 from 400. The title is one cut line, so nothing moves. */
+ current?: boolean;
+ /**
+ * A group of repeats: the entries it stands for, newest first (one level; an entry inside a group is never a group). The app does the grouping;
+ * the row draws the title, the count and a chevron, and opens in place to these entries. One rule for unread, in the row, the dot, the count and
+ * "Mark all as read": a group is unread while any of its entries is, and its own `unread` is ignored. Errors never group, as toasts never do: a
+ * `danger` entry here is drawn at the top level, right after its group (and a group left with none is not drawn).
+ */
+ entries?: readonly NotificationEntry[];
+ /**
+ * A group's count, when the app holds more than the `entries` it gives (40 mentions, the newest 5 listed); errors are not counted in it. A whole
+ * number above 0, else the group's entries are counted. Default: the entries it holds.
+ */
+ count?: number;
}
-export interface NotificationCentreProps {
+/** What the bell, the popover and the in-page list share. */
+interface ListParts {
/** The entries to list, newest first. The app owns the data and its persistence. */
entries: readonly NotificationEntry[];
- /** An entry was chosen. The center closes after it. */
+ /** An entry was chosen (never a group's row, which opens instead). The center closes after it. */
onSelect?: (entry: NotificationEntry) => void;
/** "Mark all as read" was pressed. Update `unread` on your entries: the rows change ink and nothing moves. */
onMarkAllRead?: () => void;
- /** "Clear all" was pressed: remove the entries (the app owns them). Given, the footer shows "Clear all" at its start, "View all" stays at its end; with nothing left it stays, disabled in place, and keeps focus. */
+ /**
+ * "Clear all" was pressed: remove the entries (the app owns them). Given, the foot shows "Clear all" at its start (DECISIONS 269); with nothing
+ * left it stays, disabled in place, and keeps focus. The center stays open.
+ */
onClearAll?: () => void;
+}
+
+export interface NotificationCenterProps extends ListParts {
/** "View all" was pressed (the app's own page). With `viewAllHref` it is a link as well. */
onViewAll?: () => void;
viewAllHref?: string;
@@ -52,7 +88,33 @@ export interface NotificationCentreProps {
className?: string;
}
-const MARKS: Record, IconComponent> = { success: CheckCircleIcon, warning: WarningIcon, danger: XCircleIcon };
+/** The older spelling of `NotificationCenterProps`; it stays as an alias. */
+export type NotificationCentreProps = NotificationCenterProps;
+
+const MARKS: Record, IconComponent> = { success: CheckCircleIcon, warning: WarningIcon, danger: XCircleIcon, pending: CircleIcon };
+
+const isGroup = (entry: NotificationEntry): boolean => (entry.entries?.length ?? 0) > 0;
+/** One rule everywhere: a group is unread while any of its entries is (its own flag is ignored); any other entry by its own flag. */
+const isUnread = (entry: NotificationEntry): boolean => (isGroup(entry) ? entry.entries!.some((inner) => Boolean(inner.unread)) : Boolean(entry.unread));
+/** What is unread is counted by the entries a reader would open, so a group of three unread mentions is three. */
+const unreadCount = (entries: readonly NotificationEntry[]): number =>
+ entries.reduce((count, entry) => count + (isGroup(entry) ? unreadCount(entry.entries!) : entry.unread ? 1 : 0), 0);
+/** A group's count: the app's when it is a whole number above 0, else the entries it holds. */
+const countOf = (entry: NotificationEntry): number => (Number.isInteger(entry.count) && entry.count! > 0 ? entry.count! : entry.entries?.length ?? 0);
+/**
+ * The entries as drawn. Errors never group: a `danger` entry inside a group is lifted to the top level, right after its group, and a group left with
+ * none is not drawn.
+ */
+function drawn(entries: readonly NotificationEntry[]): NotificationEntry[] {
+ const out: NotificationEntry[] = [];
+ for (const entry of entries) {
+ if (!isGroup(entry)) { out.push(entry); continue; }
+ const kept = entry.entries!.filter((inner) => inner.status !== "danger");
+ if (kept.length) out.push(kept.length === entry.entries!.length ? entry : { ...entry, entries: kept });
+ out.push(...entry.entries!.filter((inner) => inner.status === "danger"));
+ }
+ return out;
+}
/**
* The durable copy of what the toasts said. A bell button (32px, a 6px ink dot when anything is unread, the count in its
@@ -61,9 +123,13 @@ const MARKS: Record, IconComponent> = { success:
*
* This is what lets a toast time out: a toast may close after five seconds when the information, and any action, also has a
* home here (`home: "center"` on the toast). Keep an entry's action reachable for as long as it is valid.
+ *
+ * On a phone the bell gives way to a page: put `NotificationList` on the app's own page and link to it from the tab bar (`TabBarItem`
+ * with `NotificationsGlyph` and its `dot`), the same page "View all" opens.
*/
-export function NotificationCentre({ entries, onSelect, onMarkAllRead, onClearAll, onViewAll, viewAllHref, label = "Notifications", open, defaultOpen, onOpenChange, side = "bottom", align = "end", className }: NotificationCentreProps) {
- const unread = entries.reduce((count, entry) => count + (entry.unread ? 1 : 0), 0);
+export function NotificationCenter({ entries: given, onSelect, onMarkAllRead, onClearAll, onViewAll, viewAllHref, label = "Notifications", open, defaultOpen, onOpenChange, side = "bottom", align = "end", className }: NotificationCenterProps) {
+ const entries = drawn(given);
+ const unread = unreadCount(entries);
const popup = React.useRef(null);
// Choosing an entry, or View all, leaves the center; Esc and an outside click close it before.
const leave = () => popup.current?.close();
@@ -78,10 +144,7 @@ export function NotificationCentre({ entries, onSelect, onMarkAllRead, onClearAl
{label}
{unread} unread
- {/* Stays mounted and keeps focus when nothing is left to mark, as Clear does: disabled in place. */}
-
onMarkAllRead?.()}>
- Mark all as read
-
+
{entries.length === 0 ? (
Nothing yet.
@@ -89,22 +152,11 @@ export function NotificationCentre({ entries, onSelect, onMarkAllRead, onClearAl
// The scroller is the glide's host: the shared plate follows the pointer between entries (40 or 58 tall), behind them.
-
- {entries.map((entry) => (
-
- { onSelect?.(entry); leave(); }} />
-
- ))}
-
+
{ onSelect?.(entry); leave(); }} />
)}
- {onClearAll ? (
- // At the footer's start, apart from View all; stays mounted and keeps focus when nothing is left, as Mark all as read does.
-
onClearAll()}>
- Clear all
-
- ) : null}
+
{viewAllHref ? (
{ onViewAll?.(); leave(); }}>
View all
@@ -118,23 +170,161 @@ export function NotificationCentre({ entries, onSelect, onMarkAllRead, onClearAl
);
}
-function NotificationRow({ entry, onChoose }: { entry: NotificationEntry; onChoose: () => void }) {
+/** The older spelling of `NotificationCenter`; it stays as an alias. */
+export const NotificationCentre = NotificationCenter;
+
+export interface NotificationListProps extends ListParts {
+ /** The head band: the unread count and "Mark all as read". Default true; `false` for a list of entries in a sidebar or a page column. */
+ head?: boolean;
+ /** The list's name for assistive technology. Default "Notifications". Give `aria-labelledby` instead to name it by the page's heading. */
+ label?: string;
+ "aria-labelledby"?: string;
+ /** What an empty list says. Default "Nothing yet." */
+ empty?: React.ReactNode;
+ className?: string;
+}
+
+/**
+ * The center's entries in the page: the page form, for the app's own notifications page (what "View all" opens, and on a phone the tab bar's
+ * destination, since a bell does not fit a phone's header), and for a list of entries in a sidebar. The same rows, seats, groups and words as the
+ * bell's popover, with no popover, no title (the page's heading names it) and no glide: each entry paints its own plate. No rim: it is a list,
+ * not an object. Paging is the app's (`ListBand` under it). With `onClearAll` a foot holds "Clear all" at its start, as the center's does.
+ */
+export function NotificationList({ entries: given, onSelect, onMarkAllRead, onClearAll, head = true, label = "Notifications", "aria-labelledby": labelledBy, empty = "Nothing yet.", className }: NotificationListProps) {
+ const entries = drawn(given);
+ const unread = unreadCount(entries);
+ return (
+
+ {head ? (
+
+ {unread} unread
+
+
+ ) : null}
+ {entries.length === 0 ? (
+
{empty}
+ ) : (
+
onSelect?.(entry)} label={labelledBy ? undefined : label} labelledBy={labelledBy} />
+ )}
+ {onClearAll ? (
+ // The center's foot without View all (this is the page it opens): Clear all at its start.
+
+
+
+ ) : null}
+
+ );
+}
+
+function MarkAllRead({ unread, onMarkAllRead }: { unread: number; onMarkAllRead?: () => void }) {
+ // Stays mounted and keeps focus when nothing is left to mark, as Clear does: disabled in place.
+ return (
+ onMarkAllRead?.()}>
+ Mark all as read
+
+ );
+}
+
+function ClearAll({ count, onClearAll }: { count: number; onClearAll?: () => void }) {
+ if (!onClearAll) return null;
+ // At the foot's start, apart from View all; stays mounted and keeps focus when nothing is left, as Mark all as read does.
+ return (
+ onClearAll()}>
+ Clear all
+
+ );
+}
+
+function Entries({ entries, onChoose, label, labelledBy }: { entries: readonly NotificationEntry[]; onChoose: (entry: NotificationEntry) => void; label?: string; labelledBy?: string }) {
+ return (
+
+ {entries.map((entry) => (isGroup(entry) ? : (
+
+ onChoose(entry)} />
+
+ )))}
+
+ );
+}
+
+/**
+ * A group of repeats: its own row, a button with `aria-expanded`, then its entries, which open in place under it (the reveal: a grid row going 0fr to
+ * 1fr over `duration-slow`, at once under reduced motion), indented to the row's words so they read as its own. Focus stays on the row: its entries
+ * are the next tab stops.
+ */
+function GroupItem({ entry, onChoose }: { entry: NotificationEntry; onChoose: (entry: NotificationEntry) => void }) {
+ const reveal = useReveal({ focusFirst: false });
+ const inner = entry.entries ?? [];
+ return (
+ } className="basalt-notification-group">
+
+
+
+
+ {inner.map((child) => (
+
+ onChoose(child)} />
+
+ ))}
+
+
+
+
+ );
+}
+
+interface GroupState {
+ open: boolean;
+ controls: string;
+ count: number;
+}
+
+function NotificationRow({ entry, onChoose, group }: { entry: NotificationEntry; onChoose: (event: React.MouseEvent) => void; group?: GroupState }) {
const status = entry.status ?? "neutral";
+ const unread = isUnread(entry);
+ // A group's count is spoken inside the title (", 3 times"), so the name reads as one phrase; the drawn "×3" is hidden from it.
+ const title = (
+
+ {unread ? Unread: : null}
+ {entry.title}
+ {group ? , {group.count} times : null}
+
+ );
const body = (
<>
{/* The dot's own seat: always there, filled only while unread, so reading a row moves nothing. */}
{status === "neutral" ? null : }
-
- {entry.unread ? Unread: : null}
- {entry.title}
-
+ {group ? (
+ // The title is cut first; the count (the toast's "×3") and the chevron always show.
+
+ {title}
+ ×{group.count}
+ {/* The disclosure's convention, as DisclosureRow: the core chevron points to the end while closed (mirrored right to left) and down while open. */}
+
+
+ ) : title}
{entry.description ? {entry.description} : null}
{entry.time}
>
);
- const common = { className: "basalt-notification", "data-unread": entry.unread ? "" : undefined, "data-status": status, onClick: onChoose };
- return entry.href ? {body} :
{body} ;
+ const common = {
+ className: "basalt-notification",
+ "data-unread": unread ? "" : undefined,
+ "data-status": status,
+ "data-current": entry.current ? "" : undefined,
+ onClick: onChoose,
+ };
+ if (group) {
+ return (
+
void loadFlight()} onFocus={() => void loadFlight()}>
+ {body}
+
+ );
+ }
+ return entry.href
+ ?
{body}
+ :
{body} ;
}
diff --git a/packages/react/src/reveal.tsx b/packages/react/src/reveal.tsx
index c85b3b12..4164fab0 100644
--- a/packages/react/src/reveal.tsx
+++ b/packages/react/src/reveal.tsx
@@ -13,6 +13,11 @@ export interface RevealOptions {
open?: boolean;
defaultOpen?: boolean;
onOpenChange?: (open: boolean) => void;
+ /**
+ * A keyboard open moves focus to the first new row once the clip has let go (the default: the button is under the rows it opens). Off for a
+ * disclosure whose rows follow its button, where the next Tab already reaches them.
+ */
+ focusFirst?: boolean;
}
/** A transition longer than zero will run, so the end of it is worth waiting for. */
@@ -25,7 +30,7 @@ const animates = (el: Element) => {
* The state behind a reveal: open, and settled (open and done opening, so nothing clips and a ring is whole). The root element
* carries `data-reveal`, `data-open` and `data-settled`; the clips inside it read them.
*/
-export function useReveal({ open: controlled, defaultOpen = false, onOpenChange }: RevealOptions) {
+export function useReveal({ open: controlled, defaultOpen = false, onOpenChange, focusFirst = true }: RevealOptions) {
const [inner, setInner] = React.useState(defaultOpen);
const open = controlled ?? inner;
const [settled, setSettled] = React.useState(open);
@@ -57,7 +62,7 @@ export function useReveal({ open: controlled, defaultOpen = false, onOpenChange
const toggle = (event: React.MouseEvent) => {
const next = !open;
// A click that came from the keyboard (Enter, Space) has no pointer position: its detail is 0.
- focusOnSettle.current = next && event.detail === 0;
+ focusOnSettle.current = focusFirst && next && event.detail === 0;
if (controlled === undefined) setInner(next);
onOpenChange?.(next);
};
diff --git a/packages/react/src/search.tsx b/packages/react/src/search.tsx
index ba409fc9..be1ee617 100644
--- a/packages/react/src/search.tsx
+++ b/packages/react/src/search.tsx
@@ -6,6 +6,7 @@ import { FilterResult } from "./filter-result";
import { CloseGlyph } from "./glyphs/close";
import { SearchGlyph } from "./glyphs/search";
import { Icon } from "./icon";
+import { isComposingKey } from "./keyboard";
import type { FocusTarget } from "./types";
import { join } from "./utils";
@@ -96,9 +97,9 @@ export function SearchDialog({ open, onOpenChange, title, label, placeholder, qu
}
export interface SearchResultsProps extends React.ComponentProps<"ul"> {
- /** The most rows that show a logo a result can hold (60px each). Default 3. */
+ /** The most rows that show a logo a result can hold (60px each). Default 3: the defaults are a shop's presets; set your own budget, 0 for none. */
logoRows?: number;
- /** The most rows that show a picture a result can hold (72px each). Default 5. */
+ /** The most rows that show a picture a result can hold (72px each). Default 5 (a shop's preset). */
rows?: number;
/** Whether a "See all" row can follow the rows. Default true. */
all?: boolean;
@@ -144,3 +145,205 @@ export function SearchResult({ children, media, mediaShape = "pack", detail, tra
);
}
+
+// ---- Search in a page or a panel, with results from a server ----
+
+export interface SearchFieldProps {
+ /** The field's name, not drawn ("Search this document"). */
+ label: string;
+ /** The words in the field. The app runs the search (on its server, after its own debounce); the field only holds them. */
+ value: string;
+ onValueChange: (value: string) => void;
+ placeholder?: string;
+ /** Enter in the field: run the search now. */
+ onSubmit?: (value: string) => void;
+ /** Esc in an empty field (the first Esc empties it): the app closes its search. Without it, the second Esc is left to what holds the field (a sheet closes). */
+ onEscape?: () => void;
+ /** The clear button's name. Default "Clear search". */
+ clearLabel?: string;
+ /** The field's height: 32px (`md`) by default, 44 on touch, as every control. */
+ controlSize?: "sm" | "md" | "lg";
+ /** No typing and no clearing: the × is disabled and Esc leaves the words. */
+ disabled?: boolean;
+ /** The words can be read and selected, not changed: the × is disabled and Esc leaves the words. */
+ readOnly?: boolean;
+ inputRef?: React.Ref
;
+ /** Anything else for the input: `aria-keyshortcuts`, `aria-controls`, `onFocus`. */
+ inputProps?: Omit, "value" | "onChange" | "type" | "placeholder" | "aria-label">;
+ className?: string;
+}
+
+/**
+ * A search field for a page or a panel: the core search glyph at its start, the words, and a clear button at its end while there are words (its seat
+ * is padding, kept, so the words never move). It is a `role="search"` form. Esc empties it first and only the next Esc leaves (`onEscape`). The browser's
+ * own clear × is hidden: the field has one ×.
+ */
+export function SearchField({ label, value, onValueChange, placeholder, onSubmit, onEscape, clearLabel = "Clear search", controlSize = "md", disabled, readOnly, inputRef, inputProps, className }: SearchFieldProps) {
+ const off = Boolean(disabled ?? inputProps?.disabled);
+ const fixed = off || Boolean(readOnly ?? inputProps?.readOnly);
+ const own = React.useRef(null);
+ const setRef = (node: HTMLInputElement | null) => {
+ own.current = node;
+ if (typeof inputRef === "function") inputRef(node);
+ else if (inputRef) (inputRef as React.RefObject).current = node;
+ };
+ return (
+
+ );
+}
+
+/** A match in a passage: from `start` up to (not including) `end`, in UTF-16 code units, as a server's highlighter reports them. */
+export type MatchRange = readonly [start: number, end: number];
+
+export type SearchMatchProps = React.ComponentProps<"mark">;
+
+/** A matched word in a passage: a `mark` in primary ink at 600 on the passage's secondary ink. No fill and no colour: the weight and the ink are the mark. */
+export function SearchMatch({ className, ...props }: SearchMatchProps) {
+ return ;
+}
+
+/**
+ * A passage with its matches marked, from the ranges a server sends: overlapping and touching ranges are joined, ranges outside the text are cut
+ * to it, a boundary inside a code point widens to the whole of it, and the order they come in does not matter. Plain text in, nodes out: nothing is parsed as HTML.
+ */
+export function markMatches(text: string, ranges: readonly MatchRange[]): React.ReactNode[] {
+ // A boundary inside a code point (between the two halves of a surrogate pair, an emoji) widens to take the whole code point.
+ const inside = (at: number) => at > 0 && at < text.length && /[\uDC00-\uDFFF]/.test(text[at]!) && /[\uD800-\uDBFF]/.test(text[at - 1]!);
+ const sorted = ranges
+ .map(([start, end]) => [Math.max(0, Math.min(start, end)), Math.min(text.length, Math.max(start, end))] as const)
+ .map(([start, end]) => [inside(start) ? start - 1 : start, inside(end) ? end + 1 : end] as const)
+ .filter(([start, end]) => end > start)
+ .sort((a, b) => a[0] - b[0]);
+ const joined: Array<[number, number]> = [];
+ for (const [start, end] of sorted) {
+ const last = joined[joined.length - 1];
+ if (last && start <= last[1]) last[1] = Math.max(last[1], end);
+ else joined.push([start, end]);
+ }
+ const out: React.ReactNode[] = [];
+ let at = 0;
+ for (const [start, end] of joined) {
+ if (start > at) out.push(text.slice(at, start));
+ out.push({text.slice(start, end)} );
+ at = end;
+ }
+ if (at < text.length) out.push(text.slice(at));
+ return out;
+}
+
+export interface SearchPassagesProps extends React.ComponentProps<"ol"> {
+ /**
+ * A results budget: the list is as tall as this many passages and scrolls inside, so what sits above it (the field, the count) and below it
+ * never moves however many results come back. Unset, the list grows with its results (a page that scrolls).
+ */
+ rows?: number;
+ /** With `rows`: the lines of passage text each budgeted passage holds (its head line is counted apart). Default 2. */
+ lines?: number;
+}
+
+/**
+ * The results of a search in a page or a panel: an ordered list of `SearchPassage`s, in the order the server ranked them. Give it a name
+ * (`aria-label`). It keeps `space-1-5` from its edges, so a ring is never cut by a scrolling panel. `rows` (and `lines`) give it a fixed budget
+ * that scrolls inside, as the site search's results area has; the query, its paging and any grouping are the app's. While the first results are on their way,
+ * draw it in a `LoadingShape` with stand-in passages; while a changed query runs, keep the last results on screen (`refreshing`).
+ */
+export function SearchPassages({ rows, lines = 2, className, style, ...props }: SearchPassagesProps) {
+ const budget = rows === undefined ? undefined : ({ "--_rows": rows, "--_lines": lines } as React.CSSProperties);
+ return ;
+}
+
+export interface SearchPassageProps extends Omit, "children"> {
+ /** Where the passage is: who said it, or the section or file it is in. One line, cut with an ellipsis. */
+ source: React.ReactNode;
+ /** At the head's end: when, or what kind ("2h ago", "Step 4"). Tertiary, tabular. */
+ meta?: React.ReactNode;
+ /** The passage, with its matches marked (`markMatches`, or `SearchMatch` round each). It wraps; its length is the server's. */
+ children: React.ReactNode;
+ /** A link to the passage. Without it the passage is a button (`onClick`): the app shows it beside the results. */
+ href?: string;
+ target?: string;
+ rel?: string;
+ /** The passage now shown beside the results: `aria-current`, and the source at 600 from 400 (one cut line, so nothing moves). */
+ current?: boolean;
+}
+
+/**
+ * One result: a link or a button over a head line (the source, then the meta at its end) and the passage under it, in secondary ink with its
+ * matches in primary at 600. Popup-row geometry, as a notification entry: a plate on hover inset 2px, radius 8, the control ring at +2. Hover
+ * lifts the meta to secondary, which tertiary would fail on the plate.
+ */
+export function SearchPassage({ source, meta, children, href, target, rel, current = false, className, ...props }: SearchPassageProps) {
+ const body = (
+ <>
+
+ {source}
+ {meta ? {meta} : null}
+
+ {children}
+ >
+ );
+ const common = { ...props, className: join("basalt-passage", className), "data-current": current ? "" : undefined };
+ return (
+
+ {href ? (
+ {body}
+ ) : (
+ {body}
+ )}
+
+ );
+}
diff --git a/packages/react/src/styles/components.css b/packages/react/src/styles/components.css
index 481f2d24..8f5502b4 100644
--- a/packages/react/src/styles/components.css
+++ b/packages/react/src/styles/components.css
@@ -3143,7 +3143,8 @@
background-color: transparent;
transition: background-color var(--basalt-duration-fast) var(--basalt-ease-out);
}
- .basalt-notification:hover::before { background-color: var(--_plate); transition-duration: var(--basalt-duration-instant); }
+ /* In a popover the plate is its level's; in the page (NotificationList, no level of its own) it is the page's solid plate. */
+ .basalt-notification:hover::before { background-color: var(--_plate, var(--_plate-solid)); transition-duration: var(--basalt-duration-instant); }
/* The hover glide, navigation's rules: one shared plate follows the pointer between entries (40 or 58 tall); the first key hides it
and the resting hover, so only the ring shows, until the pointer moves again. Off on touch, under reduced motion and in forced
colours, where each entry paints its own. */
@@ -3173,6 +3174,8 @@
.basalt-notification[data-status="success"] .basalt-notification-mark { color: var(--basalt-status-success); }
.basalt-notification[data-status="warning"] .basalt-notification-mark { color: var(--basalt-status-warning); }
.basalt-notification[data-status="danger"] .basalt-notification-mark { color: var(--basalt-status-danger); }
+ /* Pending (waiting, in review, queued) is the empty ring of the same drawing, in secondary ink: waiting is not a warning, and the title says it. */
+ .basalt-notification[data-status="pending"] .basalt-notification-mark { color: var(--basalt-text-secondary); }
.basalt-notification-text { display: flex; flex-direction: column; min-width: 0; }
.basalt-notification-title,
.basalt-notification-line { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@@ -3183,6 +3186,26 @@
.basalt-notification-time { margin-top: calc(var(--basalt-space-0-5) / 2); font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--basalt-text-tertiary); }
.basalt-notification:hover .basalt-notification-line,
.basalt-notification:hover .basalt-notification-time { color: var(--basalt-text-secondary); }
+ /* The entry for the page on screen (a list in a sidebar): its title at 600 from 400. It is one cut line, so nothing moves. */
+ .basalt-notification[data-current] .basalt-notification-title { color: var(--basalt-text-primary); font-weight: var(--basalt-font-weight-semibold); }
+
+ /* A group of repeats: the title is cut first, then the count (the toast's "×3") and the core chevron (to the end, then down). Its entries
+ open in place under it (the reveal's track), indented by the dot's and the mark's seats, so their seats sit under the group's words. The clip
+ keeps space-1 beside them, room enough for a ring at +2 inside the list's own space-1-5. */
+ .basalt-notification-head { display: flex; align-items: center; min-width: 0; }
+ /* The spoken ", 3 times" is visually hidden at the end of a title that may be cut: the title is its containing block, so the cut hides it and it never
+ widens the page. */
+ .basalt-notification-head > .basalt-notification-title { position: relative; flex: 0 1 auto; }
+ .basalt-notification-count { flex: none; margin-inline-start: var(--basalt-space-1-5); font-variant-numeric: tabular-nums; color: var(--basalt-text-secondary); }
+ /* The disclosure's chevron, as DisclosureRow's: to the end while closed (mirrored right to left), down while open, the change drawn by the control glyph. */
+ .basalt-notification-caret { display: flex; flex: none; margin-inline-start: var(--basalt-space-1); color: var(--basalt-text-secondary); }
+ .basalt-notification[aria-expanded="false"] .basalt-notification-caret:dir(rtl) { transform: scaleX(-1); }
+ .basalt-notification-group > .basalt-reveal-panel > .basalt-reveal-clip { margin-inline: calc(-1 * var(--basalt-space-1)); padding-inline: var(--basalt-space-1); }
+ .basalt-notification-entries { margin: 0; padding: 0; padding-inline-start: calc(var(--basalt-size-dot) + var(--basalt-size-icon-sm) + 2 * var(--basalt-space-2-5)); list-style: none; }
+
+ /* The page form (NotificationList): the same head band, without a title, its count lined up with the entries' dots; no rim and no level. */
+ .basalt-notification-list > .basalt-notifications-foot { padding: var(--basalt-space-2) var(--basalt-space-1-5); }
+ .basalt-notification-list > .basalt-notifications-head { padding-block: var(--basalt-space-2); padding-inline: calc(var(--basalt-space-1-5) + var(--basalt-space-3)) var(--basalt-space-1-5); }
/* ---- Command menu ---- */
@@ -4851,6 +4874,82 @@
.basalt-search-result[data-centered] { justify-content: center; }
.basalt-search-result[data-centered] .basalt-search-name { flex: none; }
+ /* ---- Search in a page or a panel (SearchField, SearchPassages) ---- */
+
+ /* The field: an Input with the core search glyph at its start and, while there are words, a 24px clear button at its end. Both seats are
+ padding, kept whether the button shows or not, so the words never move. */
+ .basalt-search-box { position: relative; display: flex; align-items: center; min-width: 0; margin: 0; }
+ .basalt-search-box-glyph { position: absolute; inset-inline-start: var(--basalt-space-2-5); color: var(--basalt-text-tertiary); pointer-events: none; }
+ .basalt-input.basalt-search-box-input {
+ flex: 1;
+ min-width: 0;
+ padding-inline: calc(var(--basalt-space-2-5) + var(--basalt-size-icon-sm) + var(--basalt-space-2)) calc(var(--basalt-space-1) + var(--basalt-size-control-xs) + var(--basalt-space-1));
+ -webkit-appearance: none;
+ appearance: none;
+ }
+ .basalt-search-box-input::placeholder { color: var(--basalt-text-tertiary); opacity: 1; }
+ .basalt-search-box-input::-webkit-search-cancel-button,
+ .basalt-search-box-input::-webkit-search-decoration,
+ .basalt-search-box-input::-webkit-search-results-button { -webkit-appearance: none; appearance: none; display: none; }
+ .basalt-search-box-clear { position: absolute; inset-inline-end: var(--basalt-space-1); }
+
+ /* The results: an ordered list that keeps space-1-5 from its edges, so a ring at +2 is never cut by the panel that scrolls it. */
+ .basalt-passages { margin: 0; padding: var(--basalt-space-1-5); list-style: none; }
+ .basalt-passages-item { margin: 0; padding: 0; list-style: none; }
+ /* A results budget (rows, lines): as tall as that many passages (the row's padding, its head line, the gap and its lines of text), plus the list's own
+ padding, scrolling inside, so the field and the count above never move. Unset, the list grows with its results. */
+ .basalt-passages[data-budget] {
+ box-sizing: border-box;
+ height: calc(2 * var(--basalt-space-1-5) + var(--_rows, 5) * (2 * (var(--basalt-space-2) + var(--basalt-space-0-5)) + var(--basalt-text-sm-line-height) + var(--basalt-space-0-5) + var(--_lines, 2) * var(--basalt-text-base-line-height)));
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ scroll-padding-block: var(--basalt-space-1-5);
+ }
+ /* A passage is a link or a button with popup-row geometry: a plate inset 2px above and below, radius 8, 12px from the edge to the words. The head
+ is the source (one cut line, primary, 400) and the meta at its end (tertiary, tabular); the passage wraps under it in secondary ink. */
+ .basalt-passage {
+ --_plate-inset: var(--basalt-space-0-5);
+ box-sizing: border-box;
+ position: relative;
+ isolation: isolate;
+ display: flex;
+ flex-direction: column;
+ gap: var(--basalt-space-0-5);
+ width: 100%;
+ margin: 0;
+ padding: calc(var(--basalt-space-2) + var(--_plate-inset)) var(--basalt-space-3);
+ border: 0;
+ border-radius: calc(var(--basalt-radius-md) + var(--_plate-inset));
+ background: none;
+ color: var(--basalt-text-secondary);
+ font: var(--basalt-font-weight-regular) var(--basalt-text-base-size) / var(--basalt-text-base-line-height) var(--basalt-font-family-sans);
+ text-align: start;
+ text-decoration: none;
+ cursor: pointer;
+ -webkit-tap-highlight-color: transparent;
+ }
+ .basalt-passage::before {
+ content: "";
+ position: absolute;
+ inset: var(--_plate-inset) 0;
+ z-index: -1;
+ border-radius: var(--basalt-radius-md);
+ background-color: transparent;
+ transition: background-color var(--basalt-duration-fast) var(--basalt-ease-out);
+ }
+ @media (hover: hover) {
+ .basalt-passage:hover::before { background-color: var(--_plate, var(--_plate-solid)); transition-duration: var(--basalt-duration-instant); }
+ .basalt-passage:hover .basalt-passage-meta { color: var(--basalt-text-secondary); }
+ }
+ .basalt-passage:focus-visible { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: calc(var(--basalt-size-focus-offset) - var(--_plate-inset)); }
+ .basalt-passage-head { display: flex; align-items: baseline; gap: var(--basalt-space-3); min-width: 0; font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); }
+ .basalt-passage-source { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--basalt-text-primary); }
+ .basalt-passage[data-current] .basalt-passage-source { font-weight: var(--basalt-font-weight-semibold); }
+ .basalt-passage-meta { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--basalt-text-tertiary); }
+ .basalt-passage-text { overflow-wrap: anywhere; text-wrap: pretty; }
+ /* A match: the passage's own words in primary ink at 600, with no fill, no colour and no underline (monochrome; the weight and the ink are the mark). */
+ .basalt-search-match { padding: 0; background: none; color: var(--basalt-text-primary); font-weight: var(--basalt-font-weight-semibold); }
+
/* The notice bar (D16): one short notice across the top of a page, in the level-1 fill with a divider under it. */
.basalt-notice-bar {
box-sizing: border-box;
@@ -5555,7 +5654,15 @@
.basalt-notification:hover .basalt-notification-title,
.basalt-notification:hover .basalt-notification-line,
.basalt-notification:hover .basalt-notification-time,
- .basalt-notification:hover .basalt-notification-mark { color: HighlightText; }
+ .basalt-notification:hover .basalt-notification-mark,
+ .basalt-notification:hover .basalt-notification-count,
+ .basalt-notification:hover .basalt-notification-caret { color: HighlightText; }
+ .basalt-notification-count, .basalt-notification-caret { color: CanvasText; }
+ /* A passage is the same: a hovered one is Highlight with HighlightText; a match keeps its weight (a mark's system fill is not drawn). */
+ .basalt-passage:hover { forced-color-adjust: none; background: Highlight; color: HighlightText; }
+ .basalt-passage:hover::before { background-color: transparent; }
+ .basalt-passage:hover :is(.basalt-passage-source, .basalt-passage-meta, .basalt-search-match) { color: HighlightText; }
+ .basalt-search-match { color: CanvasText; background: none; }
/* The chip: the line is a real border, so off keeps it in ButtonText. On is Highlight with every part (label, seat, both
glyphs) named HighlightText, and it stays Highlight on hover and while pressed; the check is a shape, so it shows. */
.basalt-chip { color: ButtonText; }
diff --git a/packages/react/test/bundle.test.mjs b/packages/react/test/bundle.test.mjs
index b12483b7..2ae5ac34 100644
--- a/packages/react/test/bundle.test.mjs
+++ b/packages/react/test/bundle.test.mjs
@@ -346,7 +346,10 @@ test("command-panel.js keeps Phosphor's full MIT notice as a preserved legal com
// announcer) and the running state bring it to about 91,000. The limits sit just above what is measured. NotificationCentre was 140,000
// before DECISIONS 103 (F2) gave it the hover glide: the plate's script (plate.tsx, shared with Menu and navigation) is about 2,500 bytes,
// so its limit is 146,000; 147,700 since DECISIONS 268 kept popovers below their opener (an 18-byte default); 147,900 for Clear all (DECISIONS 269, 98 bytes).
-for (const [name, limit] of [["ToastProvider", 93_000], ["useToast", 4_000], ["NotificationCentre", 147_900]]) {
+// cimip-gaps-2, B7 (DECISIONS 265, the rise accepted under DECISIONS 246): the pending ring (Phosphor's Circle), a group's disclosure chevron (core
+// chevron-right and chevron-down), the reveal's track, the lifted errors and the shared Clear all take NotificationCentre's static graph to 152,538
+// (the limit 147,900 to 152,550).
+for (const [name, limit] of [["ToastProvider", 93_000], ["useToast", 4_000], ["NotificationCentre", 152_550]]) {
test(`${name} alone stays lean and loads no Shiki, cmdk or grammar`, async () => {
// The static graph under splitting: what loads first. A control's glyph engine loads on demand and is not in it (and has a limit of its own, below).
const { bytes, inputs } = await graph(name);
@@ -472,7 +475,9 @@ test("LoopsToggleIcon alone loads the icon button and the hold, and not Switch",
// Links and rows (DECISIONS 152). The cards, the rows and the back link are plain markup and the core arrow glyphs: no Base UI part, no Phosphor
// and no Shiki. The three that carry a button (Reveal, DirectoryList's show all, CopyButton) carry Base UI's Button and nothing else.
// Measured: LinkCard 5,174 bytes, LinkTile 4,597, BackLink 4,004, BigLinkList 391, DirectoryList 16,729, Reveal 16,328, CopyButton 15,495.
-for (const [name, limit, base] of [["LinkCard", 6_500, false], ["LinkTile", 6_000, false], ["BackLink", 5_500, false], ["BigLinkList", 1_000, false], ["BigLinkRow", 6_000, false], ["DirectoryRow", 6_500, false], ["DirectoryList", 20_000, true], ["Reveal", 19_600, true], ["CopyButton", 18_550, true]]) {
+// cimip-gaps-2, B7: `useReveal` takes `focusFirst` (a group's entries follow its row, so a keyboard open keeps focus there), 6 and 8 bytes: Reveal
+// 19,600 to 19,650 (19,606 measured) and DirectoryList 20,000 to 20,050 (20,008).
+for (const [name, limit, base] of [["LinkCard", 6_500, false], ["LinkTile", 6_000, false], ["BackLink", 5_500, false], ["BigLinkList", 1_000, false], ["BigLinkRow", 6_000, false], ["DirectoryRow", 6_500, false], ["DirectoryList", 20_050, true], ["Reveal", 19_650, true], ["CopyButton", 18_550, true]]) {
test(`${name} alone, with splitting, loads only its own static graph (${limit} bytes at most)`, async () => {
const { bytes, chunks, inputs } = await graph(name);
assert.ok(bytes < limit, `${name}: ${bytes} bytes in ${chunks} chunks (limit ${limit})`);
diff --git a/packages/react/test/export-sizes.json b/packages/react/test/export-sizes.json
index 734acadc..236648b5 100644
--- a/packages/react/test/export-sizes.json
+++ b/packages/react/test/export-sizes.json
@@ -80,7 +80,7 @@
"DialogDescription": 69877,
"DialogTitle": 69890,
"DialogTrigger": 69869,
- "DirectoryList": 19879,
+ "DirectoryList": 19896,
"DirectoryRow": 5065,
"DisclosureRow": 24902,
"DotLine": 584,
@@ -169,7 +169,9 @@
"NavGroup": 514,
"NavItem": 110643,
"NoticeBar": 813,
- "NotificationCentre": 147263,
+ "NotificationCenter": 151993,
+ "NotificationCentre": 152003,
+ "NotificationList": 32602,
"NotificationsGlyph": 3066,
"NumberField": 43928,
"NumberTicker": 2587,
@@ -211,16 +213,20 @@
"ReflowItem": 470,
"Refreshing": 1911,
"Reserve": 441,
- "Reveal": 19475,
+ "Reveal": 19494,
"RoutesGlyph": 3009,
"RunsGlyph": 3128,
"STATUS_MESSAGE_MS": 26,
"SandboxesGlyph": 2963,
- "SearchDialog": 85332,
+ "SearchDialog": 85372,
+ "SearchField": 18295,
"SearchGlyph": 3181,
- "SearchResult": 684,
- "SearchResults": 304,
- "SearchTrigger": 3868,
+ "SearchMatch": 248,
+ "SearchPassage": 784,
+ "SearchPassages": 375,
+ "SearchResult": 722,
+ "SearchResults": 342,
+ "SearchTrigger": 3907,
"SectionActions": 226,
"SectionIntro": 224,
"Segment": 15718,
@@ -242,7 +248,7 @@
"ShortcutList": 10032,
"SingleKeysSwitch": 17082,
"SiteBrand": 1302,
- "SiteFooter": 14780,
+ "SiteFooter": 14782,
"SiteHeader": 175837,
"SiteLockupDefs": 694,
"SiteMenu": 168176,
@@ -352,6 +358,7 @@
"lockupDrawing": 1008,
"loopsBootstrap": 164,
"markEntranceSeen": 165,
+ "markMatches": 741,
"markPageChange": 58,
"markPageStart": 383,
"preloadCodeLanguages": 2143,
@@ -387,11 +394,11 @@
"useWaitMark": 303
},
"package": {
- "bytes": 785182,
- "gzip": 258485
+ "bytes": 791912,
+ "gzip": 260374
},
"styles": {
- "bytes": 318192,
- "gzip": 41734
+ "bytes": 323487,
+ "gzip": 42369
}
}
diff --git a/packages/react/test/icons.test.mjs b/packages/react/test/icons.test.mjs
index f1f0d73f..c0639052 100644
--- a/packages/react/test/icons.test.mjs
+++ b/packages/react/test/icons.test.mjs
@@ -104,7 +104,8 @@ const CASES = [
["Terminal", ["CheckCircle", "Warning", "XCircle"]],
["Callout", ["Info", "CheckCircle", "Warning", "XCircle"]],
["ToastProvider", ["CheckCircle", "Warning", "XCircle"]],
- ["NotificationCentre", ["CheckCircle", "Warning", "XCircle"]],
+ ["NotificationCentre", ["CheckCircle", "Warning", "XCircle", "Circle"]],
+ ["NotificationList", ["CheckCircle", "Warning", "XCircle", "Circle"]],
];
describe("the default build: Basalt's dist imports Phosphor as it did, and nothing ships twice", () => {
@@ -251,7 +252,10 @@ describe("the bytes, with the plugin and without it", () => {
// Kbd is not one of them: its static graph (keyboard.ts, shortcut.ts, platform.ts, utils.ts and the three Phosphor keys) holds no Button and no wait, and measures
// 7,291 on main at 4778c200 as on this branch, over the 6,950 set in 1eaff4c9: the rise is DECISIONS 244's one Mod key across platforms (b361621c, platform.ts and
// the Mod handling in keyboard.ts). Its limit is that measurement rounded up to the next 50, 7,300.
- for (const [name, limit, saving] of [["Kbd", 7_300, 2_000], ["Terminal", 28_650, 3_000], ["Callout", 6_950, 4_500], ["ToastProvider", 87_000, 3_000], ["NotificationCentre", 143_800, 3_500]]) {
+ // cimip-gaps-2, B7 (DECISIONS 265): the center draws the pending ring (Phosphor's Circle), a group's core chevron and the reveal's track, so with the
+ // plugin it rose from 143,793 to 147,187, and DECISIONS 268's popover default (18 bytes) brings it to 147,224, with Clear all (DECISIONS 269) 147,477, and with the
+ // review's disclosure chevron and lifted errors 148,015 (143,800 to 148,050).
+ for (const [name, limit, saving] of [["Kbd", 7_300, 2_000], ["Terminal", 28_650, 3_000], ["Callout", 6_950, 4_500], ["ToastProvider", 87_000, 3_000], ["NotificationCentre", 148_050, 3_500]]) {
test(`${name} with the plugin is under ${limit} bytes and at least ${saving} smaller than without, alone and beside the app's own icons`, async () => {
const icons = CASES.find(([n]) => n === name)[1];
// the static graph under splitting: a control's glyph engine loads on demand, so it is not part of what an app loads first
@@ -344,6 +348,7 @@ const ENTRIES = [
{ id: "2", title: "Disk nearly full", time: "1h", status: "warning" },
{ id: "3", title: "Build failed", time: "2h", status: "danger" },
{ id: "4", title: "Queued", time: "3h" },
+ { id: "5", title: "In review", time: "4h", status: "pending" },
];
const options = [{ value: "a", label: "Alpha" }, { value: "b", label: "Beta" }];
const many = Array.from({ length: 8 }, (_, i) => ({ value: "v" + i, label: "Value " + i }));
diff --git a/packages/react/test/notices-search.test.mjs b/packages/react/test/notices-search.test.mjs
new file mode 100644
index 00000000..e04dff4d
--- /dev/null
+++ b/packages/react/test/notices-search.test.mjs
@@ -0,0 +1,469 @@
+// Notices and search (cimip-gaps-2, batch B7; DECISIONS 265): the notification center's pending mark, grouped repeats, the page form
+// (`NotificationList`) with `head={false}` and `current`, the US names, and the in-page search (`SearchField`, `SearchPassages`, `SearchPassage`,
+// `SearchMatch`, `markMatches`) inside a `LoadingShape`. Driven in Chromium against the built package with the real stylesheet, in both themes.
+// Synthetic data in unlike domains (a build pipeline, a support inbox, a handbook, a team chat).
+import assert from "node:assert/strict";
+import fs from "node:fs";
+import { createRequire } from "node:module";
+import { after, before, describe, test } from "node:test";
+import * as React from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+
+import * as B from "../dist/index.js";
+import { fixturePage, launch, settle, visibleAgainst } from "./support.mjs";
+
+const axeSource = fs.readFileSync(createRequire(import.meta.url).resolve("axe-core/axe.min.js"), "utf8");
+
+let browser;
+before(async () => { browser = await launch(); });
+after(async () => { await browser?.close(); });
+
+const open = (body, options) => fixturePage(browser, `document.body.style.margin = "0"; createRoot(document.getElementById("root")).render(${body});`, options);
+const box = (locator) => locator.evaluate((el) => { const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height }; });
+const resolve = (page, token) => page.evaluate((token) => {
+ const probe = document.createElement("div");
+ probe.style.color = `var(--basalt-${token})`;
+ document.body.append(probe);
+ const value = getComputedStyle(probe).color;
+ probe.remove();
+ return value;
+}, token);
+const axe = async (page) => {
+ await page.evaluate(() => { document.title = "Notices"; document.documentElement.lang = "en"; document.body.style.background = "var(--basalt-surface-page)"; });
+ await settle(page);
+ await page.addScriptTag({ content: axeSource });
+ const result = await page.evaluate(() => window.axe.run(
+ { exclude: [["[data-base-ui-focus-guard]"]] },
+ { runOnly: { type: "tag", values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"] }, resultTypes: ["violations"] },
+ ));
+ return result.violations.map((v) => `${v.id}: ${v.help} (${v.nodes.map((n) => n.target.join(" ")).slice(0, 3).join("; ")})`);
+};
+
+// A build pipeline: something waiting on the reader, a group of three comments (two unread), a success and a read pending entry.
+const PIPELINE = `[
+ { id: "p1", title: "Waiting on you: approve release 4.2", description: "web, production", time: "4m", status: "pending", unread: true, href: "#r" },
+ { id: "p2", title: "Ines, Tomas and Ruth commented on your change", description: "Add retries to the upload worker", time: "12m", entries: [
+ { id: "p2a", title: "Ines Ortega commented", description: "Can we cap the retries?", time: "12m", unread: true, href: "#c1" },
+ { id: "p2b", title: "Tomas Lindqvist commented", time: "20m", unread: true, href: "#c2" },
+ { id: "p2c", title: "Ruth Achebe commented", time: "31m", href: "#c3" },
+ ] },
+ { id: "p3", title: "Deploy finished", description: "api, staging", time: "1h", status: "success", href: "#d" },
+ { id: "p4", title: "In review: update the cache keys", time: "Yesterday", status: "pending", href: "#k" },
+]`;
+
+for (const theme of ["dark", "light"]) {
+ describe(`the notification center: pending and groups (${theme})`, () => {
+ test("pending is the empty ring in the mark's 16px seat, in secondary ink with no colour, at 3:1 or more, and aria-hidden", async () => {
+ const { page } = await open(`
`, { theme, viewport: { width: 800, height: 700 } });
+ await settle(page);
+ const mark = page.locator('.basalt-notification[data-status="pending"] .basalt-notification-mark').first();
+ assert.equal(await mark.getAttribute("aria-hidden"), "true");
+ const m = await mark.evaluate((el) => { const svg = el.querySelector("svg"); const r = svg.getBoundingClientRect(); return { w: r.width, h: r.height, color: getComputedStyle(el).color, paths: svg.querySelectorAll("path, circle").length }; });
+ assert.deepEqual([m.w, m.h], [16, 16]);
+ assert.equal(m.color, await resolve(page, "text-secondary"), "secondary ink, not a status colour");
+ assert.ok(await visibleAgainst(page, mark.locator("svg")) >= 3, "the ring shows at 3:1 against the popover");
+ // Its seat is the other marks' seat: titles line up down the list, pending or not.
+ const lefts = await page.locator(".basalt-notifications-list > li > .basalt-notification .basalt-notification-title").evaluateAll((els) => els.map((e) => Math.round(e.getBoundingClientRect().left)));
+ assert.equal(new Set(lefts).size, 1, `titles share one start edge (${lefts})`);
+ await page.close();
+ });
+
+ test("a group is a button with aria-expanded, the toast's count spoken as times, and the bell counts its entries", async () => {
+ const { page } = await open(`
`, { theme, viewport: { width: 800, height: 700 } });
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notifications-trigger").getAttribute("aria-label"), "Notifications, 3 unread", "one pending entry and the group's two unread comments");
+ const group = page.locator(".basalt-notification[data-group]");
+ assert.equal(await group.evaluate((el) => el.tagName), "BUTTON");
+ assert.equal(await group.getAttribute("aria-expanded"), "false");
+ assert.equal(await group.getAttribute("data-unread"), "", "a group left without `unread` is unread while any of its entries is");
+ assert.match(await group.innerText(), /×3/);
+ assert.equal(await group.locator(".basalt-notification-count").getAttribute("aria-hidden"), "true");
+ // The drawn count is aria-hidden, so the name reads the title, then ", 3 times".
+ assert.equal(await page.getByRole("button", { name: /^Unread: Ines, Tomas and Ruth commented on your change\s?, 3 times/ }).count(), 1);
+ const panel = page.locator(`[id="${await group.getAttribute("aria-controls")}"]`);
+ assert.equal(await panel.evaluate((el) => el.inert), true, "closed, its entries are out of the keyboard's way");
+ assert.equal(await panel.locator(".basalt-notification").first().isVisible(), false);
+ await page.close();
+ });
+
+ test("opening a group shows its entries under it, indented to the group's words; focus stays on the row and Tab reaches the first entry", async () => {
+ const { page } = await open(`
`, { theme, viewport: { width: 800, height: 700 } });
+ await settle(page);
+ const group = page.locator(".basalt-notification[data-group]");
+ await group.focus();
+ await page.keyboard.press("Enter");
+ await settle(page);
+ assert.equal(await group.getAttribute("aria-expanded"), "true");
+ assert.equal(await page.evaluate(() => document.activeElement?.hasAttribute("data-group")), true, "focus stays on the group's row");
+ const children = page.locator(".basalt-notification-entries .basalt-notification");
+ assert.equal(await children.count(), 3);
+ assert.equal(await children.first().isVisible(), true);
+ const groupText = await box(group.locator(".basalt-notification-text"));
+ const childDot = await box(children.first().locator(".basalt-notification-dot"));
+ const plainDot = await box(page.locator(".basalt-notifications-list > li > .basalt-notification .basalt-notification-dot").first());
+ // The entry's dot sits where the group's words start: indented by the dot's and the mark's seats and their gaps (6 + 10 + 16 + 10).
+ assert.ok(Math.abs(childDot.x - groupText.x) < 0.5, `the entry's dot (${childDot.x}) sits under the group's words (${groupText.x})`);
+ assert.ok(Math.abs(childDot.x - plainDot.x - 42) < 0.5);
+ // The caret turns; the time keeps the column every entry's time ends on.
+ assert.notEqual(await group.locator(".basalt-notification-caret").evaluate((el) => getComputedStyle(el).transform), "none");
+ const ends = await page.locator(".basalt-notification-time").evaluateAll((els) => els.filter((e) => e.getClientRects().length).map((e) => Math.round(e.getBoundingClientRect().right)));
+ assert.equal(new Set(ends).size, 1, `every time ends on one edge (${ends})`);
+ await page.keyboard.press("Tab");
+ assert.equal(await page.evaluate(() => document.activeElement?.getAttribute("href")), "#c1");
+ // Choosing an entry in a group selects it and leaves the center; the group's row never does.
+ await page.keyboard.press("Shift+Tab");
+ await page.keyboard.press("Enter");
+ await settle(page);
+ assert.equal(await group.getAttribute("aria-expanded"), "false");
+ assert.equal(await page.locator(".basalt-notifications").isVisible(), true, "closing a group keeps the center open");
+ await page.close();
+ });
+
+ test("Mark all as read moves nothing, the group's row and its open entries included", async () => {
+ const { page } = await open(`(() => { function App() { const [e, set] = React.useState(${PIPELINE}); return set(e.map((x) => ({ ...x, unread: false, entries: x.entries?.map((c) => ({ ...c, unread: false })) })))} />
; } return ; })()`, { theme, viewport: { width: 800, height: 760 } });
+ await settle(page);
+ await page.locator(".basalt-notification[data-group]").click();
+ await settle(page);
+ const where = () => page.locator(".basalt-notification-title, .basalt-notification-count, .basalt-notification-caret, .basalt-notification-time").evaluateAll((els) => els.map((e) => { const r = e.getBoundingClientRect(); return [Math.round(r.x * 2), Math.round(r.y * 2), Math.round(r.width * 2)]; }));
+ const before = await where();
+ await page.getByRole("button", { name: "Mark all as read" }).click();
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notification[data-unread]").count(), 0);
+ assert.deepEqual(await where(), before);
+ assert.equal(await page.locator(".basalt-notifications-trigger").getAttribute("aria-label"), "Notifications");
+ await page.close();
+ });
+
+ test("axe finds nothing in the open center with a group open", async () => {
+ const { page } = await open(`
`, { theme, viewport: { width: 800, height: 760 } });
+ await settle(page);
+ await page.locator(".basalt-notification[data-group]").click();
+ assert.deepEqual(await axe(page), []);
+ await page.close();
+ });
+ });
+
+ // A support inbox, in the page.
+ const INBOX = `[
+ { id: "i1", title: "Waiting on your reply: ticket 4821", time: "2m", status: "pending", unread: true, href: "#t1" },
+ { id: "i2", title: "Mia, Arjun and Leo replied on tickets you follow", time: "9m", count: 5, entries: [
+ { id: "i2a", title: "Mia Santos replied on 4810", time: "9m", unread: true, href: "#t2" },
+ { id: "i2b", title: "Arjun Mehta replied on 4802", time: "26m", href: "#t3" },
+ ] },
+ { id: "i3", title: "Ticket 4790 was closed", description: "Password reset link expired", time: "1h", status: "success", current: true, href: "#t4" },
+ { id: "i4", title: "You were added to the Billing queue", time: "2h" },
+ ]`;
+
+ describe(`NotificationList, the page form (${theme})`, () => {
+ test("is the center's rows in the page: no popover, no title, the list named by the page's heading, a head band with the count", async () => {
+ const { page } = await open(`
Notifications `, { theme, viewport: { width: 600, height: 700 } });
+ await settle(page);
+ assert.equal(await page.locator(".basalt-popover, .basalt-notifications-trigger").count(), 0);
+ assert.equal(await page.locator(".basalt-notification-list .basalt-notifications-title").count(), 0, "the page's heading names it");
+ assert.equal(await page.getByRole("list", { name: "Notifications" }).count(), 1);
+ assert.equal(await page.locator(".basalt-notifications-count").innerText(), "2 unread");
+ assert.equal(await page.getByRole("button", { name: /on tickets you follow\s?, 5 times/ }).count(), 1, "`count` stands for more than the entries listed");
+ // The row geometry is the popover's: 40 for one line, 58 for two, with a mouse.
+ const heights = await page.locator(".basalt-notifications-list > li > .basalt-notification").evaluateAll((els) => els.map((e) => e.getBoundingClientRect().height));
+ assert.deepEqual(heights, [40, 40, 58, 40]);
+ // No glide in the page: each entry paints its own plate on hover, the page's solid plate.
+ assert.equal(await page.locator(".basalt-plate").count(), 0);
+ const row = page.locator(".basalt-notifications-list > li > .basalt-notification").nth(3);
+ await row.hover();
+ await settle(page);
+ const plate = await row.evaluate((el) => getComputedStyle(el, "::before").backgroundColor);
+ assert.notEqual(plate, "rgba(0, 0, 0, 0)");
+ await page.close();
+ });
+
+ test("current is aria-current and the title at 600, on one cut line; head={false} drops the band and keeps the list's name", async () => {
+ const { page } = await open(``, { theme, viewport: { width: 600, height: 700 } });
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notifications-head").count(), 0);
+ assert.equal(await page.getByRole("list", { name: "Your tickets" }).count(), 1);
+ const current = page.locator('.basalt-notification[aria-current="page"]');
+ assert.equal(await current.count(), 1);
+ assert.equal(await current.locator(".basalt-notification-title").evaluate((el) => getComputedStyle(el).fontWeight), "600");
+ assert.equal(await page.locator(".basalt-notification:not([data-current]) .basalt-notification-title").first().evaluate((el) => getComputedStyle(el).fontWeight), "400");
+ assert.equal(await current.locator(".basalt-notification-title").evaluate((el) => getComputedStyle(el).whiteSpace), "nowrap");
+ await page.close();
+ });
+
+ test("with onClearAll a foot holds Clear all at its start; once nothing is left it stays, disabled in place, and keeps focus", async () => {
+ const { page } = await open(`(() => { function App() { const [e, set] = React.useState(${INBOX}); return
Notifications set([])} /> ; } return ; })()`, { theme, viewport: { width: 600, height: 700 } });
+ await settle(page);
+ const clear = page.getByRole("button", { name: "Clear all" });
+ const foot = await box(page.locator(".basalt-notification-list > .basalt-notifications-foot"));
+ const at = await box(clear);
+ assert.ok(at.x - foot.x <= 6.5, `Clear all sits at the foot's start (${at.x - foot.x}px in)`);
+ assert.equal(await page.locator(".basalt-notification-list .basalt-notifications-foot a, .basalt-notification-list .basalt-notifications-foot button").count(), 1, "no View all: this is that page");
+ await clear.focus();
+ await page.keyboard.press("Enter");
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notification").count(), 0);
+ assert.equal(await clear.getAttribute("aria-disabled"), "true");
+ assert.equal(await page.evaluate(() => document.activeElement?.textContent), "Clear all", "focus stays on it");
+ await page.close();
+ });
+
+ test("axe finds nothing in the page form, with the group open, at a phone's width on touch", async () => {
+ const { page } = await open(`
Notifications `, { theme, viewport: { width: 390, height: 800 }, hasTouch: true, isMobile: true });
+ await settle(page);
+ const heights = await page.locator(".basalt-notifications-list > li > .basalt-notification").evaluateAll((els) => els.map((e) => e.getBoundingClientRect().height));
+ assert.ok(heights.every((h) => h >= 44), `every entry is at least 44 tall on touch (${heights})`);
+ // A group's spoken count is hidden inside its cut title, so nothing reaches past the phone's width.
+ const wide = await page.evaluate(() => [...document.querySelectorAll("#root *")].filter((e) => e.getBoundingClientRect().right > innerWidth + 0.5).map((e) => e.className));
+ assert.deepEqual(wide, [], "nothing is wider than the phone");
+ await page.locator(".basalt-notification[data-group]").click();
+ assert.deepEqual(await axe(page), []);
+ await page.close();
+ });
+ });
+
+ describe(`search in a panel (${theme})`, () => {
+ const PANEL = `(() => { function App() { const [q, set] = React.useState("laptop"); const [esc, setEsc] = React.useState(0); return
+ setEsc((n) => n + 1)} />
+ {esc}
+
+ {}}>{B.markMatches("Your laptop arrives on your first morning; IT sets the laptop up with you.", [[55, 61], [5, 11]])}
+ {B.markMatches("Return the laptop on your last day.", [[11, 17]])}
+
+ ; } return ; })()`;
+
+ test("a match is the passage's words in primary ink at 600 with no fill; the passage is secondary and the meta tertiary, lifting on hover", async () => {
+ const { page } = await open(PANEL, { theme, viewport: { width: 600, height: 600 } });
+ await settle(page);
+ const match = page.locator("mark.basalt-search-match").first();
+ const m = await match.evaluate((el) => { const cs = getComputedStyle(el); return { color: cs.color, weight: cs.fontWeight, bg: cs.backgroundColor }; });
+ assert.deepEqual(m, { color: await resolve(page, "text-primary"), weight: "600", bg: "rgba(0, 0, 0, 0)" });
+ assert.equal(await page.locator("mark.basalt-search-match").count(), 3);
+ const passage = page.locator(".basalt-passage").first();
+ assert.equal(await passage.locator(".basalt-passage-text").evaluate((el) => getComputedStyle(el).color), await resolve(page, "text-secondary"));
+ const meta = passage.locator(".basalt-passage-meta");
+ assert.equal(await meta.evaluate((el) => getComputedStyle(el).color), await resolve(page, "text-tertiary"));
+ await passage.hover();
+ await settle(page);
+ assert.equal(await meta.evaluate((el) => getComputedStyle(el).color), await resolve(page, "text-secondary"), "tertiary would fail on the plate");
+ assert.notEqual(await passage.evaluate((el) => getComputedStyle(el, "::before").backgroundColor), "rgba(0, 0, 0, 0)");
+ await page.close();
+ });
+
+ test("a passage is a button, or a link with href; current is aria-current and the source at 600", async () => {
+ const { page } = await open(PANEL, { theme, viewport: { width: 600, height: 600 } });
+ await settle(page);
+ const [first, second] = [page.locator(".basalt-passage").nth(0), page.locator(".basalt-passage").nth(1)];
+ assert.equal(await first.evaluate((el) => el.tagName), "BUTTON");
+ assert.equal(await second.evaluate((el) => el.tagName), "A");
+ assert.equal(await second.getAttribute("aria-current"), "page");
+ assert.equal(await second.locator(".basalt-passage-source").evaluate((el) => getComputedStyle(el).fontWeight), "600");
+ assert.equal(await first.locator(".basalt-passage-source").evaluate((el) => getComputedStyle(el).fontWeight), "400");
+ assert.equal(await page.locator("ol.basalt-passages").getAttribute("aria-label"), "Results");
+ // The ring is the control ring at +2 outside the row's plate, inside the list's 6px.
+ await first.focus();
+ await page.keyboard.press("Shift+Tab");
+ await page.keyboard.press("Tab");
+ const ring = await page.evaluate(() => { const cs = getComputedStyle(document.activeElement); return [cs.outlineStyle, cs.outlineWidth, cs.outlineOffset]; });
+ assert.deepEqual(ring, ["solid", "2px", "0px"]);
+ await page.close();
+ });
+
+ test("the field: Esc empties the words first, the next Esc is the app's; the clear button empties and keeps focus; the words never move", async () => {
+ const { page } = await open(PANEL, { theme, viewport: { width: 600, height: 600 } });
+ await settle(page);
+ const input = page.locator(".basalt-search-box-input");
+ assert.equal(await page.getByRole("search").count(), 1);
+ assert.equal(await input.getAttribute("aria-label"), "Search the handbook");
+ const pad = await input.evaluate((el) => getComputedStyle(el).paddingInlineStart);
+ await page.getByRole("button", { name: "Clear search" }).click();
+ assert.equal(await input.inputValue(), "");
+ assert.equal(await page.evaluate(() => document.activeElement?.classList.contains("basalt-search-box-input")), true);
+ assert.equal(await page.getByRole("button", { name: "Clear search" }).count(), 0, "no words, no clear button");
+ assert.equal(await input.evaluate((el) => getComputedStyle(el).paddingInlineStart), pad, "the clear seat is padding, kept");
+ await input.fill("charger");
+ await page.keyboard.press("Escape");
+ assert.equal(await input.inputValue(), "");
+ assert.equal(await page.locator("#esc").innerText(), "0");
+ await page.keyboard.press("Escape");
+ assert.equal(await page.locator("#esc").innerText(), "1");
+ // The browser's own × is hidden (Chromium reports no computed style for a ::-webkit pseudo, so the rule is read): the field has one ×.
+ const hidden = await page.evaluate(() => {
+ const found = [];
+ const walk = (rules) => { for (const rule of rules) { if (rule.cssRules) walk(rule.cssRules); if (rule.selectorText?.includes(".basalt-search-box-input::-webkit-search-cancel-button")) found.push(rule.style.display); } };
+ for (const sheet of document.styleSheets) walk(sheet.cssRules);
+ return found;
+ });
+ assert.deepEqual(hidden, ["none"]);
+ // The glyph sits inside the field's start.
+ const glyph = await box(page.locator(".basalt-search-box-glyph"));
+ const field = await box(input);
+ assert.ok(glyph.x - field.x >= 9.5 && glyph.x - field.x <= 10.5, `the glyph is 10px in (${glyph.x - field.x})`);
+ await page.close();
+ });
+
+ test("rows and lines are a results budget: the list is as tall as that many passages and scrolls inside; unset, it grows", async () => {
+ const passage = (i) => ` {}}>{B.markMatches("Could you refund the second charge to the original card?", [[10, 16]])} `;
+ const { page } = await open(`${[0, 1, 2, 3, 4].map(passage).join("")} ${[0, 1].map(passage).join("")} {null}
`, { theme, viewport: { width: 600, height: 900 } });
+ await settle(page);
+ const budget = page.getByRole("list", { name: "Budget" });
+ // 6px of list padding each side, then per passage: 20 of row padding, an 18px head, a 2px gap and two 20px lines.
+ assert.equal((await box(budget)).height, 12 + 3 * (20 + 18 + 2 + 2 * 20));
+ assert.equal(await budget.evaluate((el) => getComputedStyle(el).overflowY), "auto");
+ assert.ok(await budget.evaluate((el) => el.scrollHeight > el.clientHeight), "five passages scroll inside a budget of three");
+ assert.equal((await box(page.getByRole("list", { name: "Four lines" }))).height, 12 + 2 * (20 + 18 + 2 + 4 * 20), "the same height with no results");
+ assert.equal(await page.getByRole("list", { name: "Grows" }).evaluate((el) => getComputedStyle(el).overflowY), "visible");
+ await page.close();
+ });
+
+ test("in a LoadingShape the first results are bones in the passages' shape, aria-busy, and the shape is inert", async () => {
+ const { page } = await open(` {[0, 1, 2].map((i) => {}}>{B.standIn(i + 13, 110)} )} }>{() => null}
`, { theme, viewport: { width: 600, height: 600 } });
+ await page.waitForSelector(".basalt-loading-shape .basalt-skeleton", { timeout: 3000 });
+ const region = page.locator(".basalt-loading-shape");
+ assert.equal(await region.getAttribute("aria-busy"), "true");
+ const bones = await page.locator(".basalt-loading-shape .basalt-skeleton").count();
+ assert.ok(bones >= 9, `a source, a meta and the passage's lines are bones (${bones})`);
+ assert.equal(await page.evaluate(() => document.querySelector(".basalt-passage")?.closest("[inert]") !== null), true);
+ await page.close();
+ });
+
+ test("axe finds nothing in the panel", async () => {
+ const { page } = await open(PANEL, { theme, viewport: { width: 600, height: 600 } });
+ assert.deepEqual(await axe(page), []);
+ await page.close();
+ });
+ });
+}
+
+// ---- Astra's review of B7 (cimip-gaps-2): one unread rule, errors never group, the disclosure chevron, the field's Esc and its fixed states ----
+
+for (const theme of ["dark", "light"]) {
+ describe(`the center's groups after review (${theme})`, () => {
+ test("one unread rule: a group's own flag is ignored, so the row, the dot, the count and Mark all as read agree both ways", async () => {
+ const said = `[{ id: "g", title: "Two comments", time: "1m", unread: true, entries: [{ id: "a", title: "A", time: "1m" }, { id: "b", title: "B", time: "2m" }] }]`;
+ const { page } = await open(` `, { theme });
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notification[data-group]").getAttribute("data-unread"), null, "read entries make a read group");
+ assert.equal(await page.locator(".basalt-notifications-count").innerText(), "0 unread");
+ assert.equal(await page.getByRole("button", { name: "Mark all as read" }).getAttribute("aria-disabled"), "true");
+ assert.equal(await page.getByRole("button", { name: /^Unread/ }).count(), 0);
+ await page.close();
+ const reverse = `[{ id: "g", title: "Two comments", time: "1m", unread: false, entries: [{ id: "a", title: "A", time: "1m", unread: true }, { id: "b", title: "B", time: "2m" }] }]`;
+ const { page: second } = await open(`
`, { theme, viewport: { width: 800, height: 600 } });
+ await settle(second);
+ assert.equal(await second.locator(".basalt-notification[data-group]").getAttribute("data-unread"), "");
+ assert.equal(await second.locator(".basalt-notifications-trigger").getAttribute("aria-label"), "Notifications, 1 unread");
+ assert.equal(await second.locator(".basalt-notifications-trigger").getAttribute("data-unread"), "");
+ await second.close();
+ });
+
+ test("a count that is not a whole number above 0 counts the group's entries", async () => {
+ for (const count of ["-3", "2.5", "Number.NaN", "Infinity", "0"]) {
+ const { page } = await open(` `, { theme });
+ await settle(page);
+ assert.equal(await page.locator(".basalt-notification-count").innerText(), "×2", String(count));
+ await page.close();
+ }
+ });
+
+ test("errors never group: a danger entry is drawn at the top level right after its group, and a group of errors alone is no group", async () => {
+ const builds = `[{ id: "g", title: "Three builds", time: "1m", entries: [{ id: "a", title: "Build 1 passed", time: "1m", status: "success" }, { id: "b", title: "Build 2 failed", time: "2m", status: "danger" }, { id: "c", title: "Build 3 passed", time: "3m", status: "success" }] }, { id: "h", title: "One failure", time: "9m", entries: [{ id: "e1", title: "Lint failed", time: "9m", status: "danger" }] }]`;
+ const { page } = await open(` { window.chosen = e.id; }} />`, { theme });
+ await settle(page);
+ const top = await page.locator(".basalt-notifications-list > li > .basalt-notification .basalt-notification-title").evaluateAll((els) => els.map((e) => e.textContent.replace(/, \d+ times$/, "")));
+ assert.deepEqual(top, ["Three builds", "Build 2 failed", "Lint failed"]);
+ assert.equal(await page.locator(".basalt-notification-count").innerText(), "×2");
+ await page.getByRole("button", { name: /Build 2 failed/ }).click();
+ assert.equal(await page.evaluate(() => window.chosen), "b");
+ await page.close();
+ });
+
+ for (const dir of ["ltr", "rtl"]) {
+ test(`the chevron is the disclosure's: chevron-right while closed (mirrored right to left), chevron-down while open, and a current group is aria-current (${dir})`, async () => {
+ const { page } = await open(`
`, { theme });
+ await settle(page);
+ const group = page.locator(".basalt-notification[data-group]");
+ assert.equal(await group.getAttribute("aria-current"), "true");
+ const caret = page.locator(".basalt-notification-caret");
+ assert.equal(await caret.locator("svg").getAttribute("data-glyph"), "chevron-right");
+ assert.equal(await caret.evaluate((el) => getComputedStyle(el).transform), dir === "rtl" ? "matrix(-1, 0, 0, 1, 0, 0)" : "none");
+ await group.click();
+ await settle(page);
+ assert.equal(await caret.locator("svg").last().getAttribute("data-glyph"), "chevron-down");
+ assert.equal(await caret.evaluate((el) => getComputedStyle(el).transform), "none", "down needs no mirror");
+ await page.close();
+ });
+ }
+ });
+
+ describe(`the search field after review (${theme})`, () => {
+ const IN_DIALOG = (props = "") => `(() => { function App() { const [q, set] = React.useState(""); const [esc, setEsc] = React.useState(0); return Find in the handbook
+ setEsc((n) => n + 1)} ${props} />{esc} ; } return ; })()`;
+
+ test("in a dialog, the first Esc empties the field and the second is onEscape's; the dialog closes on neither", async () => {
+ const { page } = await open(IN_DIALOG(), { theme });
+ await settle(page);
+ const input = page.locator(".basalt-search-box-input");
+ await input.fill("laptop");
+ await page.keyboard.press("Escape");
+ assert.equal(await input.inputValue(), "");
+ await page.keyboard.press("Escape");
+ await settle(page);
+ assert.equal(await page.locator("#esc").innerText(), "1");
+ assert.equal(await page.locator(".basalt-dialog").isVisible(), true, "onEscape took the Esc; the dialog stays");
+ await page.close();
+ });
+
+ test("an Esc that cancels an input method's composition is left alone", async () => {
+ const { page } = await open(IN_DIALOG(), { theme });
+ await settle(page);
+ const input = page.locator(".basalt-search-box-input");
+ await input.fill("かな");
+ await input.evaluate((el) => {
+ el.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true, isComposing: true }));
+ el.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true, keyCode: 229 }));
+ });
+ assert.equal(await input.inputValue(), "かな", "the words stay");
+ assert.equal(await page.locator("#esc").innerText(), "0");
+ await page.close();
+ });
+
+ for (const state of ["disabled", "readOnly"]) {
+ test(`${state}: the × is disabled and Esc leaves the words`, async () => {
+ const { page } = await open(`(() => { function App() { const [q, set] = React.useState("laptop"); return ; } return ; })()`, { theme });
+ await settle(page);
+ const input = page.locator(".basalt-search-box-input");
+ assert.equal(await page.getByRole("button", { name: "Clear search" }).isDisabled(), true);
+ if (state === "readOnly") {
+ assert.equal(await input.getAttribute("readonly"), "");
+ await input.focus();
+ await page.keyboard.press("Escape");
+ } else {
+ assert.equal(await input.isDisabled(), true);
+ await input.evaluate((el) => el.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true })));
+ }
+ assert.equal(await input.inputValue(), "laptop");
+ await page.close();
+ });
+ }
+ });
+}
+
+describe("names and helpers", () => {
+ test("NotificationCenter and NotificationCentre are one component", () => {
+ assert.equal(typeof B.NotificationCenter, "function");
+ assert.equal(B.NotificationCentre, B.NotificationCenter);
+ });
+
+ test("markMatches joins overlapping and touching ranges, clamps them, takes any order, and never parses HTML", () => {
+ const html = (nodes) => renderToStaticMarkup(React.createElement(React.Fragment, null, ...nodes));
+ assert.equal(html(B.markMatches("build and deploy", [[10, 16], [0, 5]])), 'build and deploy ');
+ assert.equal(html(B.markMatches("abcdef", [[1, 3], [2, 4], [4, 5]])), 'abcde f');
+ assert.equal(html(B.markMatches("abc", [[-4, 1], [2, 99], [2, 2]])), 'a bc ');
+ assert.equal(html(B.markMatches("x ", [[3, 4]])), '<b>x </b>');
+ assert.equal(html(B.markMatches("plain", [])), "plain");
+ // A boundary inside a code point widens to the whole of it, at the start and at the end: "😀" is two UTF-16 units.
+ assert.equal(html(B.markMatches("A😀B", [[2, 4]])), 'A😀B ', "a start inside the emoji");
+ assert.equal(html(B.markMatches("A😀B", [[0, 2]])), 'A😀 B', "an end inside the emoji");
+ assert.equal(html(B.markMatches("A😀B", [[1, 2]])), 'A😀 B', "both ends round half of it");
+ assert.equal(html(B.markMatches("A😀B", [[2, 3]])), 'A😀 B');
+ });
+});
diff --git a/packages/react/test/overlays-search.test.mjs b/packages/react/test/overlays-search.test.mjs
index 377541bb..f8c7cc12 100644
--- a/packages/react/test/overlays-search.test.mjs
+++ b/packages/react/test/overlays-search.test.mjs
@@ -506,7 +506,7 @@ for (const theme of ["dark", "light"]) {
// Chromium does not report a ::-webkit pseudo's computed style, so the rule itself is read: the stylesheet hides the browser's × and its decoration.
const hidden = await page.evaluate(() => {
const found = [];
- const walk = (rules) => { for (const rule of rules) { if (rule.cssRules) walk(rule.cssRules); if (rule.selectorText?.includes("::-webkit-search-cancel-button")) found.push(rule.style.display); } };
+ const walk = (rules) => { for (const rule of rules) { if (rule.cssRules) walk(rule.cssRules); if (rule.selectorText?.includes(".basalt-search-input::-webkit-search-cancel-button")) found.push(rule.style.display); } };
for (const sheet of document.styleSheets) walk(sheet.cssRules);
return found;
});
diff --git a/tools/html-skill/src/icons.json b/tools/html-skill/src/icons.json
index f0aa8227..23780f77 100644
--- a/tools/html-skill/src/icons.json
+++ b/tools/html-skill/src/icons.json
@@ -1,2 +1,2 @@
["Command", "Option", "Control", "Sun", "Moon", "Info", "Warning", "ArrowRight", "ArrowLeft", "ArrowUp",
- "ArrowDown", "CaretUpDown", "Trash", "Download", "ArrowClockwise", "CheckCircle", "XCircle", "GithubLogo", "XLogo", "LinkedinLogo", "InstagramLogo", "YoutubeLogo", "EnvelopeSimple", "TerminalWindow"]
+ "ArrowDown", "CaretUpDown", "Trash", "Download", "ArrowClockwise", "CheckCircle", "XCircle", "Circle", "GithubLogo", "XLogo", "LinkedinLogo", "InstagramLogo", "YoutubeLogo", "EnvelopeSimple", "TerminalWindow"]
diff --git a/tools/html-skill/src/modules.json b/tools/html-skill/src/modules.json
index 1d853b0b..75cdfd9b 100644
--- a/tools/html-skill/src/modules.json
+++ b/tools/html-skill/src/modules.json
@@ -1072,7 +1072,11 @@
"notification-text",
"notification-title",
"notification-line",
- "notification-time"
+ "notification-time",
+ "notification-head",
+ "notification-count",
+ "notification-caret",
+ "notification-entries"
],
"text": [
"Basalt\\s*\\.\\s*notifications\\b"
@@ -1087,9 +1091,10 @@
"icons": [
"CheckCircle",
"Warning",
- "XCircle"
+ "XCircle",
+ "Circle"
],
- "budget": 9550,
+ "budget": 12450,
"usage": 1100,
"builds": [
"popover",
diff --git a/tools/html-skill/src/modules/notifications.css b/tools/html-skill/src/modules/notifications.css
index cca793f3..d87eec2d 100644
--- a/tools/html-skill/src/modules/notifications.css
+++ b/tools/html-skill/src/modules/notifications.css
@@ -65,6 +65,17 @@
.notification-line { font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); color: var(--basalt-text-tertiary); }
.notification-time { margin-top: calc(var(--basalt-space-0-5) / 2); font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--basalt-text-tertiary); }
.notification:hover .notification-line, .notification:hover .notification-time { color: var(--basalt-text-secondary); }
+ /* Pending is the empty ring of the same marks, in secondary ink: waiting is not a warning. The current entry is its title at 600. */
+ .notification[data-status="pending"] .notification-mark { color: var(--basalt-text-secondary); }
+ .notification[data-current] .notification-title { color: var(--basalt-text-primary); font-weight: var(--basalt-font-weight-semibold); }
+ /* A group: the title is cut first, then the toast's count and the core chevron; its entries open under it, indented by the dot's and the mark's seats. */
+ .notification-head { display: flex; align-items: center; min-width: 0; }
+ .notification-head > .notification-title { position: relative; flex: 0 1 auto; }
+ .notification-count { flex: none; margin-inline-start: var(--basalt-space-1-5); font-variant-numeric: tabular-nums; color: var(--basalt-text-secondary); }
+ .notification-caret { flex: none; margin-inline-start: var(--basalt-space-1); color: var(--basalt-text-secondary); }
+ .notification[aria-expanded="true"] .notification-caret { transform: rotate(90deg); }
+ .notification[aria-expanded="false"] .notification-caret:dir(rtl) { transform: scaleX(-1); }
+ .notification-entries { margin: 0; padding: 0; padding-inline-start: calc(var(--basalt-size-dot) + var(--basalt-size-icon-sm) + 2 * var(--basalt-space-2-5)); list-style: none; }
/* The hover glide: one shared plate follows the pointer between entries (40 or 58 tall); the first key hides it and the resting hover, so only the
ring shows, until the pointer moves again. Off on touch, under reduced motion and in forced colours, where each entry paints its own. */
@@ -78,6 +89,7 @@
.notification[data-status] .notification-mark { color: CanvasText; }
.notification:hover { forced-color-adjust: none; background: Highlight; color: HighlightText; }
.notification:hover::before { background-color: transparent; }
- .notification:hover :is(.notification-title, .notification-line, .notification-time, .notification-mark) { color: HighlightText; }
+ .notification-count, .notification-caret { color: CanvasText; }
+ .notification:hover :is(.notification-title, .notification-line, .notification-time, .notification-mark, .notification-count, .notification-caret) { color: HighlightText; }
}
}
diff --git a/tools/html-skill/src/modules/notifications.js b/tools/html-skill/src/modules/notifications.js
index eaa9d021..34adb7c1 100644
--- a/tools/html-skill/src/modules/notifications.js
+++ b/tools/html-skill/src/modules/notifications.js
@@ -6,19 +6,36 @@
'use strict';
var _ = B._;
var seq = 0;
- var MARK = { success: 'CheckCircle', warning: 'Warning', danger: 'XCircle' };
+ var MARK = { success: 'CheckCircle', warning: 'Warning', danger: 'XCircle', pending: 'Circle' };
+ var CARET = ' ';
var BELL = ' ';
/**
- * Basalt.notifications(host, { entries: [{ id, title, description?, time, dateTime?, status?: 'success'|'warning'|'danger', unread?, href? }],
+ * Basalt.notifications(host, { entries: [{ id, title, description?, time, dateTime?, status?: 'success'|'warning'|'danger'|'pending', unread?, href?, current?,
+ * entries?: [...] (a group: its row opens to these; it is unread while any of them is, and a danger entry is lifted out of it), count? }],
* label?: 'Notifications', onSelect?(entry), onMarkAllRead?(), onClearAll?() (shows Clear all at the foot's start), onViewAll?(), viewAllHref?, side?: 'bottom', align?: 'end' })
*/
+ function isGroup(e) { return !!(e.entries && e.entries.length); }
+ // Errors never group: a danger entry in a group is drawn at the top level, right after it, and a group left with none is not drawn.
+ function drawn(list) {
+ var out = [];
+ list.forEach(function (e) {
+ if (!isGroup(e)) return out.push(e);
+ var kept = e.entries.filter(function (c) { return c.status !== 'danger'; });
+ if (kept.length) out.push(kept.length === e.entries.length ? e : Object.assign({}, e, { entries: kept }));
+ e.entries.forEach(function (c) { if (c.status === 'danger') out.push(c); });
+ });
+ return out;
+ }
+
function notifications(host, options) {
var o = options || {};
if (typeof host === 'string') host = document.querySelector(host);
var id = 'bh-notes-' + (++seq);
var label = o.label || 'Notifications';
- var entries = o.entries || [];
+ var entries = drawn(o.entries || []);
+ // Which groups are open, by entry id, so a new list from setEntries keeps them.
+ var opened = {};
host.innerHTML =
'' + BELL + ' ' +
'' +
@@ -46,8 +63,27 @@
function leave() { if (pop.matches(':popover-open')) pop.hidePopover(); }
+ // One rule for the row, the dot, the count and Mark all as read: a group is unread while any of its entries is (its own flag is ignored).
+ function isUnread(e) { return isGroup(e) ? e.entries.some(function (c) { return !!c.unread; }) : !!e.unread; }
+ function row(e, index, group) {
+ var st = e.status || 'neutral';
+ var tag = group || !e.href ? 'button' : 'a';
+ var unread = isUnread(e);
+ // The count is the app's only as a whole number above 0, so nothing else reaches the markup.
+ var n = group ? (Number.isInteger(e.count) && e.count > 0 ? e.count : e.entries.length) : 0;
+ var title = '
' + (unread ? 'Unread: ' : '') + _.esc(e.title) + (group ? ', ' + n + ' times ' : '') + ' ';
+ return '<' + tag + (tag === 'a' ? ' href="' + _.esc(e.href) + '"' : ' type="button"') + ' class="notification" data-index="' + index + '" data-id="' + _.esc(e.id) + '"' + (unread ? ' data-unread' : '') + ' data-status="' + _.esc(st) + '"' +
+ (e.current ? ' data-current aria-current="' + (tag === 'a' ? 'page' : 'true') + '"' : '') + (group ? ' data-group aria-expanded="' + !!opened[e.id] + '" aria-controls="' + group + '"' : '') + '>' +
+ '
' + (MARK[st] ? _.icon(MARK[st]) : '') + ' ' +
+ '
' + (group ? '' + title + '×' + n + ' ' + CARET + ' ' : title) +
+ (e.description ? '' + _.esc(e.description) + ' ' : '') + ' ' +
+ '
' + _.esc(e.time) + ' ' + tag + '>';
+ }
+
function render() {
- var unread = entries.reduce(function (n, e) { return n + (e.unread ? 1 : 0); }, 0);
+ // The entry that holds focus keeps it when it is still there after the list is drawn again.
+ var held = list.contains(document.activeElement) && document.activeElement.dataset.id;
+ var unread = entries.reduce(function (n, e) { return n + (isGroup(e) ? e.entries.filter(function (c) { return c.unread; }).length : e.unread ? 1 : 0); }, 0);
button.setAttribute('aria-label', unread > 0 ? label + ', ' + unread + ' unread' : label);
dot.hidden = unread === 0;
count.textContent = unread + ' unread';
@@ -56,21 +92,29 @@
if (clear) { if (entries.length === 0) clear.setAttribute('aria-disabled', 'true'); else clear.removeAttribute('aria-disabled'); }
empty.hidden = entries.length > 0;
scroll.hidden = entries.length === 0;
+ // A group's row opens its entries in place, indented under its words (at once: the reveal's track is React's); focus stays on the row.
list.innerHTML = entries.map(function (e, i) {
- var st = e.status || 'neutral';
- var tag = e.href ? 'a' : 'button';
- return '
<' + tag + (e.href ? ' href="' + _.esc(e.href) + '"' : ' type="button"') + ' class="notification" data-index="' + i + '"' + (e.unread ? ' data-unread' : '') + ' data-status="' + _.esc(st) + '">' +
- '' + (MARK[st] ? _.icon(MARK[st]) : '') + ' ' +
- '' + (e.unread ? 'Unread: ' : '') + _.esc(e.title) + ' ' +
- (e.description ? '' + _.esc(e.description) + ' ' : '') + ' ' +
- '' + _.esc(e.time) + ' ' + tag + '> ';
+ if (!isGroup(e)) return '
' + row(e, i) + ' ';
+ var gid = id + '-g' + i;
+ return '
' + row(e, i, gid) + '' +
+ e.entries.map(function (c, j) { return '' + row(c, i + '.' + j) + ' '; }).join('') + ' ';
}).join('');
+ if (held) [].some.call(list.querySelectorAll('.notification'), function (el) { return el.dataset.id === held && (el.focus(), true); });
}
list.addEventListener('click', function (ev) {
- var row = ev.target.closest('.notification');
- if (!row) return;
- if (o.onSelect) o.onSelect(entries[Number(row.dataset.index)]);
+ var el = ev.target.closest('.notification');
+ if (!el) return;
+ var at = el.dataset.index.split('.');
+ if (el.hasAttribute('data-group')) {
+ var open = el.getAttribute('aria-expanded') !== 'true';
+ opened[entries[Number(at[0])].id] = open;
+ el.setAttribute('aria-expanded', String(open));
+ document.getElementById(el.getAttribute('aria-controls')).hidden = !open;
+ return;
+ }
+ var e = entries[Number(at[0])];
+ if (o.onSelect) o.onSelect(at.length > 1 ? e.entries[Number(at[1])] : e);
leave();
});
mark.addEventListener('click', function () { if (mark.getAttribute('aria-disabled') !== 'true' && o.onMarkAllRead) o.onMarkAllRead(); });
@@ -84,7 +128,7 @@
return {
element: pop,
button: button,
- setEntries: function (next) { entries = next || []; render(); },
+ setEntries: function (next) { entries = drawn(next || []); render(); },
open: function () { pop.showPopover({ source: button }); },
close: leave
};
diff --git a/tools/html-skill/src/usage/notifications.md b/tools/html-skill/src/usage/notifications.md
index fc5f565a..45b78490 100644
--- a/tools/html-skill/src/usage/notifications.md
+++ b/tools/html-skill/src/usage/notifications.md
@@ -12,7 +12,6 @@ var centre = Basalt.notifications('#bell', {
```
-- The page owns the entries, their read state and persistence; call `setEntries` after any change; `onClearAll` adds Clear all. Entries run newest first. An entry with `href` is a link, one without is a button. `time` is the words you write ("2m ago"); `status` is `success`, `warning` or `danger`.
-- It is where a toast's `home: 'centre'` lives. Keep an entry's action reachable while it is valid.
-- Put it in a bar's end, 32px. The unread count is in the button's name, never drawn.
-- On touch a one-line entry is 44 tall, its line centred.
+- The page owns the entries and read state; call `setEntries` after a change; `onClearAll` adds Clear all. Newest first; `href` makes a link, else a button. `time` is your words ("2m ago"); `status`: `success`, `warning`, `danger`, `pending` (waiting; the title says it).
+- A group: `entries: [...]` on an entry, its title naming who and what; the row adds "×N" (`count`) and opens to them.
+- Home of a toast's `home: 'centre'`. In a bar's end, 32px; the unread count is in the button's name.
diff --git a/tools/html-skill/src/usage/search.md b/tools/html-skill/src/usage/search.md
index d1f5119e..b8dbc3da 100644
--- a/tools/html-skill/src/usage/search.md
+++ b/tools/html-skill/src/usage/search.md
@@ -17,7 +17,7 @@ A search dialog on the dialog's rules (`--usage dialog`): `
{
await p.locator("#bell button").first().click();
await frames(p);
assert.equal(await p.evaluate(() => document.querySelectorAll('img[src="x"]').length), 0, "no element came out of the status");
- assert.deepEqual(await p.evaluate(() => [...document.querySelectorAll(".notification")].map((n) => [n.getAttribute("data-status"), n.attributes.length])), [['success" onfocus="__x()" x="', 4], ['"> ', 4]].map(([s, n]) => [s, n]), "the whole value is the attribute's, and the row has no extra attribute");
+ assert.deepEqual(await p.evaluate(() => [...document.querySelectorAll(".notification")].map((n) => [n.getAttribute("data-status"), n.attributes.length])), [['success" onfocus="__x()" x="', 5], ['"> ', 5]].map(([s, n]) => [s, n]), "the whole value is the attribute's, and the row has no extra attribute (type, class, data-index, data-id and data-status)");
assert.equal(await p.evaluate(() => window.hit ?? false), false);
await context.close();
});
diff --git a/tools/html-skill/test/notices-b7.test.mjs b/tools/html-skill/test/notices-b7.test.mjs
new file mode 100644
index 00000000..d724a54a
--- /dev/null
+++ b/tools/html-skill/test/notices-b7.test.mjs
@@ -0,0 +1,115 @@
+// The HTML skill's notification centre after B7's review (cimip-gaps-2, DECISIONS 265): a group's count is only a whole number above 0, one unread
+// rule for the row, the dot, the count and Mark all as read, setEntries keeps open groups and the focused entry, errors are never grouped, and the
+// group's chevron is the disclosure's (to the end while closed, mirrored right to left, down while open). Synthetic data: a build pipeline.
+import assert from "node:assert/strict";
+import { after, before, describe, test } from "node:test";
+
+import { compose } from "../../../.agent/skills/basalt-html/compose.mjs";
+import { launch, openHtml } from "./support.mjs";
+
+let browser;
+before(async () => { browser = await launch(); });
+after(async () => { await browser?.close(); });
+
+const frames = (p, n = 3) => p.evaluate((count) => new Promise((resolve) => { let left = count; const tick = () => (--left <= 0 ? resolve() : requestAnimationFrame(tick)); requestAnimationFrame(tick); }), n);
+
+/** A page with one bell built from `entries` (a JS expression), opened. `window.centre` is the handle. */
+async function bell(entries, { dir = "ltr" } = {}) {
+ const html = compose(`n
`, { fonts: false }).html;
+ const { page, context } = await openHtml(browser, html);
+ await page.waitForSelector(".notifications:popover-open");
+ await frames(page);
+ return { page, context };
+}
+
+const GROUP = (extra = "") => `{ id: 'g', title: 'Ines, Tomas and Ruth commented', time: '12m'${extra}, entries: [{ id: 'g1', title: 'Ines commented', time: '12m' }, { id: 'g2', title: 'Tomas commented', time: '20m' }] }`;
+
+describe("a group's count", () => {
+ test("a count that is not a whole number above 0 is the group's entries, and nothing in it reaches the markup", async () => {
+ for (const count of ["' '", "-3", "2.5", "NaN", "Infinity", "0"]) {
+ const { page, context } = await bell(`[${GROUP(`, count: ${count}`)}]`);
+ assert.equal(await page.evaluate(() => document.querySelectorAll('img[src="x"]').length), 0, `${count}: no element`);
+ assert.equal(await page.locator(".notification-count").innerText(), "×2", `${count}: the entries are counted`);
+ assert.match(await page.locator(".notification[data-group]").evaluate((el) => el.textContent), /, 2 times/);
+ assert.equal(await page.evaluate(() => window.hit), false);
+ await context.close();
+ }
+ const { page, context } = await bell(`[${GROUP(", count: 40")}]`);
+ assert.equal(await page.locator(".notification-count").innerText(), "×40", "a whole number above 0 is the app's");
+ await context.close();
+ });
+});
+
+describe("one unread rule", () => {
+ test("a group's own flag is ignored: read entries make a read group, whatever it says, and the count, the dot and Mark all as read agree", async () => {
+ const { page, context } = await bell(`[${GROUP(", unread: true")}]`);
+ const group = page.locator(".notification[data-group]");
+ assert.equal(await group.getAttribute("data-unread"), null);
+ assert.doesNotMatch(await group.evaluate((el) => el.textContent), /^Unread/);
+ assert.equal(await page.locator(".notifications-count").innerText(), "0 unread");
+ assert.equal(await page.locator(".notifications-mark").getAttribute("aria-disabled"), "true");
+ assert.equal(await page.locator("#bell > .btn .notifications-dot").evaluate((el) => el.hidden), true);
+ await context.close();
+ });
+
+ test("and the reverse: one unread entry makes the group unread, though it says it is read", async () => {
+ const { page, context } = await bell(`[{ id: 'g', title: 'Two comments', time: '1m', unread: false, entries: [{ id: 'g1', title: 'A', time: '1m', unread: true }, { id: 'g2', title: 'B', time: '2m' }] }]`);
+ assert.equal(await page.locator(".notification[data-group]").getAttribute("data-unread"), "");
+ assert.equal(await page.locator(".notifications-count").innerText(), "1 unread");
+ assert.equal(await page.locator(".notifications-mark").getAttribute("aria-disabled"), null);
+ await context.close();
+ });
+});
+
+describe("setEntries keeps the reader's place", () => {
+ test("an open group stays open and the focused entry keeps focus when the list is drawn again", async () => {
+ const { page, context } = await bell(`[${GROUP()}, { id: 'd', title: 'Deploy finished', time: '1h', status: 'success' }]`);
+ await page.locator(".notification[data-group]").click();
+ await page.locator('.notification[data-id="g2"]').focus();
+ await page.evaluate(() => window.centre.setEntries([
+ { id: "n", title: "New: build queued", time: "now", unread: true },
+ { id: "g", title: "Ines, Tomas and Ruth commented", time: "12m", entries: [{ id: "g1", title: "Ines commented", time: "12m" }, { id: "g2", title: "Tomas commented", time: "20m" }] },
+ { id: "d", title: "Deploy finished", time: "1h", status: "success" },
+ ]));
+ await frames(page);
+ assert.equal(await page.locator(".notification[data-group]").getAttribute("aria-expanded"), "true");
+ assert.equal(await page.locator(".notification-entries").evaluate((el) => el.hidden), false);
+ assert.equal(await page.evaluate(() => document.activeElement?.dataset.id), "g2");
+ // An entry that is gone leaves focus where the browser puts it; nothing throws.
+ await page.evaluate(() => window.centre.setEntries([{ id: "d", title: "Deploy finished", time: "1h" }]));
+ await frames(page);
+ assert.equal(await page.locator(".notification").count(), 1);
+ await context.close();
+ });
+});
+
+describe("errors never group", () => {
+ test("a danger entry in a group is drawn at the top level right after it, and a group of errors alone is no group", async () => {
+ const { page, context } = await bell(`[{ id: 'g', title: 'Three builds', time: '1m', entries: [{ id: 'a', title: 'Build 1 passed', time: '1m', status: 'success' }, { id: 'b', title: 'Build 2 failed', time: '2m', status: 'danger' }, { id: 'c', title: 'Build 3 passed', time: '3m', status: 'success' }] }, { id: 'h', title: 'Two failures', time: '9m', entries: [{ id: 'e1', title: 'Lint failed', time: '9m', status: 'danger' }] }]`);
+ const top = await page.locator(".notifications-list > li > .notification").evaluateAll((els) => els.map((e) => e.dataset.id));
+ assert.deepEqual(top, ["g", "b", "e1"]);
+ assert.equal(await page.locator(".notification-count").innerText(), "×2");
+ await page.locator('.notification[data-id="b"]').click();
+ assert.equal(await page.evaluate(() => window.chosen), "b", "a lifted entry is chosen as itself");
+ await context.close();
+ });
+});
+
+describe("the group's chevron and current", () => {
+ for (const dir of ["ltr", "rtl"]) {
+ test(`it points to the end while closed and down while open (${dir}), and a current group is aria-current`, async () => {
+ const { page, context } = await bell(`[${GROUP(", current: true")}]`, { dir });
+ const group = page.locator(".notification[data-group]");
+ assert.equal(await group.getAttribute("aria-current"), "true");
+ const transform = () => page.locator(".notification-caret").evaluate((el) => getComputedStyle(el).transform);
+ // The drawing is chevron-right: as it is in left to right, mirrored in right to left.
+ assert.equal(await transform(), dir === "rtl" ? "matrix(-1, 0, 0, 1, 0, 0)" : "none");
+ await group.click();
+ await frames(page);
+ // Down while open, in both directions: a quarter turn of the chevron-right drawing.
+ assert.match(await transform(), /^matrix\(6\.1\d*e-17, 1, -1, 6\.1\d*e-17, 0, 0\)$|^matrix\(0, 1, -1, 0, 0, 0\)$/);
+ await context.close();
+ });
+ }
+});
diff --git a/tools/html-skill/test/parity.test.mjs b/tools/html-skill/test/parity.test.mjs
index aace675a..13248f05 100644
--- a/tools/html-skill/test/parity.test.mjs
+++ b/tools/html-skill/test/parity.test.mjs
@@ -301,8 +301,8 @@ const MENU_ROWS = {
react: `import { DownloadIcon, TrashIcon } from "@phosphor-icons/react";`,
menuReact: `Duplicate Sort by Name Date Show hidden Delete `,
};
-const NOTES = `[{ id: "a", title: "Deploy finished", description: "api, production", time: "2m ago", status: "success", unread: true }, { id: "b", title: "Build failed", time: "1h ago", status: "danger", unread: true }, { id: "c", title: "Invoice ready", time: "Yesterday" }]`;
-const NOTES_SKILL = NOTES.replaceAll('status: "success"', "status: 'success'");
+const NOTES = `[{ id: "a", title: "Deploy finished", description: "api, production", time: "2m ago", status: "success", unread: true }, { id: "b", title: "Build failed", time: "1h ago", status: "danger", unread: true }, { id: "c", title: "Invoice ready", time: "Yesterday" }, { id: "d", title: "In review: update the cache keys", time: "Yesterday", status: "pending" }, { id: "e", title: "Ines, Tomas and Ruth commented on your change", time: "2d", entries: [{ id: "e1", title: "Ines commented", time: "2d", unread: true }, { id: "e2", title: "Tomas commented", time: "3d" }] }]`;
+const NOTES_SKILL = NOTES.replaceAll('status: "success"', "status: 'success'").replaceAll('status: "pending"', "status: 'pending'");
const OV_RECT = ["rectLeft", "rectTop", "boxWidth", "boxHeight"];
const OVERLAYS = [
@@ -541,6 +541,11 @@ const OVERLAYS = [
["entry plate", ".basalt-notification:not(:hover)", ".notification:not(:hover)", ["top", "bottom", "borderTopLeftRadius", "backgroundColor"], { pseudo: "::before" }],
["unread dot", ".basalt-notification[data-unread] .basalt-notification-dot", ".notification[data-unread] .notification-dot", ["boxWidth", "boxHeight", "backgroundColor", "borderTopLeftRadius", "marginTop"]],
["status mark", ".basalt-notification[data-status=success] .basalt-notification-mark", ".notification[data-status=success] .notification-mark", ["boxWidth", "boxHeight", "color", "marginTop"]],
+ ["pending mark", ".basalt-notification[data-status=pending] .basalt-notification-mark", ".notification[data-status=pending] .notification-mark", ["boxWidth", "boxHeight", "color", "marginTop"]],
+ ["group row", ".basalt-notification[data-group]", ".notification[data-group]", [...GEOMETRY, "color", "boxHeight", "gridTemplateColumns"]],
+ ["group count", ".basalt-notification-count", ".notification-count", [...TYPE, "color", "marginLeft", "fontVariantNumeric", "boxWidth"]],
+ ["group caret", ".basalt-notification-caret", ".notification-caret", ["boxWidth", "boxHeight", "color", "marginLeft"]],
+ ["group entries", ".basalt-notification-entries", ".notification-entries", ["paddingLeft", "listStyleType", "marginTop"]],
["unread title", ".basalt-notification[data-unread] .basalt-notification-title", ".notification[data-unread] .notification-title", [...TYPE, "color", "boxHeight"]],
["read title", ".basalt-notification:not([data-unread]) .basalt-notification-title", ".notification:not([data-unread]) .notification-title", ["color"]],
["line", ".basalt-notification-line", ".notification-line", [...TYPE, "color", "boxHeight", "whiteSpace"]],
diff --git a/tools/review/round60.tsx b/tools/review/round60.tsx
new file mode 100644
index 00000000..a8a68209
--- /dev/null
+++ b/tools/review/round60.tsx
@@ -0,0 +1,293 @@
+// Round 60: notices and search (cimip-gaps-2, batch B7; DECISIONS 265, the no-council path). Built and decided by Opus inside foundations; the code
+// review is Astra's and the pixels are the lead's. Every part in two unlike domains with synthetic data: a build pipeline and a support inbox for
+// the notification center, and a shared handbook and a support inbox's messages for the search. States: the bell open in each domain, a group opened, the page form
+// on a phone with the tab bar, the list in a sidebar with a current entry, and the search with results, a current passage, its first load (bones),
+// a slow changed query (the last results kept, "Searching"), and no results; forced colours and reduced motion for each.
+
+import * as React from "react";
+
+import {
+ Card,
+ FilterResult,
+ Heading,
+ LoadingShape,
+ markMatches,
+ NotificationCenter,
+ NotificationList,
+ NotificationsGlyph,
+ Refreshing,
+ SearchField,
+ SearchPassage,
+ SearchPassages,
+ standIn,
+ TabBar,
+ TabBarItem,
+ Text,
+ HomeGlyph,
+ SearchGlyph,
+ SettingsGlyph,
+} from "../../packages/react/src/index";
+import type { MatchRange, NotificationEntry, StandInVariant } from "../../packages/react/src/index";
+import type { Round } from "./rounds";
+
+const kindOf = (state: string) => state.replace(/-(reduced-motion|forced-colours)$/, "");
+
+// ---- Two domains for the notification center ----
+
+const PIPELINE: NotificationEntry[] = [
+ { id: "p1", title: "Waiting on you: approve release 4.2", description: "web, production", time: "4m", status: "pending", unread: true, href: "#release-4-2" },
+ {
+ id: "p2",
+ title: "Ines, Tomas and Ruth commented on your change",
+ description: "Add retries to the upload worker",
+ time: "12m",
+ entries: [
+ { id: "p2a", title: "Ines Ortega commented", description: "Can we cap the retries at five?", time: "12m", unread: true, href: "#c1" },
+ { id: "p2b", title: "Tomas Lindqvist commented", description: "Backoff looks right to me.", time: "20m", unread: true, href: "#c2" },
+ { id: "p2c", title: "Ruth Achebe commented", description: "Please add a test for the timeout.", time: "31m", href: "#c3" },
+ ],
+ },
+ { id: "p3", title: "Deploy finished", description: "api, staging", time: "1h", status: "success", unread: true, href: "#deploy" },
+ { id: "p4", title: "Disk usage above 85%", description: "runner-07", time: "3h", status: "warning", href: "#runner" },
+ { id: "p5", title: "Nightly build failed", description: "3 tests failing", time: "Yesterday", status: "danger", href: "#nightly" },
+ { id: "p6", title: "In review: update the cache keys", description: "Requested by Ruth Achebe", time: "Yesterday", status: "pending", href: "#review" },
+];
+
+const INBOX: NotificationEntry[] = [
+ { id: "i1", title: "Waiting on your reply: ticket 4821", description: "Refund for a duplicate charge", time: "2m", status: "pending", unread: true, href: "#t4821" },
+ {
+ id: "i2",
+ title: "Mia, Arjun and Leo replied on tickets you follow",
+ time: "9m",
+ count: 5,
+ entries: [
+ { id: "i2a", title: "Mia Santos replied on 4810", description: "The customer confirmed the new address.", time: "9m", unread: true, href: "#t4810" },
+ { id: "i2b", title: "Arjun Mehta replied on 4802", description: "Escalated to the billing queue.", time: "26m", unread: true, href: "#t4802" },
+ { id: "i2c", title: "Leo Brandt replied on 4799", description: "Sent the replacement order.", time: "48m", href: "#t4799" },
+ ],
+ },
+ { id: "i3", title: "Ticket 4790 was closed", description: "Password reset link expired", time: "1h", status: "success", href: "#t4790" },
+ { id: "i4", title: "You were added to the Billing queue", time: "2h", href: "#billing" },
+ { id: "i5", title: "In review: your article draft", description: "How to change a plan", time: "Yesterday", status: "pending", href: "#draft" },
+];
+
+const leaves = (entries: NotificationEntry[]) => entries.flatMap((e) => e.entries ?? [e]);
+const readAll = (entries: NotificationEntry[]): NotificationEntry[] => entries.map((e) => ({ ...e, unread: false, entries: e.entries?.map((c) => ({ ...c, unread: false })) }));
+
+/** Opens the first group once it is drawn (a real press on its row), for the states that show a group open. */
+function useOpenGroup(on: boolean) {
+ React.useEffect(() => {
+ if (!on) return undefined;
+ const timer = window.setTimeout(() => document.querySelector(".basalt-notification[data-group]")?.click(), 120);
+ return () => window.clearTimeout(timer);
+ }, [on]);
+}
+
+function Bell({ state }: { state: string }) {
+ const kind = kindOf(state);
+ const inbox = kind.startsWith("inbox");
+ const [entries, setEntries] = React.useState(inbox ? INBOX : PIPELINE);
+ useOpenGroup(kind.endsWith("group"));
+ return (
+
+ {inbox ? "A support inbox" : "A build pipeline"}
+ setEntries(readAll(entries))} onClearAll={() => setEntries([])} viewAllHref="#all" />
+
+ );
+}
+
+// ---- The page form, on a phone, and the list in a sidebar ----
+
+function PhonePage({ state }: { state: string }) {
+ const kind = kindOf(state);
+ const inbox = kind.startsWith("inbox");
+ const [entries, setEntries] = React.useState(inbox ? INBOX : PIPELINE);
+ useOpenGroup(kind.endsWith("group"));
+ const unread = leaves(entries).filter((e) => e.unread).length;
+ if (kind === "sidebar") return ;
+ return (
+
+ Notifications
+ setEntries(readAll(entries))} onClearAll={() => setEntries([])} />
+
+ Home
+ Search
+ 0 ? `${unread} unread` : undefined}>Notifications
+ Settings
+
+
+ );
+}
+
+const SIDEBAR: NotificationEntry[] = [
+ { id: "s1", title: "Upload worker retries", description: "Ines Ortega · 3 comments", time: "12m", unread: true, href: "#s1" },
+ { id: "s2", title: "Cache keys for the CDN", description: "Waiting on your review", time: "1h", status: "pending", current: true, href: "#s2" },
+ { id: "s3", title: "Release 4.2", description: "Deployed to staging", time: "3h", status: "success", href: "#s3" },
+ { id: "s4", title: "Nightly build", description: "3 tests failing", time: "Yesterday", status: "danger", href: "#s4" },
+];
+
+function Sidebar() {
+ return (
+
+
+
+ Cache keys for the CDN
+ The page for the current entry. The list in the sidebar has no head band, and its current entry is its title at 600.
+
+
+ );
+}
+
+// ---- The search, in two domains ----
+
+interface Hit { source: string; meta: string; text: string }
+const HANDBOOK: { query: string; label: string; hits: Hit[] } = {
+ query: "laptop",
+ label: "Search the handbook",
+ hits: [
+ { source: "Your first week › Equipment", meta: "Section 2", text: "Your laptop arrives on your first morning. Someone from IT sets the laptop up with you, and you choose a password together." },
+ { source: "Working remotely › Security", meta: "Section 5", text: "Lock your laptop whenever you step away, and never leave it in a car. A lost laptop is reported the same day." },
+ { source: "Travel › What to pack", meta: "Section 7", text: "Bring the laptop charger and the travel adapter; the office keeps spares of neither." },
+ { source: "Leaving › Returning equipment", meta: "Section 9", text: "Return the laptop, its charger and your badge on your last day. A courier can collect them if you work from home." },
+ ],
+};
+const INBOX_SEARCH: { query: string; label: string; hits: Hit[] } = {
+ query: "refund",
+ label: "Search the inbox",
+ hits: [
+ { source: "Dana Whitfield · ticket 4821", meta: "2m ago", text: "I was charged twice for the same order. Could you refund the second charge to the original card?" },
+ { source: "You · ticket 4821", meta: "1m ago", text: "Thanks, Dana. I have started the refund for the duplicate charge; it reaches your card in three to five days." },
+ { source: "Omar Reyes · ticket 4766", meta: "Tue", text: "The refund arrived, but the confirmation email still shows the old total." },
+ { source: "Hana Sato · ticket 4702", meta: "Nov 3", text: "Is a refund possible after thirty days if the item never shipped?" },
+ { source: "You · ticket 4702", meta: "Nov 3", text: "Yes: an order that never shipped is refunded in full, whenever you ask. I have sent it now." },
+ ],
+};
+
+/** What a server's highlighter returns: every place the words were found. */
+const rangesOf = (text: string, query: string): MatchRange[] => {
+ const out: MatchRange[] = [];
+ if (!query) return out;
+ const lower = text.toLowerCase();
+ for (let at = lower.indexOf(query); at >= 0; at = lower.indexOf(query, at + query.length)) out.push([at, at + query.length]);
+ return out;
+};
+
+function Passages({ hits, query, current, label, rows }: { hits: Hit[]; query: string; current?: number; label: string; rows?: number }) {
+ return (
+
+ {hits.map((hit, i) => (
+ {}}>
+ {markMatches(hit.text, rangesOf(hit.text, query))}
+
+ ))}
+
+ );
+}
+
+const standInHits = (variant: StandInVariant): Hit[] =>
+ [0, 1, 2].map((i) => ({ source: standIn(i * 3 + 1, 18, variant), meta: standIn(i * 3 + 2, 6, variant), text: standIn(i * 3 + 3, 110, variant) }));
+
+function Search({ state }: { state: string }) {
+ const kind = kindOf(state);
+ const domain = kind.startsWith("inbox") ? INBOX_SEARCH : HANDBOOK;
+ const [query, setQuery] = React.useState(kind === "none" ? "keyboard tray" : domain.query);
+ const loading = kind === "loading";
+ // The inbox's panel holds a budget of three passages; the handbook's list grows with the page.
+ const budget = domain === INBOX_SEARCH ? 3 : undefined;
+ const refreshing = kind === "refreshing";
+ const none = kind === "none";
+ const hits = none ? [] : domain.hits;
+ const count = none ? "No passages match" : hits.length === 1 ? "1 passage" : `${hits.length} passages`;
+ return (
+
+
+ {domain === INBOX_SEARCH ? "Support inbox" : "Team handbook"}
+ {domain === INBOX_SEARCH ? "A support inbox: the search runs on the server over every ticket's messages; the results hold a budget of three passages and scroll inside." : "A shared document: the search runs on the server and returns passages with their matches."}
+
+
+
+
+
+ {loading ? : {count} }
+
+
+
+ }>
+ {() => (none
+ ? Nothing in the handbook matches “keyboard tray”.
+ : )}
+
+
+
+ );
+}
+
+const ALSO = (list: string[]) => [...list, ...list.slice(0, 2).flatMap((s) => [`${s}-forced-colours`, `${s}-reduced-motion`])];
+
+export const ROUND_60: Round = {
+ id: "60",
+ title: "Notices and search: the pending mark, grouped repeats, the page form and search with server results (cimip-gaps-2, B7)",
+ reviewed: false,
+ summary:
+ "Five gaps from building CIMIP, made general (DECISIONS 265, no council): the notification center's pending mark (the empty ring of the toast's marks, no colour), grouped repeats with names and a count that open in place, a page form (`NotificationList`) for a phone's tab bar and for a sidebar, an in-page search whose passages come from a server (`SearchField`, `SearchPassages`, `SearchPassage`, `SearchMatch`, `markMatches`) and loads with `LoadingShape`, and the US names `NotificationCenter` and `NotificationCenterProps`. Decided and built by Opus; the code review is Astra's and has not happened yet, and the design panel did not review it. Synthetic data in four domains: a build pipeline, a support inbox, a shared handbook and a support inbox's messages.",
+ steps: [
+ {
+ id: "bell",
+ name: "The bell: pending and a group",
+ intro: "The notification center in a build pipeline and in a support inbox. Each has entries waiting on the reader (pending), a group of repeats, and the toast's three marks.",
+ decisions: [
+ "Pending is the toast's ring with nothing in it: Phosphor's Circle at 16, the same drawing as CheckCircle and XCircle, in secondary ink. Waiting is not a warning, so it has no colour. Badge's 6px ring was the first choice, but in the 16px mark seat it sat 10px from the 6px unread dot as a second, hollow dot: it read as a read state. The title says it in words (\"Waiting on you: …\"); the mark is aria-hidden like every mark.",
+ "A group is the app's: `entries` on an entry. Its row is a button (aria-expanded) with the app's title naming who and what, then the toast's count (\"×3\", spoken \", 3 times\") and the core chevron on the disclosure's convention (to the end while closed, mirrored right to left, down while open). The title is cut first; the count and the chevron always show. `count` covers a group the app holds more of than it lists (×5 with three listed).",
+ "A group opens in place under its row on the reveal's track (0fr to 1fr over duration-slow, ease-out; at once under reduced motion), its entries indented by the dot's and the mark's seats, so their seats sit under the group's words. Focus stays on the row: its entries are the next tab stops. They join the hover glide.",
+ "One unread rule for the row, the dot, the count and Mark all as read: a group is unread while any of its entries is, and its own flag is ignored; the bell counts the entries, so three unread mentions are \"3 unread\". Errors are never grouped, as the toast never groups them: a danger entry in a group is drawn at the top level right after it.",
+ ],
+ tryIt: [
+ "Open the group: three comments open under it. Tab: focus goes from the group's row to its first comment.",
+ "Mark all as read: the dots go, the titles step to secondary, and nothing moves, the group included.",
+ ],
+ states: ALSO(["inbox", "pipeline-group", "inbox-group"]),
+ widths: [1440, 390],
+ height: 720,
+ touch: true,
+ demo: ({ state }) => ,
+ },
+ {
+ id: "page",
+ name: "The page form: a tab bar's destination, and a sidebar",
+ intro: "On a phone the bell does not fit the header beside the page's buttons. `NotificationList` is the center's entries in the page, which the tab bar links to; the same list without its head is a sidebar's list of entries.",
+ decisions: [
+ "A page, not a sheet: a tab bar's cells are links to pages (never a tablist or a button), so the destination is the app's own notifications page, the same page \"View all\" opens. The tab bar's cell is `TabBarItem` with `NotificationsGlyph` and its `dot` (\"3 unread\" is spoken; counts are never drawn). From 720 the app shows the bell in its header instead.",
+ "The same rows, seats, groups and words as the popover, with no popover, no title (the page's heading names the list, by aria-labelledby) and no glide: each entry paints its own plate, the page's solid plate. No rim: a list in the page, not an object. Paging is the app's (`ListBand` under it).",
+ "Clear all (DECISIONS 269, the owner's): with `onClearAll` the page form has a foot with \"Clear all\" at its start, as the center's foot has, and no \"View all\" (this is that page). Once nothing is left it stays, disabled in place, and keeps focus.",
+ "`head={false}` drops the count and \"Mark all as read\", for a list of entries in a sidebar; `current` marks the entry for the page on screen with aria-current and its title at 600 from 400 (one cut line, so nothing moves). This closes batch B6's \"entries outside the notification center\".",
+ ],
+ tryIt: ["On the phone, open the group, then Mark all as read: the tab bar's dot goes.", "In the sidebar, the current entry is the one at 600."],
+ states: [...ALSO(["inbox", "pipeline-group"]), "sidebar@1440", "sidebar-forced-colours@1440"],
+ widths: [390, 1440],
+ height: 844,
+ touch: true,
+ demo: ({ state }) => ,
+ },
+ {
+ id: "search",
+ name: "Search in a panel, with results from a server",
+ intro: "A search over one place (a handbook, an inbox's messages) that runs on the server and returns passages with the matched words marked. It is in the page or a panel; the site's search dialog is unchanged.",
+ decisions: [
+ "Composed, not a new dialog: `SearchField` (an Input with the core search glyph and one clear ×; the first Esc empties it, the next is the app's), the app's count line (`FilterResult`: drawn at once, spoken once it holds still), and `SearchPassages`, an ordered list of `SearchPassage`s, in a `LoadingShape`. `SearchDialog` and `SearchResults` stay the site search's: a fixed-height area of picture rows.",
+ "A passage is a link or a button with the notification entry's row geometry: the source (who said it, or the section) in primary at 400, cut, with the meta at the head's end in tertiary, and the passage under it in secondary, wrapping. `current` is the passage shown beside the results: aria-current and the source at 600.",
+ "A match is a `mark` in primary ink at 600 with no fill: monochrome, so the ink and the weight are the mark, never a highlighter colour. `markMatches(text, ranges)` draws a server's ranges (joined, clamped, any order) and never parses HTML.",
+ "A results budget the caller sets (Sol's audit, F7): `rows` (and `lines`, 2 by default) make the list as tall as that many passages, scrolling inside, so the field and the count never move; unset, it grows with the page. The site search's `SearchResults` keeps its counts as a shop's presets (three logo rows, five picture rows, See all) that any app overrides. The query, its paging and any grouping stay the app's.",
+ "The first results load as bones in the list's own shape; a changed query keeps the last results on screen (`refreshing`) and shows \"Searching\" only after a second. No results is the app's sentence in the list's place.",
+ ],
+ tryIt: ["Type in the field: Esc empties it; the × does too.", "Hover a passage: the plate, and the meta lifts to secondary."],
+ states: ["inbox", "inbox-current", "loading", "refreshing", "none", "inbox-current-forced-colours", "loading-forced-colours", "inbox-reduced-motion", "loading-reduced-motion"],
+ widths: [1440, 390],
+ height: 720,
+ touch: true,
+ demo: ({ state }) => ,
+ },
+ ],
+};
diff --git a/tools/review/rounds.tsx b/tools/review/rounds.tsx
index 8751b739..c90230ea 100644
--- a/tools/review/rounds.tsx
+++ b/tools/review/rounds.tsx
@@ -124,6 +124,7 @@ import { ROUND_55 } from "./round55";
import { ROUND_56 } from "./round56";
import { ROUND_57 } from "./round57";
import { ROUND_58 } from "./round58";
+import { ROUND_60 } from "./round60";
export interface Step {
id: string;
@@ -687,3 +688,4 @@ ROUNDS.push(ROUND_55);
ROUNDS.push(ROUND_56);
ROUNDS.push(ROUND_57);
ROUNDS.push(ROUND_58);
+ROUNDS.push(ROUND_60);