Skip to content

Commit 043a7af

Browse files
committed
fix(profile): align table header columns with data rows
Pad # to padStart(3) and ALIAS to padEnd(6) in the header to match the data row formatting. Fix non-alias divider width from 91 to 87 to match actual content width.
1 parent 3817e60 commit 043a7af

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

docs/src/content/docs/commands/profile.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ sentry profile list my-org/backend --period 7d
3939
```
4040
Transactions with Profiles in my-org/backend (last 7d):
4141
42-
# ALIAS TRANSACTION SAMPLES p75 p95
43-
─────────────────────────────────────────────────────────────────────────────────────────────────────
44-
1 u projects/{project_id}/users/ 42 3.8s 5.0s
45-
2 a webhooks/provision/account/ 18 2.7s 2.7s
46-
3 c organizations/{org_id}/code-mappings/ 6 2.1s 2.1s
47-
4 e projects/{project_id}/events/ 291 1.5s 8.6s
48-
5 i organizations/{org_id}/issues/ 541 1.5s 2.8s
42+
# ALIAS TRANSACTION SAMPLES p75 p95
43+
─────────────────────────────────────────────────────────────────────────────────────────────────────────
44+
1 u projects/{project_id}/users/ 42 3.8s 5.0s
45+
2 a webhooks/provision/account/ 18 2.7s 2.7s
46+
3 c organizations/{org_id}/code-mappings/ 6 2.1s 2.1s
47+
4 e projects/{project_id}/events/ 291 1.5s 8.6s
48+
5 i organizations/{org_id}/issues/ 541 1.5s 2.8s
4949
5050
Common prefix stripped: /api/0/
5151
Tip: Use 'sentry profile view 1' or 'sentry profile view <alias>' to analyze.

src/lib/formatters/profile.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ export function formatProfileListTableHeader(hasAliases = false): string {
242242
const txnHeader = "TRANSACTION".padEnd(TRANSACTION_COL_WIDTH);
243243
const tail = `${"SAMPLES".padStart(9)} ${"p75".padStart(10)} ${"p95".padStart(10)}`;
244244
if (hasAliases) {
245-
return muted(` # ALIAS ${txnHeader} ${tail}`);
245+
// Pad # and ALIAS to match data row widths (padStart(3) and padEnd(6))
246+
return muted(
247+
` ${"#".padStart(3)} ${"ALIAS".padEnd(6)} ${txnHeader} ${tail}`
248+
);
246249
}
247250
return muted(` ${txnHeader} ${tail}`);
248251
}
@@ -315,8 +318,9 @@ export function formatProfileListRow(
315318
* Compute the table divider width based on whether aliases are shown.
316319
*/
317320
export function profileListDividerWidth(hasAliases: boolean): number {
318-
// #(5) + sep(3) + alias(6) + sep(2) + txn(50) + sep(2) + samples(9) + sep(2) + p75(10) + sep(2) + p95(10) = 101
319-
return hasAliases ? 101 : 91;
321+
// With aliases: indent(2) + #(3) + sep(3) + alias(6) + sep(2) + txn(50) + sep(2) + samples(9) + sep(2) + p75(10) + sep(2) + p95(10) = 101
322+
// Without: indent(2) + txn(50) + sep(2) + samples(9) + sep(2) + p75(10) + sep(2) + p95(10) = 87
323+
return hasAliases ? 101 : 87;
320324
}
321325

322326
/**

0 commit comments

Comments
 (0)