From 5747c7180040303f04cd4d98470105dd8f3d952d Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 24 Aug 2026 15:42:10 +0100 Subject: [PATCH 1/2] fix(maestro): distinct labels for the worktree branch field (#94) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new-branch name input and the existing-branch picker both had a literal , on top of "New branch"/"Existing branch" mode radios — reading the form gave no clue what the field wanted. Kept the mode radios (they name the choice, not the field) and gave each field its own label: "New branch name" for the text input, "Pick a branch" for the select. --- web/src/spawnForm.ts | 4 ++-- web/src/spawnFormWorktree.test.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/web/src/spawnForm.ts b/web/src/spawnForm.ts index 42a0ca1..d5d01ab 100644 --- a/web/src/spawnForm.ts +++ b/web/src/spawnForm.ts @@ -176,11 +176,11 @@ export function createSpawnForm(opts: SpawnFormOptions): SpawnFormHandle { diff --git a/web/src/spawnFormWorktree.test.ts b/web/src/spawnFormWorktree.test.ts index 87be6d3..6a39479 100644 --- a/web/src/spawnFormWorktree.test.ts +++ b/web/src/spawnFormWorktree.test.ts @@ -180,6 +180,21 @@ describe("spawnForm worktree defaults and branch picker (#61)", () => { expect(modes.at(-1)).toBe("existing"); }); + it("labels the new-branch input and existing-branch picker distinctly (#94)", async () => { + const form = await mount(); + pickProject(form); + await drain(); + + const newLabel = form.querySelector(".wt-new-wrap")!.textContent!.trim(); + const existLabel = form.querySelector(".wt-exist-wrap")!.textContent!.trim(); + + expect(newLabel).not.toBe("Branch"); + expect(existLabel).not.toBe("Branch"); + expect(newLabel).not.toBe(existLabel); + expect(newLabel).toMatch(/name/i); + expect(existLabel).toMatch(/pick|choose|select/i); + }); + it("collapses the advanced (worktree) section by default (#93)", async () => { const form = await mount(); const toggle = form.querySelector(".wt-toggle")!; From e6ef236f89d994d57e44c6911518ba90a72b0fe8 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 24 Aug 2026 15:44:06 +0100 Subject: [PATCH 2/2] fix(maestro): match the web form's distinct branch-field labels in the TUI (#94) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The draft pane's new-branch gutter was labelled "br:" in both branch modes — since #94's web fix now says "New branch name" / "Pick a branch", mirror the same distinction here: "new:" for the branch-name input, "pick:" for the existing-branch list (which previously had no label at all). --- crates/maestro-tui/src/draft.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/maestro-tui/src/draft.rs b/crates/maestro-tui/src/draft.rs index 9a4c360..d90a685 100644 --- a/crates/maestro-tui/src/draft.rs +++ b/crates/maestro-tui/src/draft.rs @@ -1392,7 +1392,7 @@ impl DraftPane { match self.branch_mode { WorktreeBranchMode::New => { let row = next_row(); - draw_gutter(f, row, "br:"); + draw_gutter(f, row, "new:"); let col = draw_text_field(f, &self.branch, row, field_style(DraftField::BranchNew)); if self.focused_field == DraftField::BranchNew { @@ -1416,6 +1416,7 @@ impl DraftPane { .unwrap_or(0) .min(20); let list_row = next_row(); + draw_gutter(f, list_row, "pick:"); for i in start..(start + capacity).min(len.max(1)) { let y = list_row.y + (i - start) as u16; if y >= list_row.y + list_row.height { @@ -2541,10 +2542,25 @@ mod tests { draft.base_repo = Some(PathBuf::from("/home/u/tea/maestro")); draft.probed_cwd = Some(PathBuf::from("/home/u/tea/maestro")); let rendered = render_to_string(100, 24, |f| draft.render(f, f.area(), true)); - for s in ["[new] [existing]", "br:", "crimson-otter"] { + for s in ["[new] [existing]", "new:", "crimson-otter"] { assert!(rendered.contains(s), "missing {s:?}:\n{rendered}"); } + // The new-branch input and existing-branch picker must not share a + // label — matching the web form's "New branch name" / "Pick a + // branch" (#94). + draft.set_branch_mode(WorktreeBranchMode::Existing); + let rendered = render_to_string(100, 24, |f| draft.render(f, f.area(), true)); + assert!( + rendered.contains("pick:"), + "missing pick: label:\n{rendered}" + ); + assert!( + !rendered.contains("br:"), + "stale ambiguous label:\n{rendered}" + ); + draft.set_branch_mode(WorktreeBranchMode::New); + draft.focused_field = DraftField::WorktreeToggle; draft.on_input(&InputKey::Enter); let rendered = render_to_string(100, 24, |f| draft.render(f, f.area(), true));