ππΌββοΈ The blackboard for coding agents - agentic development environment for claude code, codex, cursor, opencode, grok and more.
Rust adeai-agentsclaudeclaude-codecodexcursorgeminigrokopencodespec-driven-developmentvibe-codingvim
add tests and fix cursor in task edit dialog
fynnfluegge15c738d2bf1a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 0000000..39670ae--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,56 @@+name: CI++on:+ push:+ branches: [main]+ pull_request:+ branches: [main]++env:+ CARGO_TERM_COLOR: always++jobs:+ build:+ name: Build and Test+ runs-on: ${{ matrix.os }}+ strategy:+ matrix:+ os: [ubuntu-latest, macos-latest]+ rust: [stable]++ steps:+ - uses: actions/checkout@v4++ - name: Install Rust+ uses: dtolnay/rust-toolchain@stable+ with:+ toolchain: ${{ matrix.rust }}+ components: clippy, rustfmt++ - name: Cache cargo+ uses: actions/cache@v4+ with:+ path: |+ ~/.cargo/bin/+ ~/.cargo/registry/index/+ ~/.cargo/registry/cache/+ ~/.cargo/git/db/+ target/+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}+ restore-keys: |+ ${{ runner.os }}-cargo-++ - name: Check formatting+ run: cargo fmt --all -- --check++ - name: Clippy+ run: cargo clippy --all-targets --all-features -- -D warnings++ - name: Build+ run: cargo build --verbose++ - name: Run tests+ run: cargo test --verbose++ - name: Run tests with mocks+ run: cargo test --verbose --features test-mocksdiff --git a/Cargo.lock b/Cargo.lockindex eca9a00..9a81f8a 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -10,6 +10,7 @@ dependencies = ["chrono","crossterm","directories",+ "mockall","ratatui","rusqlite","serde",@@ -46,6 +47,12 @@ dependencies = ["libc",]+[[package]]+name = "anstyle"+version = "1.0.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"+[[package]]name = "anyhow"version = "1.0.101"@@ -368,6 +375,12 @@ dependencies = ["litrs",]+[[package]]+name = "downcast"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1"+[[package]]name = "either"version = "1.15.0"@@ -480,6 +493,12 @@ version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"+[[package]]+name = "fragile"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619"+[[package]]name = "generic-array"version = "0.14.7"@@ -785,6 +804,32 @@ dependencies = ["windows-sys 0.61.2",]+[[package]]+name = "mockall"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2"+dependencies = [+ "cfg-if",+ "downcast",+ "fragile",+ "mockall_derive",+ "predicates",+ "predicates-tree",+]++[[package]]+name = "mockall_derive"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898"+dependencies = [+ "cfg-if",+ "proc-macro2",+ "quote",+ "syn 2.0.114",+]+[[package]]name = "nix"version = "0.29.0"@@ -1006,6 +1051,32 @@ version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"+[[package]]+name = "predicates"+version = "3.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe"+dependencies = [+ "anstyle",+ "predicates-core",+]++[[package]]+name = "predicates-core"+version = "1.0.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144"++[[package]]+name = "predicates-tree"+version = "1.0.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2"+dependencies = [+ "predicates-core",+ "termtree",+]+[[package]]name = "proc-macro2"version = "1.0.106"@@ -1450,6 +1521,12 @@ dependencies = ["libc",]+[[package]]+name = "termtree"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"+[[package]]name = "termwiz"version = "0.23.3"diff --git a/Cargo.toml b/Cargo.tomlindex 5e71e33..9f42e11 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -35,5 +35,13 @@ uuid = { version = "1.16", features = ["v4"] }+[features]+test-mocks = ["mockall"]+[dev-dependencies]tempfile = "3"+mockall = "0.13"++[dependencies.mockall]+version = "0.13"+optional = truediff --git a/README.md b/README.mdindex a5d8e9a..8356535 100644--- a/README.md+++ b/README.md@@ -18,14 +18,12 @@ A terminal-native kanban board for managing coding agent sessions with isolated### Quick Install (recommended)```bash-curl -fsSL https://raw.githubusercontent.com/USER/agtx/main/install.sh | bash+curl -fsSL https://raw.githubusercontent.com/fynnfluegge/agtx/main/install.sh | bash```### From Source```bash-git clone https://github.com/USER/agtx.git-cd agtxcargo build --releasecp target/release/agtx ~/.local/bin/```@@ -33,7 +31,6 @@ cp target/release/agtx ~/.local/bin/### Requirements- **tmux** - Agent sessions run in a dedicated tmux server-- **git** - For worktree management- **gh** - GitHub CLI for PR operations- **claude** - Claude Code CLI (optional, for Claude integration)@@ -48,6 +45,8 @@ agtxagtx -g```+> [!NOTE] Add `.agtx/` to your project's `.gitignore` to avoid committing worktrees and local task data.+## Usage### Keyboard Shortcuts@@ -117,13 +116,24 @@ color_description = "#E8909C"ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββΌ βΌ- βββββββββββββββββββββββββββββ- β tmux server "agtx" β- β βββββββββ βββββββββ β- β βClaude β βClaude β β- β βTask2 β βTask3 β β- β βββββββββ βββββββββ β- βββββββββββββββββββββββββββββ+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+β tmux server "agtx" β+β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β+β β Session: "my-project" β β+β β ββββββββββ ββββββββββ ββββββββββ β β+β β βWindow: β βWindow: β βWindow: β β β+β β βtask2 β βtask3 β βtask4 β β β+β β β(Claude)β β(Claude)β β(Claude)β β β+β β ββββββββββ ββββββββββ ββββββββββ β β+β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β+β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β+β β Session: "other-project" β β+β β βββββββββββββββββββββ β β+β β β Window: β β β+β β β some_other_task β β β+β β βββββββββββββββββββββ β β+β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββΌ βΌβββββββββββββββββββββββββββββ@@ -133,13 +143,28 @@ color_description = "#E8909C"βββββββββββββββββββββββββββββ```+### Tmux Structure++- **Server**: All sessions run on a dedicated tmux server named `agtx`+- **Sessions**: Each project gets its own tmux session (named after the project)+- **Windows**: Each task gets its own window within the project's session++```bash+# List all sessions+tmux -L agtx list-sessions++# List all windows across sessions+tmux -L agtx list-windows -a++# Attach to the agtx server+tmux -L agtx attach+```+### Data Storage-- **Database**: `~/Library/Application Support/agtx/` (macOS) or `~/.config/agtx/` (Linux)+- **Database**: `~/.config/agtx/` (stores task metadata per project)- **Worktrees**: `.agtx/worktrees/` in each project-- **Tmux sessions**: Dedicated server `agtx` (view with `tmux -L agtx ls`)--> **Important**: Add `.agtx/` to your project's `.gitignore` to avoid committing worktrees and local task data.+- **Tmux**: Dedicated server `agtx` with per-project sessions## Development@@ -155,7 +180,3 @@ cargo test# Build releasecargo build --release```--## License--MITdiff --git a/src/config/mod.rs b/src/config/mod.rsindex ce9232b..bb6b732 100644--- a/src/config/mod.rs+++ b/src/config/mod.rs@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};use std::path::{Path, PathBuf};/// Global configuration (stored in ~/.config/agtx/)-#[derive(Debug, Clone, Serialize, Deserialize, Default)]+#[derive(Debug, Clone, Serialize, Deserialize)]pub struct GlobalConfig {/// Default agent for new tasks#[serde(default = "default_agent")]@@ -18,6 +18,16 @@ pub struct GlobalConfig {pub theme: ThemeConfig,}+impl Default for GlobalConfig {+ fn default() -> Self {+ Self {+ default_agent: default_agent(),+ worktree: WorktreeConfig::default(),+ theme: ThemeConfig::default(),+ }+ }+}+/// Theme configuration with hex colors#[derive(Debug, Clone, Serialize, Deserialize)]pub struct ThemeConfig {diff --git a/src/lib.rs b/src/lib.rsnew file mode 100644index 0000000..c24860b--- /dev/null+++ b/src/lib.rs@@ -0,0 +1,15 @@+pub mod agent;+pub mod config;+pub mod db;+pub mod git;+pub mod operations;+pub mod tmux;+pub mod tui;++use std::path::PathBuf;++#[derive(Debug, Clone)]+pub enum AppMode {+ Dashboard,+ Project(PathBuf),+}diff --git a/src/main.rs b/src/main.rsindex 0dd8b37..f7baedb 100644--- a/src/main.rs+++ b/src/main.rs@@ -1,10 +1,4 @@-mod agent;-mod config;-mod db;-mod git;-mod tmux;-mod tui;-+use agtx::{git, tui, AppMode};use anyhow::Result;use std::path::PathBuf;@@ -34,9 +28,3 @@ async fn main() -> Result<()> {Ok(())}--#[derive(Debug, Clone)]-pub enum AppMode {- Dashboard,- Project(PathBuf),-}diff --git a/src/operations.rs b/src/operations.rsnew file mode 100644index 0000000..74da1d4--- /dev/null+++ b/src/operations.rs@@ -0,0 +1,111 @@+//! Traits for external operations (tmux, git) to enable testing with mocks.++use anyhow::Result;+use std::path::Path;++#[cfg(any(test, feature = "test-mocks"))]+use mockall::automock;++/// Operations for tmux window management+#[cfg_attr(any(test, feature = "test-mocks"), automock)]+pub trait TmuxOperations {+ /// Create a new tmux window in a session+ fn create_window(&self, session: &str, window_name: &str, working_dir: &str) -> Result<()>;++ /// Kill a tmux window+ fn kill_window(&self, target: &str) -> Result<()>;++ /// Check if a window exists+ fn window_exists(&self, target: &str) -> Result<bool>;++ /// Send keys to a window+ fn send_keys(&self, target: &str, keys: &str) -> Result<()>;++ /// Capture pane content+ fn capture_pane(&self, target: &str) -> Result<String>;+}++/// Operations for git worktree management+#[cfg_attr(any(test, feature = "test-mocks"), automock)]+pub trait GitOperations {+ /// Create a worktree for a task+ fn create_worktree(&self, project_path: &Path, task_slug: &str) -> Result<String>;++ /// Remove a worktree+ fn remove_worktree(&self, project_path: &Path, worktree_path: &str) -> Result<()>;++ /// Check if worktree exists+ fn worktree_exists(&self, project_path: &Path, task_slug: &str) -> bool;+}++/// Real implementation using actual tmux commands+pub struct RealTmuxOps;++impl TmuxOperations for RealTmuxOps {+ fn create_window(&self, session: &str, window_name: &str, working_dir: &str) -> Result<()> {+ let output = std::process::Command::new("tmux")+ .args(["-L", crate::tmux::AGENT_SERVER])+ .args(["new-window", "-d", "-t", session, "-n", window_name])+ .args(["-c", working_dir])+ .output()?;++ if !output.status.success() {+ anyhow::bail!("Failed to create tmux window");+ }+ Ok(())+ }++ fn kill_window(&self, target: &str) -> Result<()> {+ std::process::Command::new("tmux")+ .args(["-L", crate::tmux::AGENT_SERVER])+ .args(["kill-window", "-t", target])+ .output()?;+ Ok(())+ }++ fn window_exists(&self, target: &str) -> Result<bool> {+ let output = std::process::Command::new("tmux")+ .args(["-L", crate::tmux::AGENT_SERVER])+ .args(["list-windows", "-t", target])+ .output()?;+ Ok(output.status.success())+ }++ fn send_keys(&self, target: &str, keys: &str) -> Result<()> {+ std::process::Command::new("tmux")+ .args(["-L", crate::tmux::AGENT_SERVER])+ .args(["send-keys", "-t", target, keys, "Enter"])+ .output()?;+ Ok(())+ }++ fn capture_pane(&self, target: &str) -> Result<String> {+ let output = std::process::Command::new("tmux")+ .args(["-L", crate::tmux::AGENT_SERVER])+ .args(["capture-pane", "-t", target, "-p"])+ .output()?;+ Ok(String::from_utf8_lossy(&output.stdout).to_string())+ }+}++/// Real implementation using actual git commands+pub struct RealGitOps;++impl GitOperations for RealGitOps {+ fn create_worktree(&self, project_path: &Path, task_slug: &str) -> Result<String> {+ let path = crate::git::create_worktree(project_path, task_slug)?;+ Ok(path.to_string_lossy().to_string())+ }++ fn remove_worktree(&self, project_path: &Path, worktree_path: &str) -> Result<()> {+ std::process::Command::new("git")+ .current_dir(project_path)+ .args(["worktree", "remove", "--force", worktree_path])+ .output()?;+ Ok(())+ }++ fn worktree_exists(&self, project_path: &Path, task_slug: &str) -> bool {+ crate::git::worktree_exists(project_path, task_slug)+ }+}diff --git a/src/tui/app.rs b/src/tui/app.rsindex 71b7fda..7db75b7 100644--- a/src/tui/app.rs+++ b/src/tui/app.rs@@ -35,6 +35,7 @@ struct AppState {board: BoardState,input_mode: InputMode,input_buffer: String,+ input_cursor: usize, // Cursor position in input_buffer// For task creation/editingpending_task_title: String,editing_task_id: Option<String>, // Some(id) when editing, None when creating@@ -219,6 +220,7 @@ impl App {board: BoardState::new(),input_mode: InputMode::Normal,input_buffer: String::new(),+ input_cursor: 0,pending_task_title: String::new(),editing_task_id: None,db,@@ -526,15 +528,20 @@ impl App {};// Show title if we're on description step+ // Insert cursor (β) at the correct position+ let (before_cursor, after_cursor) = state.input_buffer.split_at(+ state.input_cursor.min(state.input_buffer.len())+ );let content = if state.input_mode == InputMode::InputDescription {format!(- "Title: {}\n\n{}{}β",+ "Title: {}\n\n{}{}β{}",state.pending_task_title,label,- state.input_buffer+ before_cursor,+ after_cursor)} else {- format!("{}{}β", label, state.input_buffer)+ format!("{}{}β{}", label, before_cursor, after_cursor)};let input = Paragraph::new(content)@@ -1723,6 +1730,7 @@ impl App {// Edit taskself.state.editing_task_id = Some(task.id.clone());self.state.input_buffer = task.title.clone();+ self.state.input_cursor = self.state.input_buffer.len();self.state.pending_task_title.clear();self.state.input_mode = InputMode::InputTitle;} else if task.session_name.is_some() {@@ -1761,6 +1769,7 @@ impl App {KeyCode::Esc => {self.state.input_mode = InputMode::Normal;self.state.input_buffer.clear();+ self.state.input_cursor = 0;self.state.pending_task_title.clear();self.state.editing_task_id = None;}@@ -1784,14 +1793,40 @@ impl App {self.state.input_buffer.clear();}+ self.state.input_cursor = self.state.input_buffer.len();self.state.input_mode = InputMode::InputDescription;}}+ KeyCode::Left => {+ if self.state.input_cursor > 0 {+ self.state.input_cursor -= 1;+ }+ }+ KeyCode::Right => {+ if self.state.input_cursor < self.state.input_buffer.len() {+ self.state.input_cursor += 1;+ }+ }+ KeyCode::Home => {+ self.state.input_cursor = 0;+ }+ KeyCode::End => {+ self.state.input_cursor = self.state.input_buffer.len();+ }KeyCode::Backspace => {- self.state.input_buffer.pop();+ if self.state.input_cursor > 0 {+ self.state.input_cursor -= 1;+ self.state.input_buffer.remove(self.state.input_cursor);+ }+ }+ KeyCode::Delete => {+ if self.state.input_cursor < self.state.input_buffer.len() {+ self.state.input_buffer.remove(self.state.input_cursor);+ }}KeyCode::Char(c) => {- self.state.input_buffer.push(c);+ self.state.input_buffer.insert(self.state.input_cursor, c);+ self.state.input_cursor += 1;}_ => {}}@@ -1809,9 +1844,13 @@ impl App {KeyCode::Enter | KeyCode::Tab => {// Select current matchif let Some(selected_file) = search.matches.get(search.selected).cloned() {- // Remove the #pattern from input and insert the file path+ // Replace #pattern with the selected file path, preserving text after+ let pattern_end = search.start_pos + 1 + search.pattern.len(); // +1 for #+ let suffix = self.state.input_buffer[pattern_end..].to_string();self.state.input_buffer.truncate(search.start_pos);self.state.input_buffer.push_str(&selected_file);+ self.state.input_cursor = self.state.input_buffer.len();+ self.state.input_buffer.push_str(&suffix);}self.state.file_search = None;}@@ -1839,16 +1878,19 @@ impl App {if search.pattern.is_empty() {// Cancel search if pattern is emptyself.state.input_buffer.pop(); // Remove the #+ self.state.input_cursor = self.state.input_cursor.saturating_sub(1);self.state.file_search = None;} else {search.pattern.pop();self.state.input_buffer.pop();+ self.state.input_cursor = self.state.input_cursor.saturating_sub(1);self.update_file_search_matches();}}KeyCode::Char(c) => {search.pattern.push(c);self.state.input_buffer.push(c);+ self.state.input_cursor += 1;self.update_file_search_matches();}_ => {}@@ -1860,6 +1902,7 @@ impl App {KeyCode::Esc => {self.state.input_mode = InputMode::Normal;self.state.input_buffer.clear();+ self.state.input_cursor = 0;self.state.pending_task_title.clear();self.state.editing_task_id = None;}@@ -1869,22 +1912,49 @@ impl App {// Remove backslash and insert newlineself.state.input_buffer.pop();self.state.input_buffer.push('\n');+ self.state.input_cursor = self.state.input_buffer.len();} else {// Save task (create or update)self.save_task()?;self.state.input_mode = InputMode::Normal;self.state.input_buffer.clear();+ self.state.input_cursor = 0;self.state.pending_task_title.clear();self.state.editing_task_id = None;}}+ KeyCode::Left => {+ if self.state.input_cursor > 0 {+ self.state.input_cursor -= 1;+ }+ }+ KeyCode::Right => {+ if self.state.input_cursor < self.state.input_buffer.len() {+ self.state.input_cursor += 1;+ }+ }+ KeyCode::Home => {+ self.state.input_cursor = 0;+ }+ KeyCode::End => {+ self.state.input_cursor = self.state.input_buffer.len();+ }KeyCode::Backspace => {- self.state.input_buffer.pop();+ if self.state.input_cursor > 0 {+ self.state.input_cursor -= 1;+ self.state.input_buffer.remove(self.state.input_cursor);+ }+ }+ KeyCode::Delete => {+ if self.state.input_cursor < self.state.input_buffer.len() {+ self.state.input_buffer.remove(self.state.input_cursor);+ }}KeyCode::Char('#') => {- // Start file search- let start_pos = self.state.input_buffer.len();- self.state.input_buffer.push('#');+ // Start file search at cursor position+ let start_pos = self.state.input_cursor;+ self.state.input_buffer.insert(self.state.input_cursor, '#');+ self.state.input_cursor += 1;self.state.file_search = Some(FileSearchState {pattern: String::new(),matches: vec![],@@ -1894,7 +1964,8 @@ impl App {self.update_file_search_matches();}KeyCode::Char(c) => {- self.state.input_buffer.push(c);+ self.state.input_buffer.insert(self.state.input_cursor, c);+ self.state.input_cursor += 1;}_ => {}}diff --git a/src/tui/mod.rs b/src/tui/mod.rsindex e3dd033..698cf3d 100644--- a/src/tui/mod.rs+++ b/src/tui/mod.rs@@ -1,5 +1,5 @@mod app;-mod board;+pub mod board;mod input;pub use app::App;diff --git a/tests/board_tests.rs b/tests/board_tests.rsnew file mode 100644index 0000000..dcc7c84--- /dev/null+++ b/tests/board_tests.rs@@ -0,0 +1,225 @@+use agtx::db::{Task, TaskStatus};+use agtx::tui::board::BoardState;++fn create_test_task(title: &str, status: TaskStatus) -> Task {+ let mut task = Task::new(title, "claude", "test-project");+ task.status = status;+ task+}++// === BoardState Tests ===++#[test]+fn test_board_state_new() {+ let board = BoardState::new();++ assert!(board.tasks.is_empty());+ assert_eq!(board.selected_column, 0);+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_board_state_default() {+ let board = BoardState::default();++ assert!(board.tasks.is_empty());+ assert_eq!(board.selected_column, 0);+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_tasks_in_column_empty() {+ let board = BoardState::new();++ for i in 0..5 {+ assert!(board.tasks_in_column(i).is_empty());+ }+}++#[test]+fn test_tasks_in_column_with_tasks() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ create_test_task("Task 3", TaskStatus::Running),+ create_test_task("Task 4", TaskStatus::Done),+ ];++ assert_eq!(board.tasks_in_column(0).len(), 2); // Backlog+ assert_eq!(board.tasks_in_column(1).len(), 0); // Planning+ assert_eq!(board.tasks_in_column(2).len(), 1); // Running+ assert_eq!(board.tasks_in_column(3).len(), 0); // Review+ assert_eq!(board.tasks_in_column(4).len(), 1); // Done+}++#[test]+fn test_tasks_in_column_invalid_column() {+ let board = BoardState::new();++ assert!(board.tasks_in_column(99).is_empty());+}++#[test]+fn test_selected_task_empty_board() {+ let board = BoardState::new();++ assert!(board.selected_task().is_none());+}++#[test]+fn test_selected_task_with_tasks() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ ];+ board.selected_column = 0;+ board.selected_row = 1;++ let task = board.selected_task().unwrap();+ assert_eq!(task.title, "Task 2");+}++#[test]+fn test_move_left() {+ let mut board = BoardState::new();+ board.selected_column = 2;++ board.move_left();+ assert_eq!(board.selected_column, 1);++ board.move_left();+ assert_eq!(board.selected_column, 0);++ // Should not go below 0+ board.move_left();+ assert_eq!(board.selected_column, 0);+}++#[test]+fn test_move_right() {+ let mut board = BoardState::new();+ board.selected_column = 0;++ board.move_right();+ assert_eq!(board.selected_column, 1);++ board.move_right();+ assert_eq!(board.selected_column, 2);++ board.move_right();+ assert_eq!(board.selected_column, 3);++ board.move_right();+ assert_eq!(board.selected_column, 4);++ // Should not go beyond last column+ board.move_right();+ assert_eq!(board.selected_column, 4);+}++#[test]+fn test_move_up() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ create_test_task("Task 3", TaskStatus::Backlog),+ ];+ board.selected_row = 2;++ board.move_up();+ assert_eq!(board.selected_row, 1);++ board.move_up();+ assert_eq!(board.selected_row, 0);++ // Should not go below 0+ board.move_up();+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_move_down() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ create_test_task("Task 3", TaskStatus::Backlog),+ ];+ board.selected_row = 0;++ board.move_down();+ assert_eq!(board.selected_row, 1);++ board.move_down();+ assert_eq!(board.selected_row, 2);++ // Should not go beyond last task+ board.move_down();+ assert_eq!(board.selected_row, 2);+}++#[test]+fn test_move_down_empty_column() {+ let mut board = BoardState::new();+ board.selected_row = 0;++ // Moving down in empty column should stay at 0+ board.move_down();+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_move_left_clamps_row() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ create_test_task("Task 3", TaskStatus::Backlog),+ create_test_task("Task 4", TaskStatus::Planning), // Only 1 task in Planning+ ];+ board.selected_column = 0; // Backlog with 3 tasks+ board.selected_row = 2; // Last task in Backlog++ board.move_right(); // Move to Planning with 1 task++ // Row should be clamped to 0 (only task in Planning)+ assert_eq!(board.selected_column, 1);+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_move_to_empty_column_clamps_row() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ // Planning column is empty+ ];+ board.selected_column = 0;+ board.selected_row = 1;++ board.move_right(); // Move to empty Planning column++ assert_eq!(board.selected_column, 1);+ assert_eq!(board.selected_row, 0);+}++#[test]+fn test_selected_task_mut() {+ let mut board = BoardState::new();+ board.tasks = vec![+ create_test_task("Task 1", TaskStatus::Backlog),+ create_test_task("Task 2", TaskStatus::Backlog),+ ];+ board.selected_column = 0;+ board.selected_row = 0;++ if let Some(task) = board.selected_task_mut() {+ task.title = "Modified Task".to_string();+ }++ assert_eq!(board.tasks[0].title, "Modified Task");+}diff --git a/tests/config_tests.rs b/tests/config_tests.rsnew file mode 100644index 0000000..953c133--- /dev/null+++ b/tests/config_tests.rs@@ -0,0 +1,108 @@+use agtx::config::{GlobalConfig, ProjectConfig, WorktreeConfig, ThemeConfig, MergedConfig};++// === ThemeConfig Tests ===++#[test]+fn test_parse_hex_valid() {+ assert_eq!(ThemeConfig::parse_hex("#FFFFFF"), Some((255, 255, 255)));+ assert_eq!(ThemeConfig::parse_hex("#000000"), Some((0, 0, 0)));+ assert_eq!(ThemeConfig::parse_hex("#FF0000"), Some((255, 0, 0)));+ assert_eq!(ThemeConfig::parse_hex("#00FF00"), Some((0, 255, 0)));+ assert_eq!(ThemeConfig::parse_hex("#0000FF"), Some((0, 0, 255)));+ assert_eq!(ThemeConfig::parse_hex("#5cfff7"), Some((92, 255, 247)));+}++#[test]+fn test_parse_hex_without_hash() {+ assert_eq!(ThemeConfig::parse_hex("FFFFFF"), Some((255, 255, 255)));+ assert_eq!(ThemeConfig::parse_hex("000000"), Some((0, 0, 0)));+}++#[test]+fn test_parse_hex_invalid() {+ assert_eq!(ThemeConfig::parse_hex("#FFF"), None); // Too short+ assert_eq!(ThemeConfig::parse_hex("#FFFFFFF"), None); // Too long+ assert_eq!(ThemeConfig::parse_hex("#GGGGGG"), None); // Invalid hex chars+ assert_eq!(ThemeConfig::parse_hex(""), None); // Empty+}++#[test]+fn test_theme_config_default() {+ let theme = ThemeConfig::default();++ // Verify all default colors are valid hex+ assert!(ThemeConfig::parse_hex(&theme.color_selected).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_normal).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_dimmed).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_text).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_accent).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_description).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_column_header).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_popup_border).is_some());+ assert!(ThemeConfig::parse_hex(&theme.color_popup_header).is_some());+}++// === GlobalConfig Tests ===++#[test]+fn test_global_config_default() {+ let config = GlobalConfig::default();++ assert_eq!(config.default_agent, "claude");+ assert!(config.worktree.enabled);+ assert!(config.worktree.auto_cleanup);+ assert_eq!(config.worktree.base_branch, "main");+}++// === WorktreeConfig Tests ===++#[test]+fn test_worktree_config_default() {+ let config = WorktreeConfig::default();++ assert!(config.enabled);+ assert!(config.auto_cleanup);+ assert_eq!(config.base_branch, "main");+}++// === ProjectConfig Tests ===++#[test]+fn test_project_config_default() {+ let config = ProjectConfig::default();++ assert!(config.default_agent.is_none());+ assert!(config.base_branch.is_none());+ assert!(config.github_url.is_none());+}++// === MergedConfig Tests ===++#[test]+fn test_merged_config_uses_global_defaults() {+ let global = GlobalConfig::default();+ let project = ProjectConfig::default();++ let merged = MergedConfig::merge(&global, &project);++ assert_eq!(merged.default_agent, "claude");+ assert_eq!(merged.base_branch, "main");+ assert!(merged.worktree_enabled);+ assert!(merged.auto_cleanup);+}++#[test]+fn test_merged_config_project_overrides() {+ let global = GlobalConfig::default();+ let project = ProjectConfig {+ default_agent: Some("codex".to_string()),+ base_branch: Some("develop".to_string()),+ github_url: Some("https://github.com/user/repo".to_string()),+ };++ let merged = MergedConfig::merge(&global, &project);++ assert_eq!(merged.default_agent, "codex");+ assert_eq!(merged.base_branch, "develop");+ assert_eq!(merged.github_url, Some("https://github.com/user/repo".to_string()));+}diff --git a/tests/db_tests.rs b/tests/db_tests.rsnew file mode 100644index 0000000..490f869--- /dev/null+++ b/tests/db_tests.rs@@ -0,0 +1,114 @@+use agtx::db::{Task, TaskStatus, Project};++// === TaskStatus Tests ===++#[test]+fn test_task_status_as_str() {+ assert_eq!(TaskStatus::Backlog.as_str(), "backlog");+ assert_eq!(TaskStatus::Planning.as_str(), "planning");+ assert_eq!(TaskStatus::Running.as_str(), "running");+ assert_eq!(TaskStatus::Review.as_str(), "review");+ assert_eq!(TaskStatus::Done.as_str(), "done");+}++#[test]+fn test_task_status_from_str() {+ assert_eq!(TaskStatus::from_str("backlog"), Some(TaskStatus::Backlog));+ assert_eq!(TaskStatus::from_str("planning"), Some(TaskStatus::Planning));+ assert_eq!(TaskStatus::from_str("running"), Some(TaskStatus::Running));+ assert_eq!(TaskStatus::from_str("review"), Some(TaskStatus::Review));+ assert_eq!(TaskStatus::from_str("done"), Some(TaskStatus::Done));+ assert_eq!(TaskStatus::from_str("invalid"), None);+ assert_eq!(TaskStatus::from_str(""), None);+}++#[test]+fn test_task_status_columns() {+ let columns = TaskStatus::columns();+ assert_eq!(columns.len(), 5);+ assert_eq!(columns[0], TaskStatus::Backlog);+ assert_eq!(columns[1], TaskStatus::Planning);+ assert_eq!(columns[2], TaskStatus::Running);+ assert_eq!(columns[3], TaskStatus::Review);+ assert_eq!(columns[4], TaskStatus::Done);+}++#[test]+fn test_task_status_roundtrip() {+ for status in TaskStatus::columns() {+ let s = status.as_str();+ let parsed = TaskStatus::from_str(s);+ assert_eq!(parsed, Some(*status));+ }+}++// === Task Tests ===++#[test]+fn test_task_new() {+ let task = Task::new("Test Task", "claude", "project-123");++ assert!(!task.id.is_empty());+ assert_eq!(task.title, "Test Task");+ assert_eq!(task.agent, "claude");+ assert_eq!(task.project_id, "project-123");+ assert_eq!(task.status, TaskStatus::Backlog);+ assert!(task.description.is_none());+ assert!(task.session_name.is_none());+ assert!(task.worktree_path.is_none());+ assert!(task.branch_name.is_none());+ assert!(task.pr_number.is_none());+ assert!(task.pr_url.is_none());+}++#[test]+fn test_task_generate_session_name() {+ let task = Task::new("Add User Authentication", "claude", "proj");+ let session_name = task.generate_session_name("myproject");++ // Should contain task id prefix (8 chars)+ assert!(session_name.starts_with("task-"));+ assert!(session_name.contains("--myproject--"));+ assert!(session_name.contains("add-user-authenticat")); // truncated to 20 chars+}++#[test]+fn test_task_generate_session_name_special_chars() {+ let task = Task::new("Fix bug #123 (urgent!)", "claude", "proj");+ let session_name = task.generate_session_name("test");++ // Special chars should be converted to dashes+ assert!(!session_name.contains("#"));+ assert!(!session_name.contains("("));+ assert!(!session_name.contains(")"));+ assert!(!session_name.contains("!"));+}++#[test]+fn test_task_unique_ids() {+ let task1 = Task::new("Task 1", "claude", "proj");+ let task2 = Task::new("Task 2", "claude", "proj");++ assert_ne!(task1.id, task2.id);+}++// === Project Tests ===++#[test]+fn test_project_new() {+ let project = Project::new("myproject", "/path/to/project");++ assert!(!project.id.is_empty());+ assert_eq!(project.name, "myproject");+ assert_eq!(project.path, "/path/to/project");+ assert!(project.github_url.is_none());+ assert!(project.default_agent.is_none());+}++#[test]+fn test_project_unique_ids() {+ let project1 = Project::new("proj1", "/path1");+ let project2 = Project::new("proj2", "/path2");++ assert_ne!(project1.id, project2.id);+}diff --git a/tests/operations_tests.rs b/tests/operations_tests.rsnew file mode 100644index 0000000..60d437b--- /dev/null+++ b/tests/operations_tests.rs@@ -0,0 +1,253 @@+#![cfg(feature = "test-mocks")]++use agtx::operations::{GitOperations, MockGitOperations, MockTmuxOperations, TmuxOperations};+use std::path::Path;++// === Tmux Operations Tests ===++#[test]+fn test_tmux_window_created_on_task_start() {+ let mut mock_tmux = MockTmuxOperations::new();++ // Expect window creation when task moves to Planning+ mock_tmux+ .expect_create_window()+ .withf(|session, window_name, working_dir| {+ session == "myproject"+ && window_name.starts_with("task-")+ && working_dir.contains(".agtx/worktrees")+ })+ .times(1)+ .returning(|_, _, _| Ok(()));++ // Simulate task starting+ let result = mock_tmux.create_window(+ "myproject",+ "task-abc123-my-feature",+ "/path/to/project/.agtx/worktrees/abc123-my-feature",+ );++ assert!(result.is_ok());+}++#[test]+fn test_tmux_window_killed_on_task_done() {+ let mut mock_tmux = MockTmuxOperations::new();++ // Expect window to be killed when task moves to Done+ mock_tmux+ .expect_kill_window()+ .withf(|target| target == "myproject:task-abc123-my-feature")+ .times(1)+ .returning(|_| Ok(()));++ // Simulate task completion+ let result = mock_tmux.kill_window("myproject:task-abc123-my-feature");++ assert!(result.is_ok());+}++#[test]+fn test_tmux_window_not_killed_on_review() {+ let mut mock_tmux = MockTmuxOperations::new();++ // Window should NOT be killed when moving to Review (we keep it open now)+ mock_tmux.expect_kill_window().times(0);++ // No kill_window call should happen+ // (In real code, we simply don't call kill_window when moving to Review)+}++#[test]+fn test_tmux_send_keys_for_claude_command() {+ let mut mock_tmux = MockTmuxOperations::new();++ mock_tmux+ .expect_send_keys()+ .withf(|target, keys| {+ target == "myproject:task-abc123"+ && keys.contains("claude")+ && keys.contains("--dangerously-skip-permissions")+ })+ .times(1)+ .returning(|_, _| Ok(()));++ let result = mock_tmux.send_keys(+ "myproject:task-abc123",+ "claude --dangerously-skip-permissions 'implement feature'",+ );++ assert!(result.is_ok());+}++// === Git Operations Tests ===++#[test]+fn test_worktree_created_on_task_planning() {+ let mut mock_git = MockGitOperations::new();++ // Expect worktree creation when task moves to Planning+ mock_git+ .expect_create_worktree()+ .withf(|project_path, task_slug| {+ project_path == Path::new("/path/to/project") && task_slug == "abc123-my-feature"+ })+ .times(1)+ .returning(|_, slug| Ok(format!("/path/to/project/.agtx/worktrees/{}", slug)));++ let result = mock_git.create_worktree(Path::new("/path/to/project"), "abc123-my-feature");++ assert!(result.is_ok());+ assert!(result.unwrap().contains("abc123-my-feature"));+}++#[test]+fn test_worktree_removed_on_task_done() {+ let mut mock_git = MockGitOperations::new();++ // Expect worktree removal when task moves to Done+ mock_git+ .expect_remove_worktree()+ .withf(|project_path, worktree_path| {+ project_path == Path::new("/path/to/project")+ && worktree_path == "/path/to/project/.agtx/worktrees/abc123-my-feature"+ })+ .times(1)+ .returning(|_, _| Ok(()));++ let result = mock_git.remove_worktree(+ Path::new("/path/to/project"),+ "/path/to/project/.agtx/worktrees/abc123-my-feature",+ );++ assert!(result.is_ok());+}++#[test]+fn test_worktree_not_removed_on_review() {+ let mut mock_git = MockGitOperations::new();++ // Worktree should NOT be removed when moving to Review+ mock_git.expect_remove_worktree().times(0);++ // No remove_worktree call should happen when going to Review+}++#[test]+fn test_worktree_exists_check() {+ let mut mock_git = MockGitOperations::new();++ mock_git+ .expect_worktree_exists()+ .withf(|project_path, task_slug| {+ project_path == Path::new("/path/to/project") && task_slug == "abc123-my-feature"+ })+ .times(1)+ .returning(|_, _| true);++ let exists = mock_git.worktree_exists(Path::new("/path/to/project"), "abc123-my-feature");++ assert!(exists);+}++// === Combined Workflow Tests ===++#[test]+fn test_full_task_lifecycle_creates_and_cleans_resources() {+ let mut mock_tmux = MockTmuxOperations::new();+ let mut mock_git = MockGitOperations::new();++ // 1. Backlog -> Planning: Create worktree and tmux window+ mock_git+ .expect_create_worktree()+ .times(1)+ .returning(|_, slug| Ok(format!("/worktrees/{}", slug)));++ mock_tmux+ .expect_create_window()+ .times(1)+ .returning(|_, _, _| Ok(()));++ mock_tmux+ .expect_send_keys()+ .times(1)+ .returning(|_, _| Ok(()));++ // Simulate Planning phase+ let worktree = mock_git+ .create_worktree(Path::new("/project"), "task-123")+ .unwrap();+ mock_tmux+ .create_window("proj", "task-123", &worktree)+ .unwrap();+ mock_tmux+ .send_keys("proj:task-123", "claude --dangerously-skip-permissions 'plan'")+ .unwrap();++ // 2. Planning -> Running: Send implementation command+ mock_tmux+ .expect_send_keys()+ .times(1)+ .returning(|_, _| Ok(()));++ mock_tmux+ .send_keys("proj:task-123", "Please implement the plan")+ .unwrap();++ // 3. Running -> Review: Window stays open (no kill)+ // (nothing happens here - window persists)++ // 4. Review -> Done: Cleanup+ mock_tmux+ .expect_kill_window()+ .times(1)+ .returning(|_| Ok(()));++ mock_git+ .expect_remove_worktree()+ .times(1)+ .returning(|_, _| Ok(()));++ mock_tmux.kill_window("proj:task-123").unwrap();+ mock_git+ .remove_worktree(Path::new("/project"), &worktree)+ .unwrap();+}++#[test]+fn test_resume_from_review_does_not_recreate_resources() {+ let mut mock_tmux = MockTmuxOperations::new();+ let mut mock_git = MockGitOperations::new();++ // When resuming from Review -> Running, we should NOT create new resources+ mock_git.expect_create_worktree().times(0);+ mock_tmux.expect_create_window().times(0);++ // The existing window and worktree should be reused+ // (In real code, we just change the task status)+}++#[test]+fn test_delete_task_cleans_up_all_resources() {+ let mut mock_tmux = MockTmuxOperations::new();+ let mut mock_git = MockGitOperations::new();++ // Deleting a task should clean up both tmux window and worktree+ mock_tmux+ .expect_kill_window()+ .withf(|target| target == "proj:task-abc123")+ .times(1)+ .returning(|_| Ok(()));++ mock_git+ .expect_remove_worktree()+ .withf(|_, worktree| worktree.contains("abc123"))+ .times(1)+ .returning(|_, _| Ok(()));++ // Simulate delete+ mock_tmux.kill_window("proj:task-abc123").unwrap();+ mock_git+ .remove_worktree(Path::new("/project"), "/project/.agtx/worktrees/abc123")+ .unwrap();+}diff --git a/tests/workflow_tests.rs b/tests/workflow_tests.rsnew file mode 100644index 0000000..538c0d4--- /dev/null+++ b/tests/workflow_tests.rs@@ -0,0 +1,133 @@+use agtx::db::{Task, TaskStatus};++fn create_test_task(title: &str, status: TaskStatus) -> Task {+ let mut task = Task::new(title, "claude", "test-project");+ task.status = status;+ task+}++// === Task State Transition Tests ===++/// Valid workflow transitions:+/// Backlog β Planning β Running β Review β Done+/// β__________| (resume via 'r')++#[test]+fn test_valid_forward_transitions() {+ // Backlog can move to Planning+ let task = create_test_task("Test", TaskStatus::Backlog);+ assert!(is_valid_forward_transition(task.status, TaskStatus::Planning));++ // Planning can move to Running+ let task = create_test_task("Test", TaskStatus::Planning);+ assert!(is_valid_forward_transition(task.status, TaskStatus::Running));++ // Running can move to Review+ let task = create_test_task("Test", TaskStatus::Running);+ assert!(is_valid_forward_transition(task.status, TaskStatus::Review));++ // Review can move to Done+ let task = create_test_task("Test", TaskStatus::Review);+ assert!(is_valid_forward_transition(task.status, TaskStatus::Done));+}++#[test]+fn test_invalid_forward_transitions() {+ // Cannot skip columns+ assert!(!is_valid_forward_transition(TaskStatus::Backlog, TaskStatus::Running));+ assert!(!is_valid_forward_transition(TaskStatus::Backlog, TaskStatus::Review));+ assert!(!is_valid_forward_transition(TaskStatus::Backlog, TaskStatus::Done));+ assert!(!is_valid_forward_transition(TaskStatus::Planning, TaskStatus::Review));+ assert!(!is_valid_forward_transition(TaskStatus::Planning, TaskStatus::Done));+ assert!(!is_valid_forward_transition(TaskStatus::Running, TaskStatus::Done));+}++#[test]+fn test_done_cannot_move_forward() {+ // Done is the final state+ assert!(!is_valid_forward_transition(TaskStatus::Done, TaskStatus::Backlog));+ assert!(!is_valid_forward_transition(TaskStatus::Done, TaskStatus::Planning));+ assert!(!is_valid_forward_transition(TaskStatus::Done, TaskStatus::Running));+ assert!(!is_valid_forward_transition(TaskStatus::Done, TaskStatus::Review));+}++#[test]+fn test_review_can_resume_to_running() {+ // Review β Running is the only valid backward transition (resume)+ assert!(is_valid_resume_transition(TaskStatus::Review, TaskStatus::Running));+}++#[test]+fn test_invalid_backward_transitions() {+ // Cannot move backward except Review β Running+ assert!(!is_valid_resume_transition(TaskStatus::Done, TaskStatus::Review));+ assert!(!is_valid_resume_transition(TaskStatus::Running, TaskStatus::Planning));+ assert!(!is_valid_resume_transition(TaskStatus::Planning, TaskStatus::Backlog));+}++#[test]+fn test_next_status() {+ assert_eq!(next_status(TaskStatus::Backlog), Some(TaskStatus::Planning));+ assert_eq!(next_status(TaskStatus::Planning), Some(TaskStatus::Running));+ assert_eq!(next_status(TaskStatus::Running), Some(TaskStatus::Review));+ assert_eq!(next_status(TaskStatus::Review), Some(TaskStatus::Done));+ assert_eq!(next_status(TaskStatus::Done), None);+}++#[test]+fn test_column_indices() {+ let columns = TaskStatus::columns();++ assert_eq!(columns[0], TaskStatus::Backlog);+ assert_eq!(columns[1], TaskStatus::Planning);+ assert_eq!(columns[2], TaskStatus::Running);+ assert_eq!(columns[3], TaskStatus::Review);+ assert_eq!(columns[4], TaskStatus::Done);+}++#[test]+fn test_task_status_preserves_through_transitions() {+ let mut task = create_test_task("My Feature", TaskStatus::Backlog);++ // Simulate workflow+ task.status = TaskStatus::Planning;+ assert_eq!(task.status, TaskStatus::Planning);+ assert_eq!(task.title, "My Feature"); // Other fields preserved++ task.status = TaskStatus::Running;+ assert_eq!(task.status, TaskStatus::Running);++ task.status = TaskStatus::Review;+ assert_eq!(task.status, TaskStatus::Review);++ // Resume back to Running+ task.status = TaskStatus::Running;+ assert_eq!(task.status, TaskStatus::Running);++ task.status = TaskStatus::Review;+ task.status = TaskStatus::Done;+ assert_eq!(task.status, TaskStatus::Done);+}++// === Helper functions that mirror the app logic ===++/// Check if moving forward one step is valid+fn is_valid_forward_transition(from: TaskStatus, to: TaskStatus) -> bool {+ next_status(from) == Some(to)+}++/// Check if resume transition is valid (only Review β Running)+fn is_valid_resume_transition(from: TaskStatus, to: TaskStatus) -> bool {+ from == TaskStatus::Review && to == TaskStatus::Running+}++/// Get the next status in the workflow+fn next_status(status: TaskStatus) -> Option<TaskStatus> {+ match status {+ TaskStatus::Backlog => Some(TaskStatus::Planning),+ TaskStatus::Planning => Some(TaskStatus::Running),+ TaskStatus::Running => Some(TaskStatus::Review),+ TaskStatus::Review => Some(TaskStatus::Done),+ TaskStatus::Done => None,+ }+}