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 #33
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
src/tty.test.tsrecords this as today's behaviour because #22 forbade fixing it in that change. It is a bug, and without an issue behind it the characterization test reads as a contract in six months.db.moveCard(boardId, cardId, columnId, index)takes an index among every card in the target column, ordered by position. The terminal passesstate.cardCursor, which is an index into the filtered list —visibleCardsdrops what the filter hides. With no filter the two agree, which is why nothing has noticed.With a filter on they do not.
src/keys.ts:Jpassesstate.cardCursor + 1andKpassesstate.cardCursor - 1.HandLpassMath.min(state.cardCursor, visibleCards(target).length)— a visible count used as an absolute position in the target column.The test at
src/tty.test.ts:258is the smallest case: a column holdingx-one,hidden,x-twowith the filterx-, cursor onx-one,Jpressed. The card lands at absolute index 1, behindhidden, and the visible order does not change — the person pressed a key and the board did not move.The web page does not have this bug:
src/routes.tsposts the index the drag computed, over the full column, and its filter is a query that re-renders rather than a cursor.Done looks like
J/K/H/Lwhile a filter is on puts it where the person saw it go: after the card that was visibly above it, before the one that was visibly below.db.moveCard— visible index to absolute index, insrc/keys.ts— and not a change todb.moveCard, which the web page andsrc/mcp.tscall with an absolute index already.Jat the bottom andKat the top of the visible list still do nothing, andH/Lat the edges still do nothing.src/tty.test.ts:258is rewritten to assert the new behaviour, and the comment calling it today's-behaviour-recorded goes with it. Every other test in that file passes unchanged — that is what says the fix was narrow.Files I expect to change
src/keys.ts— the four move branches.src/tty.test.ts— the recorded case becomes the asserted one, plusKandH/Lunder a filter.Risks
H/L.src/tty.test.tsalready checks.