Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a42bf30
Password help text stays under the Show/Hide row (D1)
evangress Nov 10, 2026
7776a41
Columns of numbers line up on the right (D3)
evangress Nov 10, 2026
19261fd
Apply the saved theme when the script runs, not at DOMContentLoaded (D4)
evangress Nov 10, 2026
123cba6
Number columns: labels like "Q1" or "#1042" are not numbers (D3 follo…
evangress Nov 10, 2026
581a2d1
Ctrl+Enter or ⌘+Enter in a textarea sends its form (P1)
evangress Nov 10, 2026
a4a266b
Removable rows: command="--remove" (P1)
evangress Nov 10, 2026
cda0547
Filters: "No matches" instead of an empty table, and a count (P1)
evangress Nov 10, 2026
b2d9374
Number columns: rows added later line up too (review fix)
evangress Nov 11, 2026
a21f2ee
Number columns: "−$5.00", "-$5.00" and "($5.00)" are numbers (review …
evangress Nov 11, 2026
6203278
Filter count waits for a pause in typing (review fix)
evangress Nov 11, 2026
585f7a1
Dropdown lists stay on screen (P2)
evangress Nov 11, 2026
8ecde36
Keyboard shortcuts from aria-keyshortcuts (P2)
evangress Nov 11, 2026
04d53af
Image file inputs show a thumbnail (P2)
evangress Nov 11, 2026
34cbf7c
Filter boxes with a name keep the filter in the address (P2)
evangress Nov 11, 2026
df53e64
Filter matches are highlighted (P2)
evangress Nov 11, 2026
58c0dbd
Select all, mixed state, and Shift-click ranges for row checkboxes (P2)
evangress Nov 11, 2026
72bedce
Printing opens every details (P2)
evangress Nov 11, 2026
cd8b632
Tabs: find-in-page and #fragment links reach hidden panels (P2)
evangress Nov 11, 2026
e77dae8
Invalid fields are focused clear of a sticky top bar (P1 forms leftover)
evangress Nov 11, 2026
8d5f180
Sort order remembered under data-tag-remember (P3)
evangress Nov 11, 2026
c59f80a
Image viewer steps through a set (P3)
evangress Nov 11, 2026
ace88c4
Filter: a refused history.replaceState doesn't break the filter
evangress Nov 11, 2026
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
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ Behaviors for the patterns TagBrush.css gained (dropdowns from `<details>`, the
- `command="--copy"` copies a field's value or any element's text; `command="--share"` opens the share sheet for a section's link or an `<a>`, and copies the link where there is no share sheet.
- `data-tag-match="password"` keeps a confirm field invalid, with a message, until it matches.
- A list a filter box controls, written with `hidden`, is a list of search results: it shows only while something is typed, with just the matches. TagKit's MkDocs theme uses it for search by page title.
- Size: about 9 KB gzipped. The ceiling is now 15 KB: coverage matters more than bytes, as for TagBrush.css, and the size is reported in each release.
- Fix: help text in a `<small>` after a password field sat inline beside the next label once the Show/Hide row wrapped the field (TagKit's sign-up page). It now stays under the row, muted, and turns red with the field.
- Columns of numbers line up on the right. TagAction already knew which columns hold numbers for sorting; it now marks their header and cells `data-tag="num"`, and its own sheet sets `text-align: end` and tabular figures. TagBrush.css only aligned a cell holding a lone `<data>`, so a "Customers" column (42, 118) sat on the left beside a right-aligned "Revenue", and no header lined up with its numbers. Dates (`<time>`) and labels such as "Q1" or "#1042" are not numbers; amounts with a sign before the currency ("−$5.00") or in accounting parentheses ("($5.00)") are. Rows added later (a `--clone` row, an htmx swap) line up in the columns already marked, and a table that starts empty is checked when rows arrive. An `align` attribute or the page's own `text-align` wins.
- The saved light/dark choice is applied the moment the script runs instead of at `DOMContentLoaded`. A deferred script runs after the first paint on long pages, so a dark page flashed light first. The guide says to load the script in `<head>` without `defer` on a page with a theme switch; the demo does.
- Ctrl+Enter (⌘+Enter on a Mac) in a `<textarea>` sends its form with `requestSubmit()`, so validation and other submit handlers run. It does nothing while an input method is composing text (`isComposing`, or `keyCode` 229 for Safari), following the modern-web-guidance `ime-safe-enter-submit` guide.
- `command="--remove"` removes the element its `commandfor` names, so every row added with `--clone` can be taken out again (ids in copies are already renumbered). Focus moves to the previous row, or the Add button, or the next row. Write the button `hidden`, in the template and in rows written in the page; TagAction shows it.
- A filter box that matches nothing says so: a `role="status"` line after the table or list reads "No matches for “x”" instead of leaving an empty table, and otherwise tells screen readers how many rows show ("3 of 12 shown") while staying out of sight. The count is written after a 400 ms pause in typing, so it isn't announced on every keystroke.
- A dropdown list in a nav stays on screen: it is anchored to its button with CSS anchor positioning and flips up or to the other side near an edge, where `position-area` is supported (otherwise it keeps its place under the button).
- Keyboard shortcuts from `aria-keyshortcuts`: the key it names focuses a field (`"/"` for search) or clicks a button (`"Control+K Meta+K"`). Keys without Control, Alt, or Meta are ignored while you type in a field; hidden and disabled elements are skipped.
- `<input type="file" accept="image/*">` shows a thumbnail of each chosen picture in its file list (object URLs, revoked when the choice changes).
- A filter box with a `name` starts from `?name=…` in the address and keeps it up to date with `history.replaceState`, so a filtered table survives a reload and can be shared. Without a `name` the address is left alone.
- Filter matches are highlighted with the CSS Custom Highlight API (`::highlight(tagaction-match)`, the theme's highlight color with an underline), without changing the page's HTML; browsers without it show no highlight (modern-web-guidance `highlight-text-ranges`).
- Select all: a checkbox in a `<thead>` cell checks or clears the checkboxes in its column for every shown row (rows a filter hides are left alone), is indeterminate when only some are checked, and Shift-click on a row's box sets the range from the last one clicked. Rows added later count. A header cell holding a control no longer gets wrapped in a sort button.
- Printing opens every closed `<details>` (header-nav dropdowns excepted), name groups included, so a printed FAQ has its answers; they close again after printing.
- Tabs: hidden panels use `hidden="until-found"` where supported, so find-in-page reaches their text and `beforematch` selects their tab; a link to a panel or to anything in it selects its tab, on load and when the `#fragment` changes.
- The first invalid field is scrolled to the middle of the window when it's focused, so a sticky top bar (TagBrush.css's `<header data-layout="sticky">`) never covers it; WebKit's own focus scroll can stop a few pixels under one.
- Under `data-tag-remember`, a table with an `id` keeps its sort column and direction across visits, as `<details>` keep their open state.
- The image viewer steps through a set: pictures in the same `<figure>`, or else the same `<section>`, get Previous and Next buttons, a "2 of 5" count, and the arrow keys. A picture on its own is unchanged.
- Size: about 10 KB gzipped. The ceiling is now 15 KB: coverage matters more than bytes, as for TagBrush.css, and the size is reported in each release.

## 0.2.0 (2026-11-08)

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,26 @@ TagAction is the companion to [TagBrush.css](https://github.com/kovirlabs/tagbru
| HTML | Behavior | Hook |
| --- | --- | --- |
| `<dialog>` | A modal closes on a backdrop click. Opens from a button with no script. | native `commandfor` / `command`; `closedby` opts out |
| `<details>` | One open at a time; remembers open state; opens when a link points inside it; in the header nav, a dropdown that closes on Escape, a click outside, or a chosen link | native `name`; `data-tag-remember`; `#fragment` links; `<li><details>` in a header `<nav>` |
| `<table>`, lists | Click a header to sort; filter from a search box; a list written `hidden` is search results | `<thead>`; `aria-sort`; `<input aria-controls>` |
| `<details>` | One open at a time; remembers open state; opens when a link points inside it; all open for printing; in the header nav, a dropdown that closes on Escape, a click outside, or a chosen link | native `name`; `data-tag-remember` (also keeps a table's sort order); `#fragment` links; `<li><details>` in a header `<nav>` |
| `<table>`, lists | Click a header to sort; columns of numbers line up on the right; filter from a search box (matches highlighted, with "No matches" and a count for screen readers; a `name` keeps it in the address); a list written `hidden` is search results | `<thead>`; `aria-sort`; `<input aria-controls>` |
| `<form>` | Messages under the fields; busy submit button; unsaved-changes warning; a confirm field must match | native validation; `method="post"`; `data-tag-match` |
| `<textarea>` | Grows as you type; character counter | no `rows`; `maxlength` |
| `<input type="file">` | Lists chosen files; drag and drop | `multiple`; its `<label>` |
| `<textarea>` | Grows as you type; character counter; Ctrl+Enter or ⌘+Enter sends its form (with validation, never mid-IME) | no `rows`; `maxlength` |
| `<input type="file">` | Lists chosen files, with thumbnails of pictures; drag and drop | `multiple`; `accept="image/*"`; its `<label>` |
| `<input type="password">` | Show/Hide button | automatic |
| `<pre>` | Copy button | automatic |
| `<time>` | Reader's timezone; "3 hours ago" | `datetime` with a zone; `data-tag-time="relative"` |
| `<nav>`, `<a>` | `aria-current="page"`; follows the scroll in a table of contents | automatic |
| `<h2>`, `<h3>` | "#" links; generated table of contents | `id`; `<nav data-tag-toc hidden>` |
| `<img>` | Click to enlarge | a link to an image file; a shrunk image in `<figure>` |
| `<img>` | Click to enlarge; step through the pictures of a figure or section | a link to an image file; a shrunk image in `<figure>` |
| `<menu>`, dropdowns | Arrow keys, Escape, click outside; a popover of links closes when one is followed | `<button aria-expanded aria-controls>`; popover menus |
| Tabs | Shows the selected panel; arrow keys, Home, End | `role="tablist"`, `role="tab"` with `aria-controls` |
| Theme | Light/dark switch, remembered | `<select data-tag-theme>` or `<button data-tag-theme>` |
| Tabs | Shows the selected panel; arrow keys, Home, End; find-in-page and `#panel` links select a tab | `role="tablist"`, `role="tab"` with `aria-controls` |
| Selectable rows | A header checkbox selects all shown rows, goes mixed, Shift-click selects a range | `<th><input type="checkbox">` |
| Shortcuts | A key focuses a field or clicks a button (not while typing, unless it has a modifier) | `aria-keyshortcuts="/"`, `"Control+K Meta+K"` |
| Theme | Light/dark switch, remembered (load the script without `defer` so the saved scheme applies before the first paint) | `<select data-tag-theme>` or `<button data-tag-theme>` |
| Copy, share | Copy any field or element; share a link or section | `<button commandfor command="--copy">`, `command="--share"` |
| `<output>` | Live value, total, or product; currency and percent formatting | native `for`; `data-tag-calc="product"`, `data-tag-format="USD"` |
| `<abbr>` | Title shown on tap | `title` |
| `<template>` | Add repeated rows | `<button commandfor command="--clone">` |
| `<template>` | Add repeated rows, and remove any of them | `<button commandfor command="--clone">`, `command="--remove"` |

[`llms.txt`](llms.txt) has the exact HTML for each one. It is the short, complete guide, written for people and for AI agents.

Expand Down
Loading
Loading