Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .agent/mise-tasks/check/comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the check's comments step, the width of every comment line in the tracked TS, JS, CSS, shell, and TOML files, 100 columns at most"
# Runs scripts/check/comments.sh, one step of the check.
set -euo pipefail
exec scripts/check/comments.sh "$@"
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ All notable changes to `@standards-lab/web-components` are documented here. The
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the package adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2026-12-01

This minor release breaks a consumer on web-foundation 0.4: the foundation peer is `^0.5.0`. It
also changes how the frameless lists lay out: `sl-pagination`, `sl-document-list`, and
`sl-search-results` scroll their list inside a host whose height is held, where the page scrolled
past them, and `sl-pagination` insets its list and the rows around it by `--focus-reach`, so a page
that measured or padded around them checks its layout.

### Added

- `sl-drawer` gains the `initial-focus` attribute, the `initialFocus` property, which names the id
of a child control for the modal drawer to focus as it opens, in place of its heading. With no
child of that id, the drawer opens on its heading; docked, it focuses nothing. The drawer
specimen's Documents drawer names its filter.
- A browser test opens every example page's dialogs and drawers and checks that each opens on its
first control that edits or chooses, or else on its heading, and never on Close.
- The check gains a comments step, `scripts/check/comments.sh`, which fails on any comment line
longer than 100 columns in the tracked TS, JS, CSS, shell, and TOML files, naming the file and
line; it skips `#MISE` lines. The comment lines it found are rewrapped.
- `sl-pagination` gains a `before` slot, whose children sit on lines of their own between the
summary and the entries, outside the page that scrolls.

### Changed

- **Breaking:** the foundation peer is `@standards-lab/web-foundation` at `^0.5.0`, up from
`^0.4.0`, and the development pin is its v0.5.0 tag; a consumer on 0.4 takes 0.5 beside the
components.
- The example pages' Help and Settings dialogs hold `sl-shortcuts` and `sl-settings` in the
foundation's `.dialog-body`, which scrolls under the dialog's header, as the README's markup does.
- The repository's tooling takes pnpm 12.25.1 and globals 17.15.0.
- `sl-pagination`, `sl-document-list`, and `sl-search-results` fill a host whose height is held,
by a size on the host or a sized flex or grid parent, and scroll their list inside it while the
summary, the status line, and the pagination's controls stay in view. When the host's height
isn't held, each is as tall as its content. Each is a flex column whose list, and the rows above
and below it, are inset by the focus outline's reach, so a focused item's outline stays whole
inside the scroller.
- `sl-document-list`'s status line, when it doesn't join the summary, sits in the pagination's
`before` slot, so it stays in view as the entries scroll.
- The specimen pages' narrow section is 390px wide, the narrow case at text 100%, in place of
20rem.

## [0.3.0] - 2026-11-30

### Added
Expand Down Expand Up @@ -119,6 +160,7 @@ All notable changes to `@standards-lab/web-components` are documented here. The
- Releases by tag: each `v<version>` tag marks a pack commit whose tree is the pack, the build
included, and whose one parent is main's merge commit; its GitHub release carries the tarball.

[0.4.0]: https://github.com/standards-lab/web-components/releases/tag/v0.4.0
[0.3.0]: https://github.com/standards-lab/web-components/releases/tag/v0.3.0
[0.2.0]: https://github.com/standards-lab/web-components/releases/tag/v0.2.0
[0.1.0]: https://github.com/standards-lab/web-components/releases/tag/v0.1.0
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Each release is a tag, `v<version>`, of
[standards-lab/web-components](https://github.com/standards-lab/web-components), whose tree is the
package as `pnpm pack` builds it: `package.json`, this README, the LICENSE, and `dist/`, the build.
The build lives only in the tag's tree, so the tag installs with no build step, and its manifest
has no scripts. It depends on lit 3.3.3 and marked 18.2.1, and takes the foundation as a peer at
`^0.4.0` and the icons at `^0.1.0`: a consumer declares each beside the components, so the page
has no scripts. It depends on lit 3.3.3 and marked 18.4.0, and takes the foundation as a peer at
`^0.5.0` and the icons at `^0.1.0`: a consumer declares each beside the components, so the page
and the components share one copy of each, and a restyle of the foundation's sheets by package
name reaches the components' shadow roots too. Install all three by their tags:

```
pnpm add github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0
bun add github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0
npm install --allow-git=root github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0
pnpm add github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0
bun add github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0
npm install --allow-git=root github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0
```

npm 12 refuses git dependencies unless `--allow-git` allows them; `root` allows the ones the
Expand Down Expand Up @@ -57,7 +57,7 @@ the foundation's `page.css`:
- `./pagination.js`: `sl-pagination`, a page of entries between its summary and its controls.
- `./drawer.js`: `sl-drawer`, its children docked inline on a wide viewport, in a modal drawer
below, or in the modal drawer at every width with `modal`; `frameless` docks them with no frame
and no visible heading.
and no visible heading, and `initial-focus` names the child the modal drawer opens on.
- `./shortcuts.js`: `sl-shortcuts`, the keyboard shortcuts of the dialog that holds it, as a table.
- `./settings.js`: `sl-settings`, the reader's theme and keyboard settings, applied and stored at
once.
Expand All @@ -82,11 +82,11 @@ documents each module in full, and its example pages.
The components bind no key, so the page binds S and ? itself, as `examples/components.html` does.
Two glyph buttons in the header's `.header-actions` open the dialogs with `command="show-modal"`,
and the foundation's `keys.js` binds each to its key through `data-keys`. Help is a `.dialog-fit`
dialog holding `sl-shortcuts`, and Settings is a `.dialog-wide` dialog holding `sl-settings`; each
has a `.dialog-header` whose Close shows the Esc hint. Close and Escape close either dialog with no
script, and focus returns to the element that held it. The page links the foundation's
`glyph-button.css`, `dialog.css`, and `layout.css` after its entry, and web-icons' `iconFill()`
fills the glyphs' markers:
dialog holding `sl-shortcuts`, and Settings is a `.dialog-wide` dialog holding `sl-settings`, each
in a `.dialog-body` that scrolls under a `.dialog-header` whose Close shows the Esc hint. Close and
Escape close either dialog with no script, and focus returns to the element that held it. The page
links the foundation's `glyph-button.css`, `dialog.css`, and `layout.css` after its entry, and
web-icons' `iconFill()` fills the glyphs' markers:

```html
<header>
Expand Down Expand Up @@ -139,7 +139,9 @@ fills the glyphs' markers:
</button>
<div id="help-close-hint" class="glyph-hint" popover="hint" aria-hidden="true">Close</div>
</header>
<sl-shortcuts></sl-shortcuts>
<div class="dialog-body">
<sl-shortcuts></sl-shortcuts>
</div>
</dialog>
<dialog id="settings" class="dialog-wide" aria-labelledby="settings-title">
<header class="dialog-header">
Expand All @@ -158,7 +160,9 @@ fills the glyphs' markers:
</button>
<div id="settings-close-hint" class="glyph-hint" popover="hint" aria-hidden="true">Close</div>
</header>
<sl-settings></sl-settings>
<div class="dialog-body">
<sl-settings></sl-settings>
</div>
</dialog>
<script type="module">
import "@standards-lab/web-foundation/keys.js";
Expand Down Expand Up @@ -203,7 +207,8 @@ and profiles, and web-tooling's
documents them. The check never runs it.

The check lints with ESLint, Prettier, shellcheck, actionlint, and marathon's lint-context and
lint-references. It runs the step scripts in `scripts/check/` in turn and stops at the first that
lint-references, and holds every comment line in the tracked code, stylesheets, shell, and TOML to
100 columns. It runs the step scripts in `scripts/check/` in turn and stops at the first that
fails; an agent (`MISE_ENV=agent`) also has a `check:<step>` task for each. CI runs
`mise run install` and the check on each pull request to main and each push to it.
[docs/development.md](https://github.com/standards-lab/web-components/blob/main/docs/development.md)
Expand Down
4 changes: 2 additions & 2 deletions STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ The architecture pages that apply, in the architecture repository:
- `architecture/standards/web-elemental/principles/app-keys.md`: no component binds a key; only the
app binds keys.
- `architecture/standards/web-elemental/principles/dialog-focus.md`: `sl-drawer` opens on its
heading, and `sl-settings` focuses its checked radio unless its dialog marks something
`autofocus`.
heading unless it names a slotted control to open on, and `sl-settings` focuses its checked
radio unless its dialog marks something `autofocus`.

## Design

Expand Down
56 changes: 33 additions & 23 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ the tests measure as they do.
any parent, a shrink-to-fit one too, and stays inside its box down to 16rem, its supported minimum
width.
- `./pagination.js`: `sl-pagination`, a page of entries between its summary and its controls, a
`status` slot running on after the summary's text; it dispatches `page-change` and
`page-size-change`.
`status` slot running on after the summary's text, and a `before` slot on lines of its own
between the summary and the entries; it dispatches `page-change` and `page-size-change`. Held to
a height, the entries scroll while the summary, the `before` slot, and the controls stay in
view; unheld, it is as tall as its content.
- `./drawer.js`: `sl-drawer`, its children in the default slot, in one of two shadow wrappers by
the viewport. At `dock`, a CSS length, 48rem by default, and wider, read in the media query
`(width < <dock>)` so that exactly `dock` docks, they sit in an `aside` docked inline as an
Expand All @@ -34,13 +36,16 @@ the tests measure as they do.
named "Close" and the label, a name it shows as a hint on hover and keyboard focus; the `close`
slot replaces "Close" for a translation. As it opens, focus lands on its heading,
`tabindex="-1"` and `autofocus`, not on the Close button; the heading shows no focus outline and
is out of the Tab order, so Tab from it reaches the Close button. The Close button, Escape,
`close()`, or `toggle()` closes it, and focus returns to what opened it. It dispatches `open`
and `close` as the modal drawer opens and closes, never as the viewport crosses `dock`, which
swaps only the wrapper, so the slotted content is never moved, disconnected, or re-created: an
open drawer docks, and docked content becomes a closed drawer. It slides only when the reader
allows motion. `modal`, a reflected boolean, makes it the modal dialog at every width, ignoring
`dock`; setting or removing it is a switch too, so it closes an open drawer silently.
is out of the Tab order, so Tab from it reaches the Close button. `initial-focus`, the
`initialFocus` property, names the id of a child control, such as a filter field, for the modal
drawer to focus as it opens instead; with no child of that id, focus stays on the heading, and a
docked drawer focuses nothing. The Close button, Escape, `close()`, or `toggle()` closes it, and
focus returns to what opened it. It dispatches `open` and `close` as the modal drawer opens and
closes, never as the viewport crosses `dock`, which swaps only the wrapper, so the slotted content
is never moved, disconnected, or re-created: an open drawer docks, and docked content becomes a
closed drawer. It slides only when the reader allows motion. `modal`, a reflected boolean, makes
it the modal dialog at every width, ignoring `dock`; setting or removing it is a switch too, so it
closes an open drawer silently.
`frameless`, a reflected boolean, draws the docked aside with no border, radius, or padding and
hides its heading visually, though the heading still names the aside; the modal drawer keeps its
frame and visible heading either way. Its mode is the custom state `docked` or `drawer`, which a page
Expand Down Expand Up @@ -129,14 +134,18 @@ the tests measure as they do.
case-insensitively as text for the query the matches were set with; its count names that query
too, and says how many of a paged search's `total` it shows, while any are shown, and with none,
"No matches" names the query the empty matches were set with; it dispatches `open` with a
match's id, and has loading and error states. It exports its match type and binds no key.
match's id, and has loading and error states. Held to a height, the matches scroll under the
status line, which stays in view; unheld, the results are as tall as their content. It exports
its match type and binds no key.
- `./document-list.js`: `sl-document-list`, a page of documents composed of the components above,
an `sl-entry` per document inside one `sl-pagination`, whose properties it takes under the same
names and hands through; it frames the selected document's entry, hands a document's
`status_tone` to its entry as its status tone, and has empty, loading, and error states, said
on the pagination's summary line when it shows one. The entry's `open` and the pagination's
`page-change` and `page-size-change` reach its listener as their parts sent them; it dispatches
none of its own. It exports its document type and binds no key.
none of its own. Held to a height, the entries scroll inside the pagination while its summary,
the status line, and its controls stay in view; unheld, it is as tall as its content. It exports
its document type and binds no key.

## Conversation

Expand Down Expand Up @@ -188,15 +197,16 @@ which the settings and shortcuts pages carry too. `examples/glyphs.js` fills the
markers. Each component has a specimen page, `examples/<name>.html`, for `status-badge`, `entry`,
`pagination`, `artifact-viewer`, `chat-thread`, `composer`, `upload-dropzone`, `stage-timeline`,
`event-log`, `search-results`, `document-list`, `drawer`, `settings`, and `shortcuts`. A specimen
page shows every state of its component, labelled, then again in a section 20rem wide, and, for a
component that holds a control, one instance reached by the keyboard to show its focus ring: the
screenshot script focuses the focus section's `[data-focus-start]` mark, which takes focus only by
script, then presses Tab as many times as the mark's value says, so `:focus-visible` matches. A page
whose component draws its own frame drops the dashed one, so a capture shows the component's frame
alone. The drawer's mode is the viewport's, so its page is an app's frame instead, its states the
page's at two widths: docked, and docked and frameless, at 1280px, and closed, open, open right to
left, and frameless and open at 480px; its Frameless checkbox sets the Documents drawer's
`frameless`. Its Outline drawer is `modal`, and its captures open it at 1280px, then reach its
Close by Tab. The settings and shortcuts captures add each page's dialog, opened by its key. The
specimen pages link the foundation's `page-full.css` and import its `register-full.js`, so a
profile applies by its attribute on the root.
page shows every state of its component, labelled, then again in a section 390px wide, the narrow
case at text 100%, and, for a component that holds a control, one instance reached by the keyboard
to show its focus ring: the screenshot script focuses the focus section's `[data-focus-start]` mark,
which takes focus only by script, then presses Tab as many times as the mark's value says, so
`:focus-visible` matches. A page whose component draws its own frame drops the dashed one, so a
capture shows the component's frame alone. The drawer's mode is the viewport's, so its page is an
app's frame instead, its states the page's at two widths: docked, and docked and frameless, at
1280px, and closed, open, open right to left, and frameless and open at 390px; its Frameless
checkbox sets the Documents drawer's `frameless`, and its `initial-focus` names the filter, which
the open drawer focuses. Its Outline drawer is `modal`, and its captures open it at 1280px, then
reach its Close by Tab. The settings and shortcuts captures add each page's dialog, opened by its
key. The specimen pages link the foundation's `page-full.css` and import its `register-full.js`, so
a profile applies by its attribute on the root.
8 changes: 8 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ Under `MISE_ENV=agent`, which the Claude settings set, `mise.agent.toml` adds a
in `.agent/mise-tasks/check/` for each step script, so an agent runs one step alone; a step that
reads `dist/` depends on `build`.

The comments step reads the TS, JS, CSS, shell, and TOML files `git ls-files` lists, so `dist/`,
`node_modules/`, and the lockfile stay out of it, and fails on any comment line longer than 100
columns, naming the file and line. Prettier's `printWidth` wraps code but never rewraps a comment,
and ESLint's `max-len` would read only the JS and TS and cost a devDependency, so the step is a
shell script with awk that counts columns in characters. A comment is a `//` line or a trailing
`//` after whitespace, a line within a `/* */` block, or, in shell and TOML, a `#` line or a
trailing `#` after whitespace. The step skips a `#MISE` line, which holds a task's description.

The browser type-check reads `dist/`: the browser cases' in-page modules read the declarations the
build ships. The test type-check doesn't: the tests import nothing from `dist/`.

Expand Down
3 changes: 3 additions & 0 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ each sheet is laid out as it is.
`show()` returns.
- The heading takes focus as the dialog opens, by its `tabindex="-1"` and `autofocus`, because
`autofocus` on the dialog itself does nothing in Chromium.
- The `initial-focus` control is focused just after `showModal()`, not marked `autofocus`: the
dialog's search for `autofocus` runs in flat-tree order and meets the heading before the slot,
and `autofocus` in the page's own markup would take focus as the page loads, docked too.

## Entry

Expand Down
Loading