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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
d8d26d181a
commit
511ee3be4e
+11
-3
@@ -6,6 +6,7 @@ import { attachWsUrl } from "./routes.js";
|
|||||||
import { escapeHtml } from "./html.js";
|
import { escapeHtml } from "./html.js";
|
||||||
import { INITIAL_RECONNECT_MS, MAX_RECONNECT_MS } from "./reconnect.js";
|
import { INITIAL_RECONNECT_MS, MAX_RECONNECT_MS } from "./reconnect.js";
|
||||||
import { applyModsToChar, cursorSeq } from "./keys.js";
|
import { applyModsToChar, cursorSeq } from "./keys.js";
|
||||||
|
import { splitCommand, toolIconSvg } from "./toolIcon.js";
|
||||||
import type { ClientControl, Uuid } from "./types.js";
|
import type { ClientControl, Uuid } from "./types.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,6 +55,15 @@ export interface AttachInfo {
|
|||||||
command: string;
|
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 `<span class="at-cmd">${icon ?? ""}${text ? escapeHtml(text) : ""}</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
export function createAttachConnection(
|
export function createAttachConnection(
|
||||||
sessionId: Uuid,
|
sessionId: Uuid,
|
||||||
opts: AttachOptions = {},
|
opts: AttachOptions = {},
|
||||||
@@ -65,9 +75,7 @@ export function createAttachConnection(
|
|||||||
// tooltip for when you really need it.
|
// tooltip for when you really need it.
|
||||||
const titleHtml = info
|
const titleHtml = info
|
||||||
? `<span class="at-name">${escapeHtml(info.name)}</span>` +
|
? `<span class="at-name">${escapeHtml(info.name)}</span>` +
|
||||||
(info.command && info.command !== info.name
|
(info.command && info.command !== info.name ? commandFragment(info.command) : "")
|
||||||
? `<span class="at-cmd">${escapeHtml(info.command)}</span>`
|
|
||||||
: "")
|
|
||||||
: `session <span class="sid">${escapeHtml(sessionId.slice(0, 8))}</span>`;
|
: `session <span class="sid">${escapeHtml(sessionId.slice(0, 8))}</span>`;
|
||||||
const titleAttr = info ? `${info.name} · ${info.command} (${sessionId})` : sessionId;
|
const titleAttr = info ? `${info.name} · ${info.command} (${sessionId})` : sessionId;
|
||||||
el.innerHTML = `
|
el.innerHTML = `
|
||||||
|
|||||||
@@ -1279,6 +1279,9 @@ input.leaf-rename:focus {
|
|||||||
|
|
||||||
.attach-title .at-cmd {
|
.attach-title .at-cmd {
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attach-title .at-cmd::before {
|
.attach-title .at-cmd::before {
|
||||||
|
|||||||
Reference in New Issue
Block a user