Skip to content

Commit 819d240

Browse files
tianzhouCopilot
andauthored
Update src/utils/startup-table.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 597c52c commit 819d240

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/startup-table.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@ export function generateStartupTable(sources: SourceDisplayInfo[]): string {
9292
return hostDb.length;
9393
})
9494
);
95-
const modeWidth = 10;
95+
const modeWidth = Math.max(
96+
10,
97+
...sources.map((s) => {
98+
const modes: string[] = [];
99+
if (s.isDemo) modes.push("DEMO");
100+
if (s.readonly) modes.push("READ-ONLY");
101+
return modes.join(" ").length;
102+
})
103+
);
96104

97105
// Total width: 2 for borders + content + 2 spaces padding per column + 2 separators
98106
const totalWidth = 2 + idTypeWidth + 3 + hostDbWidth + 3 + modeWidth + 2;

0 commit comments

Comments
 (0)