Skip to content

feat(sidebar): mark the row a create just made - #30

Merged
mindaugaskasp merged 1 commit into
mainfrom
improvement/new-row-highlight
Aug 6, 2026
Merged

feat(sidebar): mark the row a create just made#30
mindaugaskasp merged 1 commit into
mainfrom
improvement/new-row-highlight

Conversation

@mindaugaskasp

Copy link
Copy Markdown
Owner

A new snippet or saved diff landed below every starred row, in a panel that is usually scrolled past its insertion point, and nothing marked it.

Spec: specs/2026-08-07-new-row-highlight/plan.md — from interaction proposal artifact 89f60c6d.

What it does

Four channels on one create event, because the sweep across all 14 themes shows no single one survives every palette:

channel what it contributes
insertion the row animates in — layout motion cannot fail a contrast check
wash transient accent tint, peaks at 26% (the sepia minimum), decays to nothing
rail 3px --accent down the row's RIGHT edge, wipes in and stays
badge a NEW keyline chip — says it in words, so hue cannot fail it

Plus the behavioural half: expand a collapsed section, scrollIntoView({ block: 'nearest' }), say so when a filter hides the row, and retire the mark on the row's primary action, the next create, or 60s.

The rail goes right because the left carries the pin bar — and starring a row you just made is the ordinary response to finding it, so the two states genuinely co-occur and must stack.

Why not the wash already in the repo

.key.added (TrustedKeyRow.css) works in a dialog whose rows have no hover background. A sidebar row has --bg-hover, so a resting tint competes with hover, not the panel. The tint needed to clear a theme's own hover step ranges 12% (dim) to 26% (sepia), and on light no tint ≤60% clears it at all.

Evidence — all 14 themes

Every number was re-derived from themes.css before the code was written, then confirmed against the live DOM by make theme-sweep. The two agreed exactly.

  • accent edge on panel: min solar 3.21, max matrix 13.92 — clears the 3.0 non-text floor everywhere
  • accent as a label: fails 4.5 on solar, meridian, sepia, bloom, light — so the label is --text (min sepia 8.55)
  • --accent vs --favorite: 0.044 ΔE on dim and matrix — which is why words, not hue, carry the identification

Notable

  • One key on uiStore, not one per store. "The row you just made" is a single row, so saving a diff then adding a snippet must leave one mark, not two in different sections.
  • marks opt-out. add() is also the seam for seeding, bulk import and backup restore. Caught by reading the sweep's own PNGs, where the first-run seeded example wore a NEW badge.
  • Two utils/ extractions. The size ratchets refused the growth at the right seam, so the pure logic came out instead of a number going up: utils/snippetState.js and utils/vaultEntries.js. snippetStore 575 → 496, vaultStore 408 → 366, both baselines retightened. Stores re-export their public names, so no caller changed.
  • theme-sweep probes can now name the channel they gate. The accent keyline was collected and never enforced, which would have left the design's central claim unguarded.

Verification

  • npm run check — green. 2650 passed | 2 skipped; coverage 95.1 st / 88.03 br / 95.7 fn / 96.1 li
  • make e2e (Docker, full suite) — 395 passed, 2 skipped (the macOS-gated specs)
  • make theme-sweep (Docker, all 14) — 504 measurements, none under floor
  • e2e/new-row-marker.spec.mjs watched red → green; it asserts the rail's box and computed colour, the badge's keyline vs label, and that a starred new row keeps both marks

🤖 Generated with Claude Code

A new snippet or saved diff landed below every starred row, in a panel
that is usually scrolled past its insertion point, and nothing marked it.

Four channels on one event, because the sweep across all 14 themes shows
no single one survives every palette: the row animates in, an accent wash
peaks at 26% (the sepia minimum) and decays to nothing, a 3px --accent
rail wipes down the row's RIGHT edge and stays, and a NEW keyline chip
says it in words. The right edge is deliberate — the left carries the pin
bar, and starring a row you just made is the ordinary response to finding
it, so the two states stack.

Plus the half that is behaviour: expand a collapsed section, scroll the
row into view, say so when a filter hides it, and retire the mark on the
row's primary action, the next create, or 60s.

Why not the .key.added wash already in the repo: a sidebar row has a
--bg-hover, so a resting tint competes with hover rather than the panel.
The tint that clears a theme's own hover step ranges 12% (dim) to 26%
(sepia), and on light no tint under 60% clears it at all.

The marker is ONE key on uiStore, not one per store: "the row you just
made" is a single row, so saving a diff and then adding a snippet must
leave one mark, not two in different sections. It carries a `marks`
opt-out, because add() is also the seam for seeding, bulk import and
backup restore — none of which the user made.

To fit at that seam without raising a size ratchet, the pure logic came
out of both stores: utils/snippetState.js (tag palette and arithmetic,
legacy-shape migration) and utils/vaultEntries.js (entry coercion,
diffFormatTag). Both stores re-export their public names, so no caller
changed; snippetStore 575 -> 496, vaultStore 408 -> 366, both baselines
retightened.

theme-sweep gains a new-row surface, and probes may now name the channel
they gate — the accent keyline was collected and never enforced, which
would have left the design's central claim unguarded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mindaugaskasp mindaugaskasp reopened this Aug 6, 2026
@mindaugaskasp
mindaugaskasp merged commit 7b29b81 into main Aug 6, 2026
11 of 12 checks passed
@mindaugaskasp
mindaugaskasp deleted the improvement/new-row-highlight branch August 6, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant