fix(chat): renamed run's title collapses to ~3 chars beside a giant raw-identity string #120

Closed
opened 2026-07-10 21:14:13 +02:00 by dominik.polakovics · 1 comment

Symptom

Rename a run in the chat header (issue #111 inline rename, commit bde4077) on a session that was spawned without a label: the header shows ~3 characters of the new title followed by a big muted timestring, e.g.

My c… 20260710-1545 · coding-lab~20260710-1545

Root cause (two independent defects)

  1. Flex space war. button.chat-title lays out two flex children — .chat-title-text (the custom title) and .chat-title-raw (the raw identity). Both have min-width: 0; flex: 0 1 auto, so flexbox distributes the available width proportionally to natural content width. The raw identity string is far longer than the title, so it wins ~80% of a container already capped at 40% of the header (desktop) / squeezed by chips (mobile). The primary title ellipsizes down to a few characters.
  2. Doubled identity. rawIdentity() in RunChat.tsx renders ${sessionLabel(session_name)} · ${session_name} — but the session name is <repo>~<label>, so the label appears twice. For an unlabelled spawn that's the timestamp twice: 20260710-1545 · coding-lab~20260710-1545.

Agreed design (grill 2026-07-10)

Unify the header title layout for both titled and untitled runs — one code path:

  • Primary (bold, .chat-title-text): the display title — custom title if set, else instanceTitle(sessionLabel(session_name)) (e.g. grill · 10:18), else branch. Same chain as runDisplayTitle(); reuse it.
  • Secondary (muted): the project name (sessionRepo(session_name), fall back to nothing when empty/legacy). Replaces both today's repo · bold prefix in the generated title and the .chat-title-raw label·session string.
  • Title always wins the space: the secondary span must shrink to zero before the primary gives up a pixel (e.g. a large flex-shrink weight on the secondary span, keeping min-width: 0 + ellipsis on both). No media query needed — on narrow screens the project naturally collapses away.
  • Raw session identity moves to the tooltip: the title button's title attribute carries the exact session name (coding-lab~grill-20260710-1018) so the tmux/branch/worktree correlation from ADR-0040 stays reachable. The inline label · session string is dropped entirely.

Implementation notes

  • web/src/routes/RunChat.tsx ChatHeader: generatedTitle() loses its repo · prefix (primary text only); add a project() accessor; rawIdentity() goes away; tooltip = session name (keep the aria-label="Rename: …").
  • Edit-mode placeholder should be the new repo-less generated title.
  • web/src/base.css: rename/replace .chat-title-raw styling with the shrink-first secondary span.
  • Rail (SideNav.tsx) and History already render only runDisplayTitle — no change there.
  • Update RunChat.test.tsx header expectations (titled + untitled + legacy no-~ session).
  • ADR-0040 gets a short amendment note: identity correlation lives in the tooltip, project is the inline secondary.

Acceptance

  • Untitled session header: bold grill · 10:18, muted coding-lab after it; narrow viewport shows the full bold part, project collapses first.
  • Renamed session header: bold custom title, muted coding-lab; hovering the title shows coding-lab~grill-20260710-1018.
  • A 120-char custom title still ellipsizes inside the 40%/mobile cap; it never yields space to the project span.
## Symptom Rename a run in the chat header (issue #111 inline rename, commit bde4077) on a session that was spawned **without a label**: the header shows ~3 characters of the new title followed by a big muted timestring, e.g. > **My c…** *20260710-1545 · coding-lab~20260710-1545* ## Root cause (two independent defects) 1. **Flex space war.** `button.chat-title` lays out two flex children — `.chat-title-text` (the custom title) and `.chat-title-raw` (the raw identity). Both have `min-width: 0; flex: 0 1 auto`, so flexbox distributes the available width *proportionally to natural content width*. The raw identity string is far longer than the title, so it wins ~80% of a container already capped at 40% of the header (desktop) / squeezed by chips (mobile). The primary title ellipsizes down to a few characters. 2. **Doubled identity.** `rawIdentity()` in `RunChat.tsx` renders `${sessionLabel(session_name)} · ${session_name}` — but the session name is `<repo>~<label>`, so the label appears **twice**. For an unlabelled spawn that's the timestamp twice: `20260710-1545 · coding-lab~20260710-1545`. ## Agreed design (grill 2026-07-10) Unify the header title layout for **both** titled and untitled runs — one code path: - **Primary (bold, `.chat-title-text`)**: the display title — custom `title` if set, else `instanceTitle(sessionLabel(session_name))` (e.g. `grill · 10:18`), else `branch`. Same chain as `runDisplayTitle()`; reuse it. - **Secondary (muted)**: the **project name** (`sessionRepo(session_name)`, fall back to nothing when empty/legacy). Replaces both today's `repo · ` bold prefix in the generated title and the `.chat-title-raw` label·session string. - **Title always wins the space**: the secondary span must shrink to zero before the primary gives up a pixel (e.g. a large `flex-shrink` weight on the secondary span, keeping `min-width: 0` + ellipsis on both). No media query needed — on narrow screens the project naturally collapses away. - **Raw session identity moves to the tooltip**: the title button's `title` attribute carries the exact session name (`coding-lab~grill-20260710-1018`) so the tmux/branch/worktree correlation from ADR-0040 stays reachable. The inline `label · session` string is dropped entirely. ## Implementation notes - `web/src/routes/RunChat.tsx` ChatHeader: `generatedTitle()` loses its `repo · ` prefix (primary text only); add a `project()` accessor; `rawIdentity()` goes away; tooltip = session name (keep the `aria-label="Rename: …"`). - Edit-mode `placeholder` should be the new repo-less generated title. - `web/src/base.css`: rename/replace `.chat-title-raw` styling with the shrink-first secondary span. - Rail (`SideNav.tsx`) and History already render only `runDisplayTitle` — no change there. - Update `RunChat.test.tsx` header expectations (titled + untitled + legacy no-`~` session). - ADR-0040 gets a short amendment note: identity correlation lives in the tooltip, project is the inline secondary. ## Acceptance - Untitled session header: bold `grill · 10:18`, muted `coding-lab` after it; narrow viewport shows the full bold part, project collapses first. - Renamed session header: bold custom title, muted `coding-lab`; hovering the title shows `coding-lab~grill-20260710-1018`. - A 120-char custom title still ellipsizes inside the 40%/mobile cap; it never yields space to the project span.
Author
Owner

This was generated by AI while landing a PR.

Landing audit — PR #121PASS

  • CI: ci / native success (5m10s, run #127) — relied on, not re-run.
  • Title: Conventional Commits (fix(chat): …) ✓
  • AFK contract: head afk/120, body carries working Closes #120
  • Diff review (4 files, +55/−41): header title now flows through the shared runDisplayTitle fallback (custom → parsed label → branch), matching Rail/History; project name (sessionRepo) rides as muted secondary text with flex: 0 100000 auto so it collapses before the title yields; full session name moved to the button tooltip (ADR-0040 correlation preserved and its Status amended). Verified helper behaviour: sessionRepo returns '' for legacy no-~ names, hiding the span — covered by a new test. Tests updated for titled/untitled/reset/legacy cases.

No blockers. Awaiting free-text merge go-ahead.

> *This was generated by AI while landing a PR.* **Landing audit — PR #121 → `PASS`** - **CI**: `ci / native` **success** (5m10s, run #127) — relied on, not re-run. - **Title**: Conventional Commits (`fix(chat): …`) ✓ - **AFK contract**: head `afk/120`, body carries working `Closes #120` ✓ - **Diff review** (4 files, +55/−41): header title now flows through the shared `runDisplayTitle` fallback (custom → parsed label → branch), matching Rail/History; project name (`sessionRepo`) rides as muted secondary text with `flex: 0 100000 auto` so it collapses before the title yields; full session name moved to the button tooltip (ADR-0040 correlation preserved and its Status amended). Verified helper behaviour: `sessionRepo` returns `''` for legacy no-`~` names, hiding the span — covered by a new test. Tests updated for titled/untitled/reset/legacy cases. No blockers. Awaiting free-text merge go-ahead.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/coding-lab#120
No description provided.