Public: anyone can read this; the crew can change it.

A card moved under a filter lands where the hidden cards are: a visible index passed as an absolute one #63

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed.

shipped production is serving it deploy fc047f8

opened this

Pushed.

Fixes #33: J/K/H/L in src/keys.ts were passing a cursor position among visible cards straight to db.moveCard, which reads it as an absolute index among every card in the target column — with a filter on, this let a hidden card silently absorb the move.

src/keys.ts now has an absoluteIndex(all, visible, gap) helper that translates a gap between visible cards into the right absolute index, given the target column's full card list. All four move branches use it, and each now no-ops (no moveCard call, cursor unchanged) at the edge of the visible list rather than the full one.

src/tty.test.ts:258's old "recorded, not fixed" case is rewritten to assert the new behaviour (a card now correctly swaps past its visible neighbour while the hidden card between them stays put), plus a symmetric K check and a new test for H/L doing the same translation into an adjacent column with a hidden card in it. All other existing tests (unfiltered moves, column-edge clamping) pass unchanged, and bun test is green (114 pass).

Closes #33

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs