feat(issue-list): add --period flag, pagination progress, and count abbreviation#289
feat(issue-list): add --period flag, pagination progress, and count abbreviation#289
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ Patch coverage is 86.73%. Project has 3654 uncovered lines. Files with missing lines (4)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 75.35% 75.38% +0.03%
==========================================
Files 115 115 —
Lines 14760 14843 +83
Branches 0 0 —
==========================================
+ Hits 11121 11189 +68
- Misses 3639 3654 +15
- Partials 0 0 —Generated by Codecov Action |
36f5c6e to
8dad881
Compare
…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
163e329 to
35d6daa
Compare
…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
…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.
…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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| } | ||
| if (raw.length <= COL_COUNT) { | ||
| return raw.padStart(COL_COUNT); | ||
| } |
There was a problem hiding this comment.
Count abbreviation skips exactly 10k
Low Severity
abbreviateCount decides whether to abbreviate based on raw.length <= COL_COUNT, so a count of 10000 (exactly 10k) is not abbreviated even though the feature intent is to abbreviate counts ≥10k. This creates inconsistent formatting right at the threshold.


Summary
Three UX improvements to
sentry issue listfollowing the auto-pagination work in #274:--period/-tflag (default90d) 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)Fetching issues... 200/500); reuseswithProgress<T>()inpolling.tsso the animation is consistent withsentry issue explain12.3K,150K,1.5M) so the column stays exactly 5 chars wide and never overflowsDetails
--periodalias is-t(time period), not-p(avoids confusion with--platformin other commands)onPagecallback added tolistIssuesAllPagesfor per-page progress hooksscaled < 100(e.g.12.3Kand1.5Mbut not100.0M)