Skip to content

Support item state, e.g., running, sleeping, blocked #4

@tomzx

Description

@tomzx

Background

Currently, every active task in the stack is implicitly treated the same: position 0 is "current/running" and everything else is "waiting". In real workflows, tasks below the top of the stack often have meaningful states that affect how the user wants to see and reason about them, for example:

  • running: actively being worked on (today, this is implied by being at position 0)
  • sleeping / snoozed: deliberately paused, not waiting on anything external, to be resumed later
  • blocked: waiting on an external dependency (another person, a build, a review, an answer, etc.)

Without explicit state, the user cannot distinguish "I parked this" from "someone else is blocking this" from "this is just next up", and time accounting (duration / last_current) cannot reflect that a task is intentionally not progressing.

This issue proposes adding a first-class state field to Task (python/src/task_stack/stack.py) along with the UI affordances to set, display, and filter by it.

Version

main @ fe6d096

Acceptance Criteria

  • Task gains an explicit state field with at least the values: running, sleeping, blocked (and a sensible default for existing/new tasks).
  • State is persisted in ~/.task-stack.yaml via Task.to_dict / Task.from_dict, and old YAML files without the field continue to load without error (backward-compatible migration).
  • Promoting a task to position 0 sets/keeps it in running; demoting it from position 0 transitions it to a non-running state in a well-defined way (documented in code).
  • The active stack window shows each task's state (e.g., icon, color, or label) so non-running states are visually distinct.
  • The user can change a task's state from the UI (e.g., context menu or keyboard shortcut), including blocked and sleeping.
  • blocked and sleeping tasks do not accumulate active duration while they are not at position 0, and the existing live_duration / end_current_stint semantics are preserved for running.
  • README (python/README.md and/or top-level README.md) documents the available states and how to set them.
  • Existing tests pass and new tests cover: default state on push, state persistence round-trip, state-aware promotion/demotion, and that non-running states do not accrue duration.

Created with create-issue (e6796d9)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions