-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(issue-list): add --period flag, pagination progress, and count abbreviation #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
BYK
wants to merge
11
commits into
main
Choose a base branch
from
feat/issue-list-period-progress
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+218
−37
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35d6daa
feat(issue-list): add --period flag, pagination progress, and count a…
BYK 6dbdd0c
chore: regenerate SKILL.md
github-actions[bot] dc90da0
fix: remove silent .slice() truncation in abbreviateCount, render fir…
BYK 38156ba
fix(abbreviateCount): extend to P/E tiers, only show decimal when sca…
BYK c5cdbee
fix: prevent abbreviateCount overflow at tier boundaries, include per…
BYK 688c664
fix: promote abbreviateCount to next tier at boundaries, cap onPage a…
BYK c4dfd99
fix(abbreviateCount): cap at 999 at max tier, document MAX_SAFE_INTEG…
BYK 5829e95
fix(abbreviateCount): return placeholder for non-numeric input instea…
BYK 65b3acf
fix: stable multi-target progress aggregation, escape period in conte…
BYK 343b3ef
refactor: extract startSpinner helper, use running total for progress…
BYK 9d4567f
fix: use Sentry logger for NaN warning, derive abbreviation threshold…
BYK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ | |
| * Follows gh cli patterns for alignment and presentation. | ||
| */ | ||
|
|
||
| // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import | ||
| import * as Sentry from "@sentry/bun"; | ||
| import prettyMs from "pretty-ms"; | ||
| import type { | ||
| Breadcrumb, | ||
|
|
@@ -313,6 +315,52 @@ const COL_SEEN = 10; | |
| /** Width for the FIXABILITY column (longest value "high(100%)" = 10) */ | ||
| const COL_FIX = 10; | ||
|
|
||
| /** Quantifier suffixes indexed by groups of 3 digits (K=10^3, M=10^6, …, E=10^18) */ | ||
| const QUANTIFIERS = ["", "K", "M", "B", "T", "P", "E"]; | ||
|
|
||
| /** | ||
| * Abbreviate large numbers to fit within {@link COL_COUNT} characters. | ||
| * Uses K/M/B/T/P/E suffixes up to 10^18 (exa). | ||
| * | ||
| * The decimal is only shown when the rounded value is < 100 (e.g. "12.3K", | ||
| * "1.5M" but not "100M"). The result is always exactly COL_COUNT chars wide. | ||
| * | ||
| * Note: `Number(raw)` loses precision above `Number.MAX_SAFE_INTEGER` | ||
| * (~9P / 9×10^15), which is far beyond any realistic Sentry event count. | ||
| * | ||
| * Examples: 999 → " 999", 12345 → "12.3K", 150000 → " 150K", 1500000 → "1.5M" | ||
| */ | ||
| function abbreviateCount(raw: string): string { | ||
| const n = Number(raw); | ||
| if (Number.isNaN(n)) { | ||
| // Non-numeric input: use a placeholder rather than passing through an | ||
| // arbitrarily wide string that would break column alignment | ||
| Sentry.logger.warn(`Unexpected non-numeric issue count: ${raw}`); | ||
| return "?".padStart(COL_COUNT); | ||
| } | ||
| if (raw.length <= COL_COUNT) { | ||
| return raw.padStart(COL_COUNT); | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Count abbreviation skips exactly 10kLow Severity
|
||
| const tier = Math.min(Math.floor(Math.log10(n) / 3), QUANTIFIERS.length - 1); | ||
| const suffix = QUANTIFIERS[tier] ?? ""; | ||
| const scaled = n / 10 ** (tier * 3); | ||
| // Only show decimal when it adds information — compare the rounded value to avoid | ||
| // "100.0K" when scaled is e.g. 99.95 (toFixed(1) rounds up to "100.0") | ||
| const rounded1dp = Number(scaled.toFixed(1)); | ||
| if (rounded1dp < 100) { | ||
| return `${rounded1dp.toFixed(1)}${suffix}`.padStart(COL_COUNT); | ||
| } | ||
| const rounded = Math.round(scaled); | ||
| // Promote to next tier if rounding produces >= 1000 (e.g. 999.95K → "1.0M") | ||
| if (rounded >= 1000 && tier < QUANTIFIERS.length - 1) { | ||
| const nextSuffix = QUANTIFIERS[tier + 1] ?? ""; | ||
| return `${(rounded / 1000).toFixed(1)}${nextSuffix}`.padStart(COL_COUNT); | ||
| } | ||
| // At max tier with no promotion available: cap at 999 to guarantee COL_COUNT width | ||
| // (numbers > 10^21 are unreachable in practice for Sentry event counts) | ||
| return `${Math.min(rounded, 999)}${suffix}`.padStart(COL_COUNT); | ||
| } | ||
BYK marked this conversation as resolved.
Show resolved
Hide resolved
BYK marked this conversation as resolved.
Show resolved
Hide resolved
BYK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** Column where title starts in single-project mode (no ALIAS column) */ | ||
| const TITLE_START_COL = | ||
| COL_LEVEL + 1 + COL_SHORT_ID + 1 + COL_COUNT + 2 + COL_SEEN + 2 + COL_FIX + 2; | ||
|
|
@@ -582,7 +630,7 @@ export function formatIssueRow( | |
| const rawLen = getShortIdDisplayLength(issue.shortId); | ||
| const shortIdPadding = " ".repeat(Math.max(0, COL_SHORT_ID - rawLen)); | ||
| const shortId = `${formattedShortId}${shortIdPadding}`; | ||
| const count = `${issue.count}`.padStart(COL_COUNT); | ||
| const count = abbreviateCount(`${issue.count}`); | ||
BYK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const seen = formatRelativeTime(issue.lastSeen); | ||
|
|
||
| // Fixability column (color applied after padding to preserve alignment) | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Uh oh!
There was an error while loading. Please reload this page.