Skip to content

Todo Panel — Status cycle + done section + archive #48

@harrryyd

Description

@harrryyd

Parent

#44

What to build

Click-to-cycle status icon on each item (todo → in-progress → done → todo). A "Done" section at the bottom of the sidebar shows the last 10 completed items. Archive spill to a separate file.

State machine: todoStore gains cycleStatus(itemId):

  • todoin-progress: sets status, stays in category
  • in-progressdone: sets status, moves to done collection, sets completedAt
  • donetodo: sets status, returns to original category

Archive cutoff: when the done list exceeds 10 items, the oldest (by position) moves to ~/.t3code/todos-archive.json. The todoPersistence module handles this on each write.

UI: Status icon displays the current state (circle=empty for todo, circle=half for in-progress, checkmark for done). Clicking cycles. Done items appear in a collapsed "Done" section at the bottom of the sidebar showing the last 10. Each done item shows its original category as a small badge/tag.

Tests: Status cycling edge cases, archive spill when 11th item completes, return-to-category on un-complete.

Acceptance criteria

  • Clicking status icon cycles: todo → in-progress → done → todo
  • todo and in-progress items remain in their category
  • done items move immediately to bottom "Done" section
  • Done section shows last 10 completed items
  • Done items display original category as a badge/tag
  • Cycling done → todo returns item to its original category at the bottom
  • Cycling done → in-progress returns item to its original category at the bottom
  • When 11th item hits done, oldest spills to ~/.t3code/todos-archive.json
  • Unit tests: cycleStatus transitions, archive cutoff at 11, return-to-category
  • bun fmt, bun lint, bun typecheck all pass

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions