Add team pick mode — resolve multi-team sections interactively or via --pick-team#121
Add team pick mode — resolve multi-team sections interactively or via --pick-team#121
Conversation
… --pick-team - Add applyTeamPick + rebuildTeamSections to src/group.ts; moved repos tagged with pickedFrom for future split-mode support - Add src/render/team-pick.ts: pure renderTeamPickHeader function - Update src/render.ts: section cursor (bgMagenta + ── prefix), ◈ badge for picked repos, teamPickMode rendering branch, pick mode hints bar - Update src/tui.ts: p key enters pick mode on multi-team sections, ← / → / Enter / Esc key bindings, nav fix (section rows no longer skipped), initialPickTeams param + confirmedPicks pre-seeding - Update src/output.ts: pickTeams in ReplayOptions, --pick-team in replay - Update github-code-search.ts: --pick-team repeatable option, stderr warning on unmatched label, pass picks to runInteractive - Update docs: team-grouping.md, keyboard-shortcuts.md, cli-options.md, architecture/components.md, AGENTS.md, CONTRIBUTING.md Fixes: applyTeamPick identity check, CLI picks not propagated to TUI, silent failure on unmatched --pick-team label. See issue #85
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
🔦 Lighthouse Report
|
There was a problem hiding this comment.
Pull request overview
Adds a “team pick mode” to resolve multi-team sections produced by --group-by-team-prefix, either interactively in the TUI (p) or non-interactively via repeatable --pick-team flags, and ensures replay commands capture these picks.
Changes:
- Introduces pure grouping helpers
applyTeamPick()/rebuildTeamSections()andRepoGroup.pickedFromtagging for moved repos. - Adds TUI pick mode state + keybindings and renders a pick bar +
◈badge in the TUI. - Extends CLI and replay output to accept/emit
--pick-team, plus updates docs and contributor/agent guidance.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds pickedFrom metadata on RepoGroup for picked repos. |
| src/group.ts | Adds pure helpers to apply picks and rebuild sections. |
| src/group.test.ts | Adds unit tests for team-pick grouping helpers. |
| src/tui.ts | Implements interactive pick mode (p, arrows, Enter/Esc) and forwards picks into replay options. |
| src/render/team-pick.ts | Adds pure pick-bar renderer for the active section header. |
| src/render/team-pick.test.ts | Adds unit tests for pick-bar rendering. |
| src/render.ts | Renders pick bar in section headers and shows ◈ badge on moved repos; adds help/hints text. |
| src/output.ts | Adds pickTeams to replay options and emits --pick-team in replay command. |
| src/output.test.ts | Tests replay command includes --pick-team. |
| github-code-search.ts | Adds --pick-team option, applies picks pre-flattening, warns on unmatched labels, passes initial picks to TUI. |
| docs/usage/team-grouping.md | Documents team pick mode UX + --pick-team. |
| docs/reference/keyboard-shortcuts.md | Documents p binding and pick-mode keys. |
| docs/reference/cli-options.md | Documents --pick-team option. |
| docs/architecture/components.md | Updates C4 diagram to include team-pick component and styling. |
| CONTRIBUTING.md | Updates file map and test coverage description. |
| AGENTS.md | Updates agent-facing notes for --pick-team and pickedFrom. |
| bun.lock | Bumps VitePress version. |
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/tui.ts:525
- Now that section header rows are navigable,
a/n(select all/none) won’t do anything when the cursor is on a section row because the handlers requirerow.type !== "section"(and applySelectAll/None require repo/extract context). Consider mapping section cursor to an adjacent repo row (e.g. the next non-section row) before invoking selection actions so global selection shortcuts still work from section headers.
if (key === ANSI_ARROW_UP || key === "k") {
// Arrow up — section-header rows are navigable (needed for `p`)
const next = Math.max(0, cursor - 1);
cursor = next;
if (cursor < scrollOffset) scrollOffset = cursor;
}
if (key === ANSI_ARROW_DOWN || key === "j") {
// Arrow down — section-header rows are navigable (needed for `p`)
const next = Math.min(rows.length - 1, cursor + 1);
cursor = next;
while (
scrollOffset < cursor &&
!isCursorVisible(rows, groups, cursor, scrollOffset, getViewportHeight(rows))
) {
scrollOffset++;
}
}
|
Coverage after merging feat/team-pick-mode into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Motivation
When
--group-by-team-prefixmatches a repository to multiple teams, it currently creates a combined section likesquad-frontend + squad-mobile. There is no way to assign that repo to a single team — the user is stuck with the merged label in both the TUI and the replay command.Fixes #85.
What changed
New
--pick-teamCLI option (repeatable)Each
--pick-team "<combined label>"=<chosenTeam>assignment moves the repos from the combined section into the chosen team's section. Unrecognised labels emit awarning:on stderr listing available combined sections.Interactive pick mode (
pkey in TUI)When the cursor is on a multi-team section header, pressing
penters pick mode:←/→cycle through candidate team names (shown in a hint bar at the top).Enterconfirms the choice;Esccancels with no change.confirmedPicksand forwarded tobuildOutputso the generated replay command includes the matching--pick-teamflags.Pure functions
src/group.tsapplyTeamPick()— moves repos;rebuildTeamSections()— rebuilds from flat listsrc/render/team-pick.tsrenderTeamPickHeader()— pure ANSI hint barUpdated modules
src/tui.ts—pkey,←/→/Enter/Escbindings,initialPickTeamsparamsrc/output.ts—pickTeamsfield inReplayOptions; forwarded to replay commandgithub-code-search.ts—--pick-teamrepeatable option; stderr warning on unmatched labeldocs/usage/team-grouping.md,docs/reference/keyboard-shortcuts.md,docs/reference/cli-options.md,docs/architecture/components.md,AGENTS.mdHow to test manually
Validation