mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-10 03:37:44 +02:00
[eric] menus: transcript right-clicks get the text menu not Delete-chat, the lying Cmd+M chip dies, Close drops its false danger
This commit is contained in:
@@ -1604,6 +1604,8 @@ const AgentChat: React.FC<AgentChatProps> = ({ sessionId: sessionIdProp, onClose
|
||||
<Box
|
||||
ref={scrollContainerRef}
|
||||
onScroll={handleScroll}
|
||||
// Right-clicking transcript CONTENT gets the OS text menu (copy, spellcheck), never the card menu with Delete chat in it.
|
||||
data-chat-transcript
|
||||
sx={{
|
||||
height: '100%',
|
||||
overflow: 'auto',
|
||||
|
||||
@@ -23,7 +23,8 @@ export function canvasMenuRows({
|
||||
{ kind: 'header', label: 'New' },
|
||||
{ label: 'New chat', onClick: onNewAgent },
|
||||
{ label: 'New browser', shortcut: chord('mod', 'N'), onClick: onAddBrowser },
|
||||
{ label: 'Add app', shortcut: chord('mod', 'M'), onClick: onApplications },
|
||||
// No shortcut chip: the real Cmd+M opens the toolbar view picker, not this Applications window; a lying chip is worse than none.
|
||||
{ label: 'Add app', onClick: onApplications },
|
||||
{ kind: 'separator' },
|
||||
{ label: 'Paste', shortcut: chord('mod', 'V'), disabled: getClipboardCards().length === 0, onClick: onPaste },
|
||||
{ label: 'Reopen last closed', shortcut: chord('mod', 'shift', 'T'), onClick: () => { void dispatch(reopenLastClosed()); } },
|
||||
|
||||
@@ -820,7 +820,7 @@ const AgentCard: React.FC<Props> = ({
|
||||
e.stopPropagation();
|
||||
onDoubleClick?.(session.id, 'agent');
|
||||
}}
|
||||
onContextMenu={(e: React.MouseEvent) => { if (isNativeMenuTarget(e)) return; openCardContextMenu(e, {
|
||||
onContextMenu={(e: React.MouseEvent) => { if (isNativeMenuTarget(e)) return; if ((e.target as HTMLElement).closest?.('[data-chat-transcript]')) return; openCardContextMenu(e, {
|
||||
rename: { value: displayChatTitle(session), onCommit: (name) => dispatch(renameSession({ sessionId: session.id, name })) },
|
||||
items: agentCardMenuRows({
|
||||
session, dispatch, expanded, tileZone, expandedSessionIds,
|
||||
|
||||
@@ -62,7 +62,8 @@ export function browserCardMenuRows({
|
||||
}]),
|
||||
},
|
||||
{ kind: 'separator' },
|
||||
{ label: 'Close', danger: true, onClick: () => closeBrowserCard(browserId, dispatch) },
|
||||
// Close is recoverable (Cmd+Shift+T reopens); danger styling is reserved for true deletes, matching the agent and app cards.
|
||||
{ label: 'Close', onClick: () => closeBrowserCard(browserId, dispatch) },
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user