Skip to content

Fix inconsistent repo picker: use dropdown in both new session and multi-agent flows#404

Merged
PureWeen merged 2 commits intomainfrom
fix/in-new-session-the-repository-is-a-dropd-20260318-0939
Mar 19, 2026
Merged

Fix inconsistent repo picker: use dropdown in both new session and multi-agent flows#404
PureWeen merged 2 commits intomainfrom
fix/in-new-session-the-repository-is-a-dropd-20260318-0939

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Collaborator

Bug

In 'New Session' the repository selector is a <select> dropdown, but in 'New Multi-Agent' it was a list of clickable buttons. This inconsistency is confusing.

Fix

Changed the multi-agent repo picker (Step 1 in SessionSidebar.razor) from a button list to a <select> dropdown matching CreateSessionForm:

  • Multiple repos: <select class="ns-repo-select"> dropdown with placeholder option
  • Single repo: <div class="ns-repo-label"> label (auto-advances to Step 2)
  • No repos: Existing 'no repositories' message

Also added OnMultiAgentRepoChanged handler and auto-advance logic when there's exactly 1 repo.

Tests

Added RepoPickerConsistencyTests.cs (8 tests) verifying:

  • Both forms use <select> with ns-repo-select class
  • Multi-agent picker no longer uses button list
  • Single-repo label behavior matches
  • Auto-advance and placeholder option exist
  • Handler exists for dropdown change event

All 2760 tests pass.

StephaneDelcroix and others added 2 commits March 18, 2026 10:48
…w multi-agent flows

The 'New Session' form (CreateSessionForm.razor) used a <select> dropdown for
repository selection, while the 'New Multi-Agent' flow (SessionSidebar.razor)
used a list of clickable buttons. This was confusing for users.

Changes:
- Replace button list in multi-agent Step 1 with <select class="ns-repo-select">
  dropdown, matching the CreateSessionForm pattern
- Add placeholder option ('Pick a repo') for the dropdown
- Show ns-repo-label when there's only 1 repo (matches single-repo behavior)
- Auto-advance to Step 2 (preset picker) when there's exactly 1 repo
- Add OnMultiAgentRepoChanged handler for the dropdown's onchange event

Tests:
- Add RepoPickerConsistencyTests.cs with 8 tests verifying both forms use
  the same <select> pattern, ns-repo-select class, single-repo label, and
  auto-advance behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SessionSidebar_MultiAgent_DoesNotUseButtonListForRepos was silently
passing when the regex pattern didn't match (e.g., after a comment
rename). Added Assert.True(step1Match.Success) so the test fails
loudly instead of vacuously succeeding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Owner

PR Review: Fix inconsistent repo picker (#404)

CI Status: ⚠️ No checks reported on this branch.


Round 1 Findings

# Severity Finding
F1 🟡 MODERATE Vacuous testSessionSidebar_MultiAgent_DoesNotUseButtonListForRepos used if (step1Match.Success) { ... } with no assertion when the regex didn't match, so the test passed silently on comment rename/restructure
F2 🟢 MINOR Unreachable template branch — The else if (Count == 1) / ns-repo-label in SessionSidebar.razor is never rendered: StartAddMultiAgentGroup() auto-advances synchronously before Blazor renders

Fix Applied (commit 51ae507)

F1 fixed: replaced the if-guarded assertion with:

Assert.True(step1Match.Success, "Could not locate Step 1 section...");
Assert.DoesNotContain("worktree-item", step1Match.Value);

All 8 new tests pass after the fix.


Round 2 Findings (Post-Fix)

Finding Status
F1 — Vacuous test ✅ FIXED
F2 — Unreachable ns-repo-label branch 🟢 STILL PRESENT (harmless — acceptable consistency tradeoff with CreateSessionForm; 5/5 models found no new issues)

Test Coverage

8 new snapshot-style tests cover: both forms use ns-repo-select, no button-list in step 1, single-repo label, auto-advance logic, placeholder option, and handler existence. Coverage is appropriate for a UI consistency fix.


Recommended Action: ✅ Approve

The core fix is correct and well-tested. The remaining minor item (dead ns-repo-label branch) is harmless dead code kept for template symmetry with CreateSessionForm.

@PureWeen PureWeen merged commit 004b34c into main Mar 19, 2026
@PureWeen PureWeen deleted the fix/in-new-session-the-repository-is-a-dropd-20260318-0939 branch March 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants