A file-based task manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tsk-43: fzf picker for assign target

`tsk assign` target arg is now optional; omit it to fzf-pick from the
existing queues (active queue is excluded since assign refuses
self-targets anyway).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+23 -2
+23 -2
src/lib.rs
··· 181 181 }, 182 182 /// Move a task from the active queue's index into another queue's inbox. 183 183 Assign { 184 - target: String, 184 + /// Target queue. Omit to fzf-pick from existing queues. 185 + target: Option<String>, 185 186 #[command(flatten)] 186 187 task_id: TaskId, 187 188 /// Auto-push refs to this remote after assigning. Empty string skips. Default: origin. ··· 699 700 700 701 fn command_assign( 701 702 dir: PathBuf, 702 - target: String, 703 + target: Option<String>, 703 704 task_id: TaskId, 704 705 remote: Option<String>, 705 706 ) -> Result<()> { 706 707 let ws = Workspace::from_path(dir)?; 708 + let target = match target { 709 + Some(t) => t, 710 + None => pick_assign_target(&ws)?, 711 + }; 707 712 let (key, stable) = ws.assign_to_queue(task_id.into(), &target)?; 708 713 println!("Assigned to {target} as {key}"); 709 714 auto_push_refs(&ws, remote, ws.refs_for_assign_out(&target, &stable)?); 710 715 Ok(()) 716 + } 717 + 718 + fn pick_assign_target(ws: &Workspace) -> Result<String> { 719 + let cur = ws.queue(); 720 + let candidates: Vec<String> = ws 721 + .list_queues()? 722 + .into_iter() 723 + .filter(|q| q != &cur) 724 + .collect(); 725 + if candidates.is_empty() { 726 + return Err(errors::Error::Parse( 727 + "No other queues to assign to".into(), 728 + )); 729 + } 730 + fzf::select::<_, String, _>(candidates, ["--prompt=assign to> "])? 731 + .ok_or_else(|| errors::Error::Parse("No queue selected".into())) 711 732 } 712 733 713 734 fn command_pull(dir: PathBuf, source: String, task_id: TaskId) -> Result<()> {