From 511ee3be4e8cd2a441357e96cd70d2fd34f1f5c4 Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Mon, 31 Aug 2026 15:31:00 +0100 Subject: [PATCH] fix(maestro): show tool icon in attach header instead of raw command Session header used to print the raw command line ("claude"); mirror the sidebar's icon-for-program treatment so both agree. Co-Authored-By: Claude Sonnet 5 --- web/src/attach.ts | 14 +++++++++++--- web/src/styles.css | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web/src/attach.ts b/web/src/attach.ts index 57a96d6..22ae5c3 100644 --- a/web/src/attach.ts +++ b/web/src/attach.ts @@ -6,6 +6,7 @@ import { attachWsUrl } from "./routes.js"; import { escapeHtml } from "./html.js"; import { INITIAL_RECONNECT_MS, MAX_RECONNECT_MS } from "./reconnect.js"; import { applyModsToChar, cursorSeq } from "./keys.js"; +import { splitCommand, toolIconSvg } from "./toolIcon.js"; import type { ClientControl, Uuid } from "./types.js"; /** @@ -54,6 +55,15 @@ export interface AttachInfo { command: string; } +/** Header echoes the sidebar: the command's leading program becomes its tool + * icon when we have a mark for it, remaining words stay as text. */ +function commandFragment(command: string): string { + const { tool, rest } = splitCommand(command); + const icon = tool ? toolIconSvg(tool) : null; + const text = icon ? rest : command; + return `${icon ?? ""}${text ? escapeHtml(text) : ""}`; +} + export function createAttachConnection( sessionId: Uuid, opts: AttachOptions = {}, @@ -65,9 +75,7 @@ export function createAttachConnection( // tooltip for when you really need it. const titleHtml = info ? `${escapeHtml(info.name)}` + - (info.command && info.command !== info.name - ? `${escapeHtml(info.command)}` - : "") + (info.command && info.command !== info.name ? commandFragment(info.command) : "") : `session ${escapeHtml(sessionId.slice(0, 8))}`; const titleAttr = info ? `${info.name} ยท ${info.command} (${sessionId})` : sessionId; el.innerHTML = ` diff --git a/web/src/styles.css b/web/src/styles.css index f6ebced..c97d6b0 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -1279,6 +1279,9 @@ input.leaf-rename:focus { .attach-title .at-cmd { color: var(--muted); + display: inline-flex; + align-items: center; + gap: 4px; } .attach-title .at-cmd::before {