The React port replaced CSS class names with Tailwind utilities, breaking three visual contracts: - SessionCard used inline bg-* classes instead of .is-active/.is-open/ .is-previewing that the styles.css cascade targets. - PaneTitle used className "at-title" instead of "attach-title", so font, overflow, and child layout rules never applied. - MultiView's Pane never applied .is-focused or .is-preview, so every pane matched :not(.is-focused) and was dimmed to 0.45 opacity. Closes #256 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
// React port of paneTitle.ts: a pane header's session identity — the name,
|
|
// then the command as its tool mark when recognised, same as the sidebar
|
|
// card's own CommandFragment (SessionCard.tsx). JSX escapes text nodes, so
|
|
// unlike the vanilla string-builder this needs no manual HTML escaping.
|
|
|
|
import { splitCommand, toolIconSvg } from "../../toolIcon.js";
|
|
import { sessionName, type Session, type Uuid } from "../../types.js";
|
|
|
|
export interface PaneTitleProps {
|
|
sessionId: Uuid;
|
|
session?: Session;
|
|
className?: string;
|
|
}
|
|
|
|
export function PaneTitle({ sessionId, session, className }: PaneTitleProps) {
|
|
if (!session) {
|
|
return (
|
|
<span className={className ?? "attach-title"} title={sessionId}>
|
|
session <span className="sid">{sessionId.slice(0, 8)}</span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
const name = sessionName(session);
|
|
const showCommand = Boolean(session.command) && session.command !== name;
|
|
const { tool, program } = splitCommand(session.command);
|
|
const icon = tool ? toolIconSvg(tool) : null;
|
|
|
|
return (
|
|
<span className={className ?? "attach-title"} title={`${name} · ${session.command} (${sessionId})`}>
|
|
<span className="at-name">{name}</span>
|
|
{showCommand && (
|
|
<span className="at-cmd">
|
|
{icon ? <span className="contents" dangerouslySetInnerHTML={{ __html: icon }} /> : <span>{program}</span>}
|
|
</span>
|
|
)}
|
|
</span>
|
|
);
|
|
}
|