[eric] toolbar+convert: redrew chat-bubble svg + hide Convert on workflow-source sessions

This commit is contained in:
ciregenz
2026-05-22 02:14:37 -07:00
parent 4f30080e62
commit 2a5f2dfdef
2 changed files with 13 additions and 7 deletions
+11 -5
View File
@@ -296,19 +296,25 @@ const AgentCard: React.FC<Props> = ({
const hasApiKey = !!useAppSelector((s) => s.settings.data.anthropic_api_key);
const modelsByProvider = useAppSelector((s) => s.models.byProvider);
const expandedSessionIds = useAppSelector((s) => s.agents.expandedSessionIds);
// If this session is a workflow's runner (executor.execute spawned it),
// hide the "Make workflow" button per user note on Image #44; the chat
// is already inside a workflow loop, converting it back into a fresh
// workflow would be a confusing identity collapse.
// Hide the "Convert to workflow" button when this chat is already
// entangled with a workflow (Image #44 note). Two cases:
// (a) The session is one of a workflow's runner sessions, OR
// (b) The session is the source the workflow was originally derived
// from. Either way a fresh convert would just clone the workflow,
// which is confusing identity collapse.
const workflowRunsMap = useAppSelector((s) => s.workflows.runs);
const workflowItems = useAppSelector((s) => s.workflows.items);
const isWorkflowRunnerSession = useMemo(() => {
for (const arr of Object.values(workflowRunsMap || {})) {
for (const r of arr || []) {
if (r.session_id === session.id) return true;
}
}
for (const wf of Object.values(workflowItems || {})) {
if (wf.source_session_id === session.id) return true;
}
return false;
}, [workflowRunsMap, session.id]);
}, [workflowRunsMap, workflowItems, session.id]);
// Curated picker label with a tidy fallback for unknowns.
const friendlyModelLabel = useMemo(() => {
const value = session.model;
@@ -18,11 +18,11 @@ function ChatBubbleTeardrop(props: { sx?: { fontSize?: number } }) {
return (
<svg
width={size} height={size} viewBox="0 0 24 24"
fill="none" stroke="currentColor" strokeWidth={1.8}
fill="none" stroke="currentColor" strokeWidth={2}
strokeLinecap="round" strokeLinejoin="round"
style={{ display: 'block' }}
>
<path d="M12 3 a8 8 0 0 1 8 8 v0 a8 8 0 0 1 -8 8 h-2 l-3.5 3 v-3.5 a8 8 0 0 1 -2.5 -7.5 a8 8 0 0 1 8 -8 z" />
<path d="M 7 3 H 15 A 6 6 0 0 1 21 9 V 13 A 6 6 0 0 1 15 19 H 11 L 5 23 V 19 A 6 6 0 0 1 1 13 V 9 A 6 6 0 0 1 7 3 Z" />
</svg>
);
}