Skip to content

tsk list orders rows within each status like the board (#123) - #190

Merged
smarzban merged 3 commits into
mainfrom
tsk/t213-tsk-list-order-matches-the
Oct 11, 2026
Merged

smarzban merged 3 commits into
mainfrom
tsk/t213-tsk-list-order-matches-the

Conversation

@smarzban

@smarzban smarzban commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Fixes #123.

What

tsk list sorted only by status group, so within a group rows came out in store (capture) order. It now uses the board's own section order (reused from src/ui/queue.rs via a new cmp_within_status, not a copy):

  • ready: oldest pick first
  • open: oldest capture first
  • started, blocked, review, done: most recent status change first

Group order (STARTED, READY, OPEN, BLOCKED, REVIEW) is unchanged. --deleted keeps newest deletion first. JSON is the flat board order. With --all, human output still groups each status by scope: groups are ordered by their first row and rows inside a group keep the board order, so interleaved scopes print in a different order from JSON (documented in cli.md, llms.txt and the CHANGELOG). Four existing cli_list expectations were updated (newest started/done first).

Docs: cli.md list section, CHANGELOG Unreleased › Fixed.

Proof

  • list_ready_puts_the_oldest_pick_first_like_the_board: the issue's exact sequence (fails on main: [1, 2] vs [2, 1]).
  • list_orders_each_status_group_like_its_board_section: every group (fails on main).
  • list_all_groups_interleaved_scopes_by_first_row_and_keeps_board_order_inside: interleaved desk and project rows. It pins the flat JSON order and the grouped human output, and fails if the order inside a group breaks or the fix is reverted.
  • Green bar, cargo clippy --target x86_64-pc-windows-gnu --all-targets -D warnings, site npm test: all pass.

Before / after

Binaries: /tmp/tsk-t213-before (origin/main 39e3a8e, release) and /tmp/tsk-t213-after (this branch at 250afba, rebased on main 6ad77d0, release). Scenario /tmp/tsk-t213-scenario.sh runs against a fresh mktemp TSK_STATE_DIR: add T1–T4 on the desk, status T2 ready; status T1 ready; status T3 started; status T4 started.

== before
$ tsk list --ready --json   # expect T2 before T1 (oldest pick first)
['T1', 'T2']
$ tsk list
STARTED
 - 3 third
 - 4 fourth

READY
 - 1 first captured
 - 2 second captured
== after
$ tsk list --ready --json   # expect T2 before T1 (oldest pick first)
['T2', 'T1']
$ tsk list
STARTED
 - 4 fourth
 - 3 third

READY
 - 2 second captured
 - 1 first captured

How to test

sh /tmp/tsk-t213-scenario.sh /tmp/tsk-t213-before   # bug: T1 before T2, T3 before T4
sh /tmp/tsk-t213-scenario.sh /tmp/tsk-t213-after    # fix: T2 before T1, T4 before T3

Or by hand against a throwaway store:

export TSK_STATE_DIR=$(mktemp -d); cd $TSK_STATE_DIR
T=/tmp/tsk-t213-after
$T add --desk -t one; $T add --desk -t two
$T status T2 ready; $T status T1 ready
$T list --ready --json   # T2 first
$T list                  # READY: 2 then 1
$T                       # board ON DECK shows the same order

Look for: READY lists the earliest pick first, STARTED the latest start first, and both match the board's ON DECK / IN MOTION.

Live in Herdr (workspace w9E, tabs before and after)

Each tab has the scenario output on screen and an idle shell. It ran against its own store (/tmp/tsk-t213-state-before and /tmp/tsk-t213-state-after, never ~/.tsk).

  • To rerun: in either tab press ↑ then Enter. That repeats env TSK_STATE_DIR=/tmp/tsk-t213-state-<tab> sh /tmp/tsk-t213-demo.sh /tmp/tsk-t213-<tab>, which reseeds the store from scratch and prints the lists again.
  • before: ['T1', 'T2'], READY 1,2 and STARTED 3,4 (the bug). after: ['T2', 'T1'], READY 2,1 and STARTED 4,3.
  • To compare with the board, run env TSK_STATE_DIR=/tmp/tsk-t213-state-after /tmp/tsk-t213-after in the after tab and press 1 for the desk. ON DECK and IN MOTION show the same order as the list.

@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
herdr-tsk Ready Ready Preview Oct 11, 2026 6:35pm UTC

@smarzban
smarzban merged commit c78958b into main Oct 11, 2026
8 checks passed
@smarzban
smarzban deleted the tsk/t213-tsk-list-order-matches-the branch October 11, 2026 18:41

This branch was successfully deployed

1 active deployment
Preview — 21e10463 Deployed Oct 11, 2026 by vercel[bot]
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.

"On Deck" task ordering is not present

1 participant