feat(maestro): tui draft form gains a worktree section (#65)
Worktree on by default over a git repository with Enter/Space to spawn in the checkout itself; base repo inferred from picked projects or a guarded /api/gitroot probe for raw paths (a miss unticks, web parity); new-branch name tracking the generated session name until touched; Left/Right switches to picking an existing branch from GET /api/branches, with held branches skipped and rendered dimmed beside their holder. No cleanup option: cleanup is unconditional daemon-side (#56).
This commit is contained in:
@@ -767,6 +767,8 @@ mod tests {
|
||||
};
|
||||
|
||||
draft.picked_cwd = Some(std::path::PathBuf::from("/srv/work"));
|
||||
draft.base_repo = Some(std::path::PathBuf::from("/srv/work"));
|
||||
draft.probed_cwd = Some(std::path::PathBuf::from("/srv/work"));
|
||||
draft.selected_preset = draft.presets.len() - 1; // custom
|
||||
app.handle_draft_input(&InputKey::Tab); // preset → custom command
|
||||
for c in "claude".chars() {
|
||||
@@ -777,6 +779,9 @@ mod tests {
|
||||
for c in "crimson-otter".chars() {
|
||||
app.handle_draft_input(&InputKey::char(c));
|
||||
}
|
||||
app.handle_draft_input(&InputKey::Tab); // → worktree toggle
|
||||
app.handle_draft_input(&InputKey::Tab); // → branch mode
|
||||
app.handle_draft_input(&InputKey::Tab); // → new-branch name
|
||||
app.handle_draft_input(&InputKey::Tab); // → submit
|
||||
|
||||
match app.handle_draft_input(&InputKey::Enter).as_slice() {
|
||||
@@ -800,7 +805,7 @@ mod tests {
|
||||
let mut app = make_app();
|
||||
app.dispatch(Action::NewDraftPane);
|
||||
// Walk to Submit without picking anything.
|
||||
for _ in 0..3 {
|
||||
for _ in 0..4 {
|
||||
app.handle_draft_input(&InputKey::Tab);
|
||||
}
|
||||
assert!(app.handle_draft_input(&InputKey::Enter).is_empty());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user