Skip to content

Add --pick-team-auto: auto-resolve combined sections by common prefix - #199

Draft
shouze wants to merge 1 commit into
feat/team-hierarchy-remove-consolidatefrom
feat/team-hierarchy-pick-team-auto
Draft

Add --pick-team-auto: auto-resolve combined sections by common prefix#199
shouze wants to merge 1 commit into
feat/team-hierarchy-remove-consolidatefrom
feat/team-hierarchy-pick-team-auto

Conversation

@shouze

@shouze shouze commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds --pick-team-auto: automatically resolves combined team sections whose team names share a common prefix, at any hierarchy depth, without requiring an explicit --pick-team.

  • For each combined section ("a + b"), if exactly one team name is a literal string-prefix of every other team name in the combo (e.g. gamme-lead-client for "gamme-lead-client + gamme-lead-client-p1"), auto-resolve to that team.
  • Combos with no such common-prefix team (e.g. "squad-frontend + squad-mobile") are left combined and unresolved — same as today, --pick-team still works for these.
  • Auto-pick runs after explicit --pick-team assignments, so an explicit pick for the same section always wins.
  • src/group.ts: new autoPickTeamsByCommonPrefix (+ private findCommonPrefixTeam helper).
  • github-code-search.ts: new CLI flag, wired before the "unresolved combined sections" stderr note (now also triggered by --pick-team-auto).
  • src/output.ts / src/tui.ts: threaded pickTeamAuto through ReplayOptions / buildReplayCommand / runInteractive so a session using the flag replays identically.
  • src/completions.ts: new completion entry.
  • Docs: new "Auto-pick by common prefix" section replacing the removed consolidated-rendering one, and the CLI option row.

Closes #197. Depends on #198 (branch is stacked on top of it).

How did you verify your code works?

  • New unit tests in src/group.test.ts covering: single common-prefix winner, no common prefix (left combined), 3+-way combos (shortest-prefix wins), nested (non-top-level) sections, explicit-pick-wins-over-auto, purity, and no-op when nothing is combined.
  • New tests in src/output.test.ts / src/completions.test.ts for replay-command emission and completion scripts.
  • bun test (990 passing), bun run lint, bun run format:check, bun run knip, bun run build.ts all green.

Auto-resolves a combined team section (e.g. "gamme-lead-client +
gamme-lead-client-p1") to whichever team name is a literal prefix of
every other team name in the combo, at any hierarchy depth. Combos
with no common-prefix team are left combined/unresolved, and an
explicit --pick-team for the same section always wins (auto-pick
runs after explicit assignments).

Closes #197
@github-actions

Copy link
Copy Markdown

Coverage after merging feat/team-hierarchy-pick-team-auto into feat/team-hierarchy-remove-consolidate will be

96.84%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   aggregate.ts100%100%100%100%
   api-utils.ts93.20%100%93.75%93.13%101–103, 65, 73, 86–87, 91–92
   api.ts94.74%100%100%94.07%340–344, 405, 422, 63–69
   cache.ts94.67%100%100%94.29%139–141, 39
   completions.ts99.44%100%100%99.39%276
   group.ts99.09%100%98.18%99.28%487, 493, 572, 741
   output.ts99.37%100%95.83%99.66%84
   regex.ts99.39%100%100%99.34%329
   render.ts90.99%100%88.24%91.09%177, 201–206, 208–210, 212–213, 234, 427–428, 528–532, 562–569, 571–579, 581–584
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts88.38%100%94.44%87.89%128, 131, 133, 153, 167–168, 188–195, 198–204, 209, 214, 250–253
src/render
   filter-match.ts97.44%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.63%100%90.40%99.31%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.42%100%100%99.38%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

@github-actions

Copy link
Copy Markdown

🔦 Lighthouse Report

Page ⚡ Perf ♿ A11y 🛡️ BP 🔍 SEO Report
/github-code-search/ 🟢 96 (≥96) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view
/github-code-search/getting-started/ 🟢 99 (≥96) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view

Thresholds: Perf ≥ 96 · A11y ≥ 99 · BP ≥ 99 · SEO ≥ 99
commit 0e23c91 · full workflow run

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.

[9/9] --pick-team-auto: auto-resolve combined sections by smallest common prefix

1 participant