Skip to content

feat(web): group completed journal tasks in a collapsed Completed section - #562

Merged
nevridge merged 1 commit into
mainfrom
feature/journal-collapse-completed
Nov 20, 2026
Merged

nevridge merged 1 commit into
mainfrom
feature/journal-collapse-completed

Conversation

@nevridge

Copy link
Copy Markdown
Owner

Summary

  • On today and future days, completed journal tasks (subtasks included) move into a "Completed · N" group below the open work. It is collapsed by default, so the page shows what is left to do.
  • A subtask group is split by row. The completed subtasks sit under a second copy of the parent's header, linked to the parent, and both headers show the whole group's progress ("1/2 subtasks complete").
  • Past days are history, so they show every row with no toggle.
  • The existing sort modes still order the open rows. The Completed group always sits at the bottom, so in manual sort a completed task now leaves its position.
  • The done/total counter in the card header still counts hidden rows.

Details

  • New useCompletedCollapsed hook stores the choice in localStorage (taskflow_journal_completed_collapsed_v1), written only from the toggle, never on mount.
  • Context header description ids are now scoped (todo-ctx-open-N, todo-ctx-done-N) so they stay unique when a parent's header appears in both sections.
  • If a completed row leaves the list while a keyboard action is pending, focus falls back to the Completed toggle.
  • Web only. No API, contract or generated client changes.

Tests

  • New TodosSection.completed-group.test.tsx (12 tests): default collapsed, counts, expand and persist, no write before toggle, past day, subtask split, header in both places, unique ids, fully done group.
  • Existing TodosSection.* files that assume completed rows are visible now start with the group expanded. Three assertions changed meaning: manual order with completed rows last, the completion-day sort, and the subtask header (now rendered twice).
  • npm run type-check, npm run lint and the full vitest suite (2,310 tests) pass.
  • Checked by hand in the isolated test stack with seeded tasks.

…tion

On today and future days, Completed rows (subtasks included) move into a
"Completed · N" group under the open work, collapsed by default. A subtask
group is split by row and both halves keep the parent's header, whose
progress covers the whole group. Past days show everything.

The collapsed state is stored in localStorage and written only on toggle.
Header description ids are scoped per section so they stay unique. When a
completed row leaves the list, focus falls back to the group toggle.
@nevridge
nevridge merged commit b9e5722 into main Nov 20, 2026
19 checks passed
@nevridge
nevridge deleted the feature/journal-collapse-completed branch November 20, 2026 17:29
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