- Shipped
- August 13, 2026 at 3:04 AM UTC
- Author
- kamo
- Commit
- 58bd5be
Delete did nothing. The handler was hung off the pill's focus, and the pill never had focus: preventDefault() in the pointerdown handler — which is there to stop the browser starting a text or image drag — also suppresses the focus a click would otherwise give, so the pill was never the active element and its onKeyDown never ran. Focus is now set explicitly on pointerdown, and the shortcut hangs off the SELECTION rather than the focus ring. Selection is a single id, not a set. It has exactly one job — naming what Delete acts on — and a multi-selection would have to answer what deleting four spans across three days means before anything could be built on it. Clicking, tabbing to, or right-clicking a pill selects it and deselects whatever was selected before; clicking bare track or pressing Escape clears it. The selected pill takes a dark-and-white ring that deliberately outranks the amber unsaved ring, because the pill Delete is about to remove must not look like every other edited one. Delete has one owner, on the window, because focus and selection come apart exactly where it matters: a merge removes the focused pill outright, and a selection can be lit with nothing focused at all. It is guarded — it stands down while the caret is in a text field, since the mandatory save comment is a textarea and eating Backspace there would be unforgivable, and while any MUI modal is mounted, which covers the save, discard and add dialogs and this component's own context menu. Right-clicking a pill now offers "Remove this block" above the add options. That something you are already pointing at is not a reasonable ask. Two bugs found while wiring it. Right-clicking a pill armed the whole drag gesture, because pointerdown fires for the right button too — the pill jumped to clear-selection handler are now primary-button only. And a selection that outlived its own pill left Delete aimed at nothing, so it is cleared whenever the span it names stops existing — which is every merge. aria-selected is deliberately absent: it is not supported on role="slider", and selection follows focus here anyway, so the focus ring already carries the fact.