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
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,33 @@ 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).

## [Unreleased]
## [0.3.0] - 2026-11-30

### Added

- `sl-drawer`'s `frameless` attribute, which 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.
- `sl-chat-thread`'s `after` slot: children slotted as `after`, such as a form the conversation
waits on, sit in the thread's frame after its items and scroll with them, and the thread follows
their growth as it follows the last item's, only while the reader is at the frame's end.
- `sl-chat-thread`'s `subagent_result` item, `{type, id?, name, status, href?, label?, content?,
error?}`: a sub-agent's result, shown with verbose on or off as a collapsed line, "Sub-agent", its
name, and its status, holding its link, then its error or its content rendered as Markdown; one
whose name or status isn't non-empty text, or whose other fields aren't text where given, is
skipped.
- `markdown()`'s `breaks` option, which keeps a paragraph's single line break, and `linkable(url)`,
whether a URL may be a link's href, from `./markdown.js`.

### Changed

- `sl-chat-thread` renders a user's `input_text` as Markdown with its line breaks kept, HTML shown
as its text, where it showed plain text; the assistant's Markdown still joins a paragraph's
lines.
- The repository's tooling takes marathon 0.25.0, pnpm 12.23.0, typescript-eslint 8.74.0,
chrome-headless-shell 158.0.8127.88, `@types/node` 26.6.11, ESLint 10.16.0,
eslint-plugin-boundaries 7.4.5, and jdx/mise-action v5.4.0.
- `marked` is at 18.3.0.
- `marked` is at 18.4.0, and the repository takes Node 26.14.0.
- The browser tier takes web-tooling 0.2.0, whose `launch()` runs the browser in a network
namespace of its own, so a link or address change on the machine no longer aborts the tests'
page loads with `ERR_NETWORK_CHANGED`. The machine now needs `unshare`, `ip`, and unprivileged
Expand All @@ -27,6 +46,13 @@ All notable changes to `@standards-lab/web-components` are documented here. The
- The demo pages are the example pages: `demo/` is `examples/`, `mise run demo` is
`mise run examples`, and their stylesheet is `examples/examples.css`, in the `examples` layer.

### Fixed

- `sl-chat-thread` goes on following when a delta arrives after content grew below the reader's
place and before the thread followed that growth, where it read the reader as scrolled up.
- In `sl-chat-thread`, a Markdown table's cells keep their words whole, no longer breaking them
mid-word, and a table wider than the thread scrolls sideways in its own box.

## [0.2.0] - 2026-11-22

### Removed
Expand Down Expand Up @@ -93,5 +119,6 @@ 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.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
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ and the components share one copy of each, and a restyle of the foundation's she
name reaches the components' shadow roots too. Install all three by their tags:

```
pnpm add github:standards-lab/web-components#v0.2.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.2.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.2.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.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
```

npm 12 refuses git dependencies unless `--allow-git` allows them; `root` allows the ones the
Expand Down Expand Up @@ -56,16 +56,19 @@ the foundation's `page.css`:
- `./entry.js`: `sl-entry`, one directory or file of a document hierarchy, as a button.
- `./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`.
below, or in the modal drawer at every width with `modal`; `frameless` docks them with no frame
and no visible heading.
- `./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.
- `./markdown.js`: `markdown(source)`, a Markdown string as a Lit template of plain elements.
- `./markdown.js`: `markdown(source, { breaks })`, a Markdown string as a Lit template of plain
elements, and `linkable(url)`, whether a URL may be a link's href.
- `./artifact-viewer.js`: `sl-artifact-viewer`, one artifact's content by its content type.
- `./event-log.js`: `sl-event-log`, events as a log in the order given.
- `./search-results.js`: `sl-search-results`, a search's matches under a status line.
- `./document-list.js`: `sl-document-list`, a page of documents, an `sl-entry` per document.
- `./chat-thread.js`: `sl-chat-thread`, a conversation's items in order.
- `./chat-thread.js`: `sl-chat-thread`, a conversation's items in order, and its `after` slot's
children after them.
- `./composer.js`: `sl-composer`, a multi-line text field and its send control.
- `./upload-dropzone.js`: `sl-upload-dropzone`, a zone that takes files, and the app's uploads.
- `./stage-timeline.js`: `sl-stage-timeline`, a run's stages as an ordered list of steps.
Expand Down Expand Up @@ -190,7 +193,7 @@ mise run currency # report every tool, package, and acti
```

`mise run screenshots` captures each specimen page light and dark, in vertical tiles at most
1200px tall; it captures the drawer's page in its viewport at each of its six states, and the
1200px tall; it captures the drawer's page in its viewport at each of its eight states, and the
settings and shortcuts pages again with their dialogs open. It runs the
`web-screenshots` bin of [web-tooling](https://github.com/standards-lab/web-tooling), the
devDependency the browser tier's driver and server also come from, over the capture description
Expand Down
52 changes: 32 additions & 20 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ the tests measure as they do.
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. Its mode is
the custom state `docked` or `drawer`, which a page may style.
`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
may style.
- `./shortcuts.js`: `sl-shortcuts`, the page's keyboard shortcuts for a help dialog, as a plain-text
table of Keys and Action: exactly what the foundation's `bindings(dialog)` gives for the dialog
that holds it, `bindings(null)` outside one, in its order, each key in a `kbd` as the keys
Expand All @@ -68,10 +71,11 @@ the tests measure as they do.

## Rendering

- `./markdown.js`: `markdown(source)`, a Markdown string as a Lit template of plain elements, by
marked's lexer: raw HTML shows as text, an image as its alt text, and a link is an anchor only
to an http, https, or mailto URL or a relative one. It is the one module that imports marked,
which an import map then maps too.
- `./markdown.js`: `markdown(source, { breaks })`, a Markdown string as a Lit template of plain
elements, by marked's lexer: raw HTML shows as text, an image as its alt text, and a link is an
anchor only to an http, https, or mailto URL or a relative one, which `linkable(url)` tells; with
`breaks`, a paragraph's single line break is kept as a `br`. It is the one module that imports
marked, which an import map then maps too.

## Inspection

Expand Down Expand Up @@ -137,15 +141,22 @@ the tests measure as they do.
## Conversation

- `./chat-thread.js`: `sl-chat-thread`, a conversation's items in order, a structural subset of
Open Responses: a user's text as plain text, the assistant's as rendered Markdown, a refusal
labelled, and a streaming reply re-rendered in place; with `verbose`, reasoning, function calls,
and their outputs too, each collapsed in a native details, a reasoning item's summary on its
line and its content inside, and a call's arguments and its output that are valid JSON
formatted from their own tokens by the foundation's `format.js`. A thread its consumer holds
to a height scrolls inside, opening at its end and following the newest item only from its end
or on a user's message; unheld, it is as tall as its content and follows nothing, so a consumer
that wants it followed holds it. It exports its item types and sends no event. It imports
`./markdown.js`, so its page maps marked too.
Open Responses: a user's text as rendered Markdown with its line breaks kept, the assistant's as
rendered Markdown, a refusal labelled, and a streaming reply re-rendered in place; with
`verbose`, reasoning, function calls, and their outputs too, each collapsed in a native details,
a reasoning item's summary on its line and its content inside, and a call's arguments and its
output that are valid JSON formatted from their own tokens by the foundation's `format.js`. A
`subagent_result` item, which the thread adds to Open Responses, `{type, id?, name, status,
href?, label?, content?, error?}`, shows in either mode as a collapsed line, "Sub-agent", its
name, and its status as given, holding its link, `label` or else `href`, and none for a blank
`href`, then its error or its Markdown content; one whose name or status isn't non-empty text,
or whose other fields aren't text where given, is skipped. Children slotted as `after`, such as
a form the conversation waits on, sit in the frame after the items and scroll with them. A
thread its consumer holds to a height scrolls inside,
opening at its end and following the newest item, its last item's growth, and the slotted
children's, only from its end or on a user's message; unheld, it is as tall as its content and
follows nothing, so a consumer that wants it followed holds it. It exports its item types and
sends no event. It imports `./markdown.js`, so its page maps marked too.
- `./composer.js`: `sl-composer`, a multi-line text field that grows to eight lines, and its
send control, which a stop control replaces while `busy`; it dispatches `send` with the text,
then clears the field, and `stop`. Its `send()` does what activating send does, so an app that
Expand Down Expand Up @@ -183,8 +194,9 @@ screenshot script focuses the focus section's `[data-focus-start]` mark, which t
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 at 1280px, and closed, open, and open right to left at 480px. 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'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.
18 changes: 16 additions & 2 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,29 @@ each sheet is laid out as it is.

- An update follows the newest item when the frame was at its end before it, showed no items yet,
or the update adds a user's message, the newest or the one before the reply's first text when the
consumer adds both at once.
consumer adds both at once. The frame is at its end when it is at the end of either the scroll
height now or the one last seen. Measured against the height now alone, content that grew since
the last update and that the observer hasn't followed yet, such as the slotted children or an
image, would make a delta arriving before the observer's callback read the reader as scrolled
up, and the thread would stop following.
- The last item growing with no update, a details opened in it or an image that loads, is watched by
a `ResizeObserver` on the frame's content rather than the details' `toggle` event: it sees every
cause and leaves the details toggling natively. Its callback runs after layout, so the reader's
place is measured against the scroll height last seen; a scroll listener could read the grown
height. Every resize records the heights it leaves, so a growth above the end, which leaves the
reader short of the new end, measures the next growth of the last item against the end as it now
is. The scroll leaves the content's size alone, so it never loops the observer.
- The `after` slot sits in a box of its own after the list, which the same observer watches, and
the growth it follows is the last item's and that box's together. The thread hides the box while
no element is assigned to the slot, setting `hidden` on `slotchange` rather than in its render,
so an empty box's padding takes no room and the first child slotted reaches the observer as a
growth it follows.
- Connected again, the frame is measured and observed anew, so the observer's first callback finds
the content as the reader does and scrolls nothing on its own. Detached, the frame has no layout
to follow or measure.
- A sub-agent result is checked before it renders, and one that fails the check
([Components](components.md#conversation)) is skipped as an unknown item is. Its status is text
to show, not an `ItemStatus`, so an app passes its own states through.
- A reasoning item's summary parts join into one run; a part with no text yet, as one just begun
streaming, is no summary. The standalone line puts no whitespace before its kind, which would
widen it past the summaries' marker.
Expand Down Expand Up @@ -119,7 +131,9 @@ each sheet is laid out as it is.
## Markdown

- Each call lexes on a fresh copy of marked's defaults, so no `marked.use()` or `setOptions()`
elsewhere on the page reaches this renderer.
elsewhere on the page reaches this renderer. `breaks` is off unless the caller asks: the chat
thread asks for a user's text, typed with its line breaks meant, and not for an answer, whose
Markdown wraps its paragraphs' lines as it pleases.
- The lexer leaves named character references in text, link destinations, and titles for its own
renderer's HTML to resolve, and text inside a raw block as written. They are resolved by the HTML
parser in a `textarea`'s RCDATA, where no markup is parsed, of a document with no browsing
Expand Down
21 changes: 19 additions & 2 deletions docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ layout each one promises.
## Chat thread

- A user's message sits at the inline end, short of the full width, on the first elevated surface;
the assistant's spans the list. Neither has a border: the thread's frame is the one.
the assistant's spans the list. Neither has a border: the thread's frame is the one. A user's
Markdown renders in the bubble as an answer's does, and a message of one paragraph renders as
its plain text did, so the bubble keeps its layout.
- A reasoning item with nothing to expand is a paragraph whose gutter is an inline list item with
the summaries' own disclosure marker, undrawn, so its kind lines up with theirs. The gutter is
hidden from the accessibility tree, so no marker is read for a disclosure that isn't one.
Expand All @@ -107,13 +109,28 @@ layout each one promises.
- A function's name and a call's id, a `call_` id of 37 characters as a rule, move to the next line
whole and break anywhere only when longer than the line, so a narrow thread shows them whole
inside its frame. Inline code in a reply keeps whole the same way rather than break at a hyphen.
- A reply's word longer than its line breaks anywhere, except in a table: the table's cells keep
their words whole, and a table wider than the thread scrolls sideways in its own box, as a code
block does, so the thread never widens.
- A refusal's rule is in the warning hue, so it reads apart from the answer and from a quotation's
neutral rule.
neutral rule; a sub-agent result's error takes the same rule in the failure hue.
- A sub-agent result's line is a summary like a verbose item's, its status an inline block after a
middle dot, so the status never breaks inside itself and its name, like a function's, breaks only
when longer than the line. Its content keeps the reply's color, not a verbose item's quieter one:
it is the sub-agent's answer. Its link, error, and content stand a paragraph's space apart, as
the elements sheet sets paragraphs.
- The `after` slot's box takes the list's inline padding and its block-end padding, the list's own
block-end padding standing as the gap between the last item and the slotted children, the same
as between items; it is hidden while nothing is slotted, so an empty slot adds nothing to the
frame.
- A streaming status's dot pulses unless motion is reduced.

## Drawer

- `--drawer-from` is the edge the drawer hides past, by the writing direction.
- A `frameless` docked aside drops its border, its radius, and the header's and body's padding, so
the children sit flush in the host's box; its header is visually hidden, a one-pixel clipped box
that takes no row, and its heading still names the aside.
- The label takes the step the foundation gives an `h4`, `--text-l`: the heading of a contained
surface, one above the body text and the entries' names it heads and two below a page's section
`h2`, so it never competes with the page's `h1` or `h2`.
Expand Down
Loading