Skip to content

Comments

feat(issue-list): add --period flag, pagination progress, and count abbreviation#289

Open
BYK wants to merge 10 commits intomainfrom
feat/issue-list-period-progress
Open

feat(issue-list): add --period flag, pagination progress, and count abbreviation#289
BYK wants to merge 10 commits intomainfrom
feat/issue-list-period-progress

Conversation

@BYK
Copy link
Member

@BYK BYK commented Feb 24, 2026

Summary

Three UX improvements to sentry issue list following the auto-pagination work in #274:

  • Fix implicit time filtering — add --period / -t flag (default 90d) so the CLI matches the UI's default time window instead of the Sentry API's implicit 14d cutoff, which was causing the count discrepancy (e.g. 114 vs 240 issues)
  • Pagination progress spinner — animated braille spinner on stderr while fetching multiple pages (Fetching issues... 200/500); reuses withProgress<T>() in polling.ts so the animation is consistent with sentry issue explain
  • Fix COUNT column layout shift — abbreviate event counts ≥10k with K/M/B/T/P/E suffixes (12.3K, 150K, 1.5M) so the column stays exactly 5 chars wide and never overflows

Details

  • --period alias is -t (time period), not -p (avoids confusion with --platform in other commands)
  • onPage callback added to listIssuesAllPages for per-page progress hooks
  • Animation interval changed from 80ms to 50ms (20fps / 500ms full braille cycle), matching the ora/inquirer standard — applies to Seer commands too
  • Decimal shown only when scaled < 100 (e.g. 12.3K and 1.5M but not 100.0M)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (issue-list) Add --period flag, pagination progress, and count abbreviation by BYK in #289

Bug Fixes 🐛

  • (brew) Handle root-owned config dir from sudo installs by BYK in #288
  • (setup) Show actual shell name instead of "unknown" for unsupported shells by BYK in #287

Internal Changes 🔧

  • Only showing status about changed files in codecov by MathurAditya724 in #286

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Codecov Results 📊

✅ Patch coverage is 84.35%. Project has 3657 uncovered lines.
✅ Project coverage is 75.37%. Comparing base (base) to head (head).

Files with missing lines (3)
File Patch % Lines
human.ts 57.70% ⚠️ 412 Missing
api-client.ts 72.00% ⚠️ 243 Missing
list.ts 75.39% ⚠️ 125 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    75.35%    75.37%    +0.02%
==========================================
  Files          115       115         —
  Lines        14760     14845       +85
  Branches         0         0         —
==========================================
+ Hits         11121     11188       +67
- Misses        3639      3657       +18
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK force-pushed the feat/issue-list-period-progress branch from 36f5c6e to 8dad881 Compare February 24, 2026 10:38
…bbreviation

- Add --period flag (default 90d) so the CLI matches the UI time window instead of
  the API's implicit 14d default; alias -p
- Show an animated spinner on stderr (⠋⠙⠹… braille frames, 50ms / 20fps) when
  auto-paginating beyond 100 issues, updating with Fetching issues... N/limit;
  suppressed in JSON mode
- Abbreviate large event counts (≥10k) with K/M/B suffixes so the COUNT column
  stays at 5 chars and never causes a layout shift
- Add withProgress<T>() to polling.ts, sharing spinner infrastructure (frames,
  truncation, interval) with the Seer explain/plan commands
- Expose onPage callback in listIssuesAllPages for per-page progress hooks
@BYK BYK force-pushed the feat/issue-list-period-progress branch from 163e329 to 35d6daa Compare February 24, 2026 10:56
BYK added 2 commits February 24, 2026 11:32
…st spinner frame immediately

- Remove .slice(0, COL_COUNT) from abbreviateCount — the toFixed(1) to
  Math.round() fallback already guarantees width, and slice would silently
  corrupt the value if it ever activated
- Call scheduleFrame() directly instead of setTimeout(scheduleFrame, ...) in
  both poll() and withProgress() so the first spinner frame renders immediately
…led < 100

- Extend QUANTIFIERS to include P (peta, 10^15) and E (exa, 10^18) so the
  output is valid for any realistic input without a slice safety net
- Only show the decimal place when scaled < 100, avoiding ugly '100.0M'-style
  output while still showing '12.3K' and '1.5M' where the decimal adds info
@BYK BYK marked this pull request as ready for review February 24, 2026 11:41
…iod in cursor context key

- Fix abbreviateCount: compare rounded1dp (Number(scaled.toFixed(1))) against < 100
  instead of raw scaled, preventing '100.0K' when e.g. scaled = 99.95 rounds up
- Include period in pagination contextKey so --cursor last doesn't reuse a stale
  cursor from a query with a different --period value
…t limit

- Promote to next tier when Math.round(scaled) reaches 1000 (e.g. 999950 →
  '1000K' was misleading, now correctly shows '1.0M')
- Cap onPage reported count at options.limit so progress never shows '120/100'
  when the last page overshoots the requested limit
…ER caveat

- When at the max (E) tier and rounded >= 1000 with no next tier to promote to,
  clamp to 999 to guarantee the output always fits within COL_COUNT
- Add JSDoc note that Number(raw) loses precision above Number.MAX_SAFE_INTEGER
  (~9P), which is beyond any realistic Sentry event count
…d of unguarded padStart

padStart only pads, never truncates — a non-numeric raw string would pass
through at its original width and break column alignment. Return '    ?'
instead to keep COL_COUNT width while visually flagging the unexpected input.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

…xtKey

- Track per-target fetched counts and sum them so concurrent multi-project
  fetches show a stable combined total instead of jumping between values
- Escape flags.period with escapeContextKeyValue in contextKey (same treatment
  as flags.query) to prevent pipe chars in user input from corrupting the key;
  guard with ?? '90d' fallback for test contexts that omit the flag
…, report NaN counts

- Extract startSpinner() from duplicated spinner code in poll() and
  withProgress() — eliminates ~30 lines of duplication
- Set stopped = true unconditionally in poll() finally block, not just in
  non-JSON mode
- Replace fetchedCounts array + reduce with running total + delta tracking
  in multi-target progress (onPage reports cumulative, not increments)
- Use '?'.padStart(COL_COUNT) for NaN placeholder instead of hardcoded spaces,
  and report to Sentry as a warning for unexpected non-numeric input
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.

1 participant