- define thread/title column widths as constants - pad thread IDs and titles so large-thread render rows align consistently
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -203,12 +203,15 @@ function summarizeTrace(tracePath) { · 202 unmodified lines | ||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | function createMarkdownSummary({ tracePath, donePayload, summary, thresholds }) { |
| 206 | + const THREAD_COL_WIDTH = 8; | |
| 207 | + const TITLE_COL_WIDTH = 15; | |
| 208 | + const pad = (value, width) => String(value).padEnd(width, " "); | |
| 206 | 209 | const largeThreadRenderStats = Array.isArray(donePayload.interactions?.largeThreadRenderStats) |
| 207 | 210 | ? donePayload.interactions.largeThreadRenderStats |
| 208 | 211 | : []; |
| 209 | 212 | const formatThreadRenderRow = (stat) => { |
| 210 | 213 | const threadShort = |
| 211 | − typeof stat.threadId === "string" ? stat.threadId.slice(0, 8) : "n/a"; | |
| 214 | + typeof stat.threadId === "string" ? stat.threadId.slice(0, THREAD_COL_WIDTH) : "n/a"; | |
| 212 | 215 | const titleShort = |
| 213 | 216 | typeof stat.threadTitleShort === "string" |
| 214 | 217 | ? stat.threadTitleShort |
| @@ -233,7 +236,7 @@ function createMarkdownSummary({ tracePath, donePayload, summary, thresholds }) · 18 unmodified lines | ||
| 233 | 236 | typeof followUpMinMs === "number" && typeof followUpMaxMs === "number" |
| 234 | 237 | ? `${followUpMinMs}-${followUpMaxMs} (${followUpSampleCount}x)` |
| 235 | 238 | : "n/a"; |
| 236 | − return `| ${threadShort} | ${titleShort} | ${stat.messageCount} | ${firstRenderMs} | ${followUpRenderMs} | ${followUpRange} | ${deltaMs} | ${deltaPct}% |`; | |
| 239 | + return `| ${pad(threadShort, THREAD_COL_WIDTH)} | ${pad(titleShort, TITLE_COL_WIDTH)} | ${stat.messageCount} | ${firstRenderMs} | ${followUpRenderMs} | ${followUpRange} | ${deltaMs} | ${deltaPct}% |`; | |
| 237 | 240 | }; |
| 238 | 241 | const seedSource = |
| 239 | 242 | donePayload.seed?.source === "file" |