Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(sidebar): give the session name priority over the account chip

enes42f1e32b0866
diff --git a/src/renderer/components/SessionRow.tsx b/src/renderer/components/SessionRow.tsx
index eb7f15bf8..e7162dd58 100644
--- a/src/renderer/components/SessionRow.tsx
+++ b/src/renderer/components/SessionRow.tsx
@@ -148,8 +148,14 @@ export function SessionRow({
{row.title}
</span>
)}
- {row.session && <span className="ss-chip">{row.session}</span>}
- <AccountChip chip={accountChip} />
+ {/* `title`, because the chip now yields to the name and can be ellipsised: a truncated
+ chip with no tooltip is the one state where the session name is unrecoverable. */}
+ {row.session && (
+ <span className="ss-chip" title={row.session}>
+ {row.session}
+ </span>
+ )}
+ <AccountChip chip={accountChip} className="ss-account" />
{row.loop && (
<span className="ss-loop">
{row.loop.kind} · {row.loop.count}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 2196df7cf..1b75e5e21 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -7911,12 +7911,28 @@ button.group-node__setup:disabled {
}
.ss-row__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
-.ss-row__titleline { display: flex; align-items: center; gap: 6px; min-width: 0; }
+.ss-row__titleline {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ min-width: 0;
+ /* The title's floor. The sidebar is 300px wide and the row already carries a status dot, a
+ monogram, a session chip, a context pill and two buttons, so the NAME is the only thing that
+ can absorb another chip — and it did: with the account chip present the title measured 45px
+ (4-5 characters) against 128px without it. Everything else in the line yields before the name
+ does. ~10 characters at 12.5px, which is what makes two similarly-named sessions
+ distinguishable. */
+ --ss-title-min: 96px;
+}
.ss-mark { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
-.ss-title { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.ss-title { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: var(--ss-title-min); }
.ss-title.is-unread { font-weight: 600; }
.ss-title-input { font-size: 12.5px; background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: 4px; padding: 1px 4px; }
-.ss-chip { font-size: 10px; color: var(--text); opacity: 0.7; background: var(--panel-header); border-radius: 4px; padding: 0 5px; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; }
+.ss-chip { font-size: 10px; color: var(--text); opacity: 0.7; background: var(--panel-header); border-radius: 4px; padding: 0 5px; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
+/* The shared account chip, sized for THIS row rather than the node header it was built for:
+ the header's 120px cap and `flex-shrink: 0` are what crushed the title here. Same scale as
+ `.ss-chip` beside it, and it yields before the name — its tooltip keeps the full label. */
+.ss-account { margin-left: 0; max-width: 5.5rem; font-size: 10px; padding: 0 5px; flex: 0 1 auto; min-width: 0; }
.ss-loop { font-size: 9.5px; color: var(--caution); border: 1px solid rgba(255, 214, 10, 0.4); border-radius: 4px; padding: 0 4px; flex: 0 0 auto; }
.ss-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); min-width: 0; }
.ss-meta__cwd { font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
diff --git a/src/renderer/styles.sidebar-row.test.ts b/src/renderer/styles.sidebar-row.test.ts
new file mode 100644
index 000000000..8c144f69e
--- /dev/null
+++ b/src/renderer/styles.sidebar-row.test.ts
@@ -0,0 +1,70 @@
+import { describe, expect, it } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+
+/**
+ * The sessions-sidebar row gives its NAME priority over the chips beside it.
+ *
+ * MEASURED in a real browser against these rules (headless Chrome, the 300px sidebar, a row
+ * carrying a session chip and the account chip): the title was **45px** — four or five characters
+ * — against 128px for the same row without the account chip, and a row with long values overflowed
+ * its own line by 44px with the title at **0**. The cause was not one number: `.ss-title` was the
+ * only shrinkable thing in the line, because `.ss-chip` was `flex: 0 0 auto` and the shared
+ * `.node-account-chip` (built for the node header, where there is room) carries `flex-shrink: 0`
+ * and a 120px cap.
+ *
+ * Every rule below is one of the three halves of the fix, and each is invisible in review: a
+ * `flex` shorthand quietly re-setting `flex-shrink` back to 0, or the sidebar's class going
+ * missing from `SessionRow`, restores the bug with nothing on screen to say so.
+ *
+ * `\r\n` is normalized for the same reason every other file-reading test here does it (see the
+ * line-endings rule in CLAUDE.md): a Windows checkout would otherwise fail these on whitespace.
+ */
+const CSS = readFileSync(join(__dirname, 'styles.css'), 'utf8').replace(/\r\n/g, '\n')
+const ROW = readFileSync(join(__dirname, 'components/SessionRow.tsx'), 'utf8').replace(/\r\n/g, '\n')
+
+/** The body of the first rule whose selector list is exactly `sel`. */
+function rule(sel: string): string {
+ const i = CSS.indexOf(`\n${sel} {`)
+ expect(i, `no rule for ${sel}`).toBeGreaterThan(-1)
+ return CSS.slice(i, CSS.indexOf('}', i))
+}
+
+describe('sessions-sidebar row: the name outranks the chips', () => {
+ it('gives the title a floor, expressed as a token on the line it belongs to', () => {
+ expect(rule('.ss-row__titleline')).toContain('--ss-title-min:')
+ const title = rule('.ss-title')
+ expect(title).toContain('min-width: var(--ss-title-min)')
+ // Grows into the free space AND may shrink — but never past the floor above.
+ expect(title).toContain('flex: 1 1 auto')
+ })
+
+ it('makes both chips yield, rather than the name', () => {
+ for (const sel of ['.ss-chip', '.ss-account']) {
+ const r = rule(sel)
+ // `0 1 auto` is the whole point: the header's `flex-shrink: 0` is what crushed the title.
+ expect(r, sel).toContain('flex: 0 1 auto')
+ // Without this a flex item's automatic minimum is its content, so it cannot actually shrink.
+ expect(r, sel).toContain('min-width: 0')
+ }
+ })
+
+ it('sizes the shared account chip for this row, overriding the node header in BOTH dimensions', () => {
+ const r = rule('.ss-account')
+ // The header's 120px cap and its 8px left margin are what this row cannot afford.
+ expect(r).toMatch(/max-width: \d/)
+ expect(r).toContain('margin-left: 0')
+ // Later in the file than `.node-account-chip`, or the equal-specificity override loses.
+ expect(CSS.indexOf('\n.ss-account {')).toBeGreaterThan(CSS.indexOf('\n.node-account-chip {'))
+ })
+
+ it('is actually applied — the row passes the sidebar class to the shared chip', () => {
+ expect(ROW).toContain('<AccountChip chip={accountChip} className="ss-account" />')
+ })
+
+ it('keeps the session chip readable once truncated, via its tooltip', () => {
+ // It can now be ellipsised, and an ellipsised chip with no tooltip is the one state where the
+ // session name is unrecoverable from the UI.
+ expect(ROW).toMatch(/className="ss-chip" title=\{row\.session\}/)
+ })
+})