Skip to content

✨ feat: Task Mode sidebar view — group worktrees by workflow status #14

@vaayne

Description

@vaayne

Summary

Add an alternative sidebar view mode — Task Mode — that groups all worktrees across projects by workflow status (Todo, In Progress, Needs Review, Done, Cancelled) instead of the current project-hierarchical grouping.

Inspired by craft-agents-oss session status workflow.

Data Model

Existing WorktreeStatus (keep as-is)

Runtime health: active | inactive | unavailable

New WorkflowStatus (new field on Worktree)

public enum WorkflowStatus: String, Codable, Sendable, CaseIterable {
    case todo         // Created, not started yet
    case inProgress   // Actively working on it
    case needsReview  // Work done, awaiting review (PR submitted, agent done)
    case done         // Merged / completed
    case cancelled    // Abandoned / closed
}

Why 5 states:

  • needsReview is a critical handoff point — you stop coding, someone else acts
  • cancelled distinguishes "intentionally dropped" from "finished" — important for cleanup
  • Maps 1:1 to PR lifecycle: draft → open → review → merged/closed

Status semantics — tracks "who needs to act next":

Scenario Status Why
PR open as draft, still coding inProgress You're the one acting
PR open, waiting for reviewer needsReview Someone else acts next
PR reviewed, changes requested, fixing inProgress Back to you
PR approved, waiting on CI/merge needsReview Still waiting
PR merged done Nothing left to do

A worktree can bounce between inProgressneedsReview multiple times during a review cycle.

Persistence

Add workflowStatus: WorkflowStatus to Worktree model. Persisted via existing JSON store. Backwards-compatible via decodeIfPresent defaulting to .todo.

Status Transitions

Manual (primary)

  • Right-click context menu → "Status" submenu
  • Command palette → "Set Worktree Status"
  • CLI: mori status <worktree> inProgress

Auto-transition (single rule)

Transition Signal Confidence
todoinProgress First git commit on branch, OR agent starts working, OR terminal has uncommitted changes (modifiedCount > 0 || stagedCount > 0) High — you clearly started

All other transitions are manual. No PR polling, no heuristics for ambiguous states.

Defaults

Action Default Status
Create new worktree todo
Remove/delete worktree (just gone)
Everything else User sets manually

Task Mode Sidebar View

View Toggle

Segmented control or icon toggle at sidebar top: Tree | Tasks

  • Tree mode (current): Project → Worktrees → Windows
  • Task mode (new): Status Group → Worktrees → Windows

Task Mode Layout

▼ In Progress (3)
   feature/auth  ·  mori
   fix/crash     ·  api
   main          ·  mori

▼ Needs Review (1)
   feature/i18n  ·  mori

▶ Todo (2)
   ...

▶ Done (5)
   ...
  • 4 visible groups: In Progress, Needs Review, Todo, Done (in this priority order)
  • Cancelled hidden by default (show via filter toggle)
  • Done collapsed by default
  • Each row shows: branch name + project shortName as subtle badge
  • Within each group, sorted by lastActiveAt descending
  • Clicking a worktree selects it and switches terminal (same behavior as tree mode)
  • Windows still nest under each worktree

Interaction

  • All existing context menu actions (Open in editor, Reveal in Finder, Remove) still work
  • Context menu gains "Status" submenu with all 5 options
  • Drag-and-drop between groups (stretch goal, not required for v1)

Scope

In scope

  • WorkflowStatus enum in MoriCore
  • Add workflowStatus field to Worktree model (backwards-compatible)
  • Task mode sidebar view (TaskSidebarView in MoriUI)
  • View mode toggle (Tree / Tasks)
  • Context menu "Set Status" on worktree rows (both view modes)
  • Command palette "Set Worktree Status" command
  • CLI mori status subcommand
  • Auto-transition: todoinProgress on first activity
  • Persist view mode preference in UIState
  • i18n for new strings

Out of scope (future)

  • PR state polling via gh
  • Auto-transition for other status changes
  • Drag-and-drop reordering
  • Custom user-defined statuses
  • Kanban board view (columns instead of list)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions