Commit 7feea05
authored
feat(dashboard): rich terminal chart rendering for dashboard view (#555)
Add a full chart rendering engine for `sentry dashboard view` that
transforms widget data into rich terminal visualizations.
<img width="2305" height="1969" alt="image"
src="https://github.com/user-attachments/assets/eb703010-ed7d-4332-8cd1-1152c3e2743f"
/>
## Chart Types
- **Big numbers**: 4-tier auto-scaling ASCII art fonts (7×7 → 5×5 → 3×3
→ single-line) with vertical centering
- **Time-series bars**: Fractional block characters (▁▂▃▄▅▆▇█) for
smooth bar tops, Y-axis ticks, time-axis labels with ┬ tick marks
- **Stacked multi-series**: Distinct colors per series (6-color palette)
with color-keyed ■ legend
- **Categorical bars**: Direct labels for short names, letter-keyed
legend (A:label B:label…) for long ones
- **Horizontal bars**, **sparklines**, **tables**
## Layout & Formatting
- Framebuffer grid compositing matching Sentry's widget layout (x/y/w/h)
- Dynamic terminal width (`process.stdout.columns`, min 80, fallback
100)
- Compact Y-axis ticks via `formatTickLabel()`: 321K, 1.5M, 0
- Time-axis format adapts to span: <2d → HH:MM, 2-30d → MM/DD, >30d →
Mon DD
- Multi-series aggregation and stacked rendering for grouped data (e.g.,
Errors by title)
- Rounded Unicode borders ╭╮╰╯ with embedded widget titles
## Files Changed
| File | What |
|------|------|
| `src/lib/formatters/dashboard.ts` | New — full chart rendering engine
(~1700 lines) |
| `src/lib/api/dashboards.ts` | Widget data querying with env/project
filters |
| `src/types/dashboard.ts` | New — Zod schemas for dashboard API
responses |
| `src/commands/dashboard/view.ts` | Wire up data fetching and rendering
|
| `test/lib/formatters/dashboard.test.ts` | New — 174 tests (412
assertions) |
| `test/types/dashboard.test.ts` | Zod schema validation tests |1 parent e4e7fd1 commit 7feea05
File tree
14 files changed
+3860
-226
lines changed- plugins/sentry-cli/skills/sentry-cli/references
- src
- commands/dashboard
- lib
- api
- formatters
- types
- test
- lib/formatters
- types
14 files changed
+3860
-226
lines changedLarge diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
19 | 22 | | |
| 23 | + | |
20 | 24 | | |
21 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
35 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
36 | 124 | | |
37 | 125 | | |
38 | 126 | | |
39 | 127 | | |
40 | 128 | | |
41 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
42 | 132 | | |
43 | 133 | | |
44 | 134 | | |
45 | 135 | | |
46 | 136 | | |
47 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
48 | 141 | | |
49 | 142 | | |
50 | 143 | | |
51 | | - | |
| 144 | + | |
52 | 145 | | |
53 | 146 | | |
54 | 147 | | |
| |||
65 | 158 | | |
66 | 159 | | |
67 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
68 | 174 | | |
69 | | - | |
| 175 | + | |
70 | 176 | | |
71 | 177 | | |
72 | 178 | | |
| |||
80 | 186 | | |
81 | 187 | | |
82 | 188 | | |
83 | | - | |
84 | 189 | | |
85 | 190 | | |
86 | 191 | | |
87 | 192 | | |
88 | 193 | | |
89 | 194 | | |
90 | 195 | | |
| 196 | + | |
91 | 197 | | |
92 | 198 | | |
93 | 199 | | |
94 | 200 | | |
95 | 201 | | |
96 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
97 | 260 | | |
98 | 261 | | |
99 | 262 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
0 commit comments