Skip to content

Clear transient fetch progress and add matching team progress - #249

Merged
shouze merged 9 commits into
mainfrom
shouze-super-guide
Oct 29, 2026
Merged

shouze merged 9 commits into
mainfrom
shouze-super-guide

Conversation

@shouze

@shouze shouze commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #247.
Closes #248 (native enhancement sub-issue of #247).

  • Erase results-fetch progress on completion, including empty results, and before propagating errors instead of leaving a newline.
  • Preserve line-number-resolution progress cleanup.
  • Replace the static matching-team repository-fetch message with the same 20-block purple/grey bar, indentation and completed/total counter used by line resolution. Preserve the existing label and requested prefixes when terminal width permits.
  • Advance once per completed team after all its repository pages finish, including inaccessible teams (404), and erase progress on success or failure.
  • Reuse the existing concurrent worker helper (20 workers) so all work settles before cleanup and no late update redraws progress after an error. Cached data still bypasses fetching and its progress bar.
  • Address review findings: clear and pause progress while rate-limit callbacks own stderr; suppress concurrent updates until callbacks finish; keep countdown and all three bars within terminal width, truncating long labels while preserving bars/counters where space permits. Compare the exact parsed hostname in the raw-content test mock.

TDD history (all commits signed):

  1. 8e182ed — four failing bug reproduction tests.
  2. 31ccae4 — dedicated bug fix; four reproduction tests pass.
  3. bb71f43 — five failing enhancement cases covering empty/one/multiple teams, pagination and errors.
  4. 8ad3310 — dedicated enhancement implementation.
  5. ff5df7f — review regression tests and exact-hostname mock fix.
  6. c68c960 — dedicated countdown/wrapping fix.

Manual verification: run github-code-search query hello --org <your-org> --group-by-team-prefix squad-,chapter- --no-cache with an authenticated token. Progress should remain visible during each fetch, use matching purple/grey blocks, and disappear when its phase completes. Team progress counts completed teams, not individual repository pages. At 80 columns, labels shorten without wrapping the bar. During rate-limit waits, the countdown temporarily owns the progress row.

How did you verify your code works?

  • Before the original bug fix: bun test src/api.test.ts --test-name-pattern 'fetch progress cleanup' --dots — four failures reproduce missing cleanup.
  • After the original bug fix: the same command — four tests pass; the filtered command still exits nonzero because repository-wide coverage thresholds are not met by a filtered run.
  • Before enhancement implementation: bun test src/api.test.ts --test-name-pattern 'fetch progress lifecycle' --dots — four existing cases pass, five enhancement cases fail as expected.
  • Before review fixes: bun test src/api.test.ts --test-name-pattern 'countdown|93-team' --dots — five failures reproduce countdown and 80-column defects.
  • bun test --dots — passed: 1,055 tests, zero failures, including six new review regression cases and repository coverage thresholds. Coverage includes newline-writing callbacks, rejecting callbacks, concurrent completion during a countdown, and all 94 updates for 93 teams at 80 columns.
  • bun run typecheck — passed, no type errors in 59 files.
  • bun run format:check — passed, all 149 files formatted.
  • bun run knip — passed; two existing configuration hints for native Bun subcommands.
  • bun run build.ts — passed, Darwin ARM64 binary compiled and codesign verified.
  • git diff --check — passed.
  • Live GitHub/TTY verification not run; API and stderr behavior are covered with mocked, offline tests.
  • Aikido scan not run: its MCP server is unavailable in this session. Setup: https://help.aikido.dev/ide-plugins/aikido-mcp.

shouze and others added 4 commits October 29, 2026 12:18
Reproduce #247: four regression cases fail before the fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Erase the transient line on success and failure instead of leaving a newline. Fixes #247.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reproduce #248 before implementation, covering style, pagination, 404s, empty teams and cleanup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse the line-resolution progress style and count teams only after all repository pages finish. Drain concurrent workers before clearing the line on success or error. Closes #248.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 11:21
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging shouze-super-guide into main will be

96.66%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
scripts
   a11y-utils.ts100%100%100%100%
src
   aggregate.ts100%100%100%100%
   api-utils.ts92.80%100%91.67%92.92%101–103, 165, 86–87, 92–93
   api.ts95.92%100%100%95.43%345–348, 430, 64–67, 69
   cache.ts94.37%100%100%93.94%139–141, 39
   completions.ts99.44%100%100%99.39%268
   gh-cli.ts100%100%100%100%
   group.ts98.37%100%98.33%98.37%1105, 263–265, 525, 531, 607, 865, 980
   output.ts99.31%100%95.83%99.62%89
   regex.ts99.37%100%100%99.32%360
   render.ts90.35%100%88.24%90.43%175, 177–178, 201–206, 208–210, 213, 234–235, 427–428, 528–532, 562–569, 571–579, 582–584
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts86.73%100%92.31%86.36%128, 131, 133–134, 153–154, 167–169, 188–193, 195, 198–202, 209, 214, 250–253
src/render
   filter-match.ts97.22%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.53%100%90.40%99.28%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.34%100%100%99.29%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

Comment thread src/api.test.ts Fixed

This comment was marked as resolved.

shouze and others added 2 commits October 29, 2026 12:27
Reproduce review findings for #249 before the fix; compare the exact hostname in the raw-content mock.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pause concurrent progress while rate-limit callbacks own stderr and clear before callback output. Keep bars within the terminal width, preserving counters and blocks while truncating long labels.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging shouze-super-guide into main will be

96.73%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
scripts
   a11y-utils.ts100%100%100%100%
src
   aggregate.ts100%100%100%100%
   api-utils.ts92.80%100%91.67%92.92%101–103, 165, 86–87, 92–93
   api.ts96.82%100%100%96.47%419–422, 507, 65–68, 70
   cache.ts94.37%100%100%93.94%139–141, 39
   completions.ts99.44%100%100%99.39%268
   gh-cli.ts100%100%100%100%
   group.ts98.37%100%98.33%98.37%1105, 263–265, 525, 531, 607, 865, 980
   output.ts99.31%100%95.83%99.62%89
   regex.ts99.37%100%100%99.32%360
   render.ts90.37%100%88.24%90.45%176, 178–179, 202–207, 209–211, 214, 235–236, 428–429, 529–533, 563–570, 572–580, 583–585
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts86.73%100%92.31%86.36%128, 131, 133–134, 153–154, 167–169, 188–193, 195, 198–202, 209, 214, 250–253
src/render
   filter-match.ts97.22%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.53%100%90.40%99.28%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.34%100%100%99.29%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

This comment was marked as resolved.

shouze and others added 2 commits October 29, 2026 12:37
Reproduce the 31-column boundary from PR #249 review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Omit both label and ellipsis when only the bar and counter fit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging shouze-super-guide into main will be

96.73%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
scripts
   a11y-utils.ts100%100%100%100%
src
   aggregate.ts100%100%100%100%
   api-utils.ts92.80%100%91.67%92.92%101–103, 165, 86–87, 92–93
   api.ts96.84%100%100%96.49%421–424, 509, 65–68, 70
   cache.ts94.37%100%100%93.94%139–141, 39
   completions.ts99.44%100%100%99.39%268
   gh-cli.ts100%100%100%100%
   group.ts98.37%100%98.33%98.37%1105, 263–265, 525, 531, 607, 865, 980
   output.ts99.31%100%95.83%99.62%89
   regex.ts99.37%100%100%99.32%360
   render.ts90.37%100%88.24%90.45%176, 178–179, 202–207, 209–211, 214, 235–236, 428–429, 529–533, 563–570, 572–580, 583–585
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts86.73%100%92.31%86.36%128, 131, 133–134, 153–154, 167–169, 188–193, 195, 198–202, 209, 214, 250–253
src/render
   filter-match.ts97.22%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.53%100%90.40%99.28%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.34%100%100%99.29%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A terminal resize during a rate-limit countdown can restore a cached line at the old width, causing wrapping and leaving stale progress that subsequent updates and cleanup do not erase.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Rebuild cached countdown line after terminal resize

src/​api.ts:254

If the terminal narrows during a rate-limit countdown, latest still uses the old width, so restoring it can wrap onto another row. Later updates and cleanup erase only the last row, leaving stale progress behind. Clip or rebuild the cached line using the current terminal width before restoring it, and add a resize-during-countdown regression test.

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging shouze-super-guide into main will be

96.73%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
scripts
   a11y-utils.ts100%100%100%100%
src
   aggregate.ts100%100%100%100%
   api-utils.ts92.80%100%91.67%92.92%101–103, 165, 86–87, 92–93
   api.ts96.84%100%100%96.49%421–424, 509, 65–68, 70
   cache.ts94.37%100%100%93.94%139–141, 39
   completions.ts99.44%100%100%99.39%268
   gh-cli.ts100%100%100%100%
   group.ts98.37%100%98.33%98.37%1105, 263–265, 525, 531, 607, 865, 980
   output.ts99.31%100%95.83%99.62%89
   regex.ts99.37%100%100%99.32%360
   render.ts90.37%100%88.24%90.45%176, 178–179, 202–207, 209–211, 214, 235–236, 428–429, 529–533, 563–570, 572–580, 583–585
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts86.73%100%92.31%86.36%128, 131, 133–134, 153–154, 167–169, 188–193, 195, 198–202, 209, 214, 250–253
src/render
   filter-match.ts97.22%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.53%100%90.40%99.28%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.34%100%100%99.29%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

@shouze
shouze merged commit e6d3cdf into main Oct 29, 2026
5 checks passed
@shouze
shouze deleted the shouze-super-guide branch October 29, 2026 11:46
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.

Add progress to fetching repositories for matching teams Clear the results progress bar after fetching

3 participants