Add arrow-based team re-pick mode; remove --dispatch option#124
Conversation
- Re-pick mode (TUI 't' on a picked repo) now uses ←/→ to cycle candidate teams and Enter to confirm — consistent with pick mode UX. Single-line hints bar reuses renderTeamPickHeader. - Fix: undoing a pick now clears confirmedPicks so --pick-team is correctly removed from the replay command. - Remove --dispatch CLI option, applyDispatch helper, dispatchedTeam / extractDispatchedTeam types, and dispatch block from replay command. Repo moves go through the new moveRepoToSection pure helper. - Add moveRepoToSection to group.ts with companion tests. - Docs: keyboard-shortcuts.md, interactive-mode.md and team-grouping.md updated for consistent 't' key and re-pick mode descriptions.
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
🔦 Lighthouse Report
|
There was a problem hiding this comment.
Pull request overview
This PR updates the interactive TUI to support an arrow-key-driven team re-pick mode for previously picked repos, and removes the legacy --dispatch workflow in favor of simpler internal helpers and updated documentation.
Changes:
- Added a new TUI “re-pick mode” (triggered by
ton a picked◈repo) with ←/→ navigation, Enter confirm, 0/u restore, Esc/t cancel. - Introduced pure grouping helpers to support re-pick/undo flows (
moveRepoToSection,undoPickedRepo) and added corresponding unit tests. - Updated docs to reflect the new
tbehavior and re-pick bindings across interactive/team-grouping references.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tui.ts | Adds re-pick mode state + key handling, and threads mode state into rendering. |
| src/render.ts | Renders the re-pick hints bar (using the existing team pick header rendering) and updates global hints text. |
| src/group.ts | Adds pure helpers for undoing a pick and moving a repo between team sections. |
| src/group.test.ts | Adds unit tests for the new grouping helpers. |
| docs/usage/team-grouping.md | Replaces --dispatch guidance with re-pick/undo pick documentation and examples. |
| docs/usage/interactive-mode.md | Updates shortcut documentation for t to include re-pick behavior on picked repos. |
| docs/reference/keyboard-shortcuts.md | Documents t behavior for team ownership and adds a re-pick mode key table. |
… text, add tests, update docs
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- render.ts: wrap full re-pick hints line with clipAnsi() so it never wraps on extremely narrow terminals (prefix + bar + suffix all clipped) - group.ts: insertBeforeOther() helper keeps 'other' section last when undoPickedRepo or moveRepoToSection must create a new section - group.ts: add undoSectionPick() — restores ALL repos with matching pickedFrom back to the combined section in one operation (inverse of applyTeamPick); used by 0/u in re-pick mode - tui.ts: 0/u now calls undoSectionPick instead of undoPickedRepo, so the entire combined section is undone atomically — confirmedPicks stays in sync with the restored visual state - docs: update key table and Undoing a pick section to reflect that 0/u undoes the whole section pick, not just one repo - group.test.ts: new tests for insert-before-other (undoPickedRepo & moveRepoToSection) and for undoSectionPick (multi-repo restore, insert-before-other, append-to-existing)
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
renderTeamPickHeader now uses a sliding window algorithm:
- The focused team is always visible in [ brackets ], regardless of
how many candidates exist and how narrow the available bar width is.
- Candidates hidden to the left/right of the visible window are indicated
with '…' ellipsis markers (left and right independently).
- The window expands greedily right then left from the focused item to
fill as much of maxWidth as possible.
- Previously the function always rendered from candidate 0 and clipped
at the right; scrolling past the second item left the focused team
off-screen even though the index was advancing.
Re-pick bar right-alignment:
- The hints block ('0/u restore ← → move ↵ confirm Esc/t cancel')
is now always anchored at the right terminal edge via padding, instead
of being attached directly to the bar content (which caused it to drift
left when the candidate bar was shorter than its allocated width).
New tests:
- renderTeamPickHeader: left ellipsis, both ellipses, focused always
visible for all indices, window shift, clipped focused, symmetrical fill.
- renderGroups re-pick bar: right-alignment assertion (suffix ends at
termWidth), suffix fixed position as focusedIndex changes, focused team
visible for all 8 candidates on a narrow (80-char) terminal.
4804e57 to
ce6e76a
Compare
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
684df81 to
143c582
Compare
|
Coverage after merging feat/team-dispatch into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Closes #86; closes #87
Summary
This PR introduces an improved team re-pick UX in the TUI and removes the
--dispatchCLI option entirely.What changed
Re-pick mode redesign (
src/tui.ts,src/render.ts)ton a picked repo (marked◈) now opens re-pick mode, consistent with pick mode UX.renderTeamPickHeader(single line, no multi-line fallback needed).Fix: undo now clears
--pick-teamfrom replay command (src/tui.ts)0/uleftconfirmedPicks[combinedLabel]intact, so the replay command kept emitting--pick-teamfor the restored section.pickedFrombefore callingundoPickedRepo, then deletes the correspondingconfirmedPicksentry.Remove
--dispatchoption (src/group.ts,src/types.ts,src/output.ts,github-code-search.ts,docs/reference/cli-options.md)applyDispatch,normaliseDispatchRepo,dispatchedTeam,extractDispatchedTeamand dispatch block from the replay command.moveRepoToSection(groups, repoFullName, targetTeam)— a simpler pure helper used internally by the TUI re-pick confirm handler.Tests (
src/group.test.ts)applyDispatchtest suite withmoveRepoToSectiontests.strips dispatchedTeam when undoingtest (field no longer exists).Documentation (
docs/reference/keyboard-shortcuts.md,docs/usage/interactive-mode.md,docs/usage/team-grouping.md)tkey behaviour across all three files.←/→cycle,Enterconfirm,0/urestore entire section,Esc/texit.How to test
Manual: run with
--group-by-team-prefix, navigate to a picked repo (◈), presstand verify arrow navigation works as expected.