mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-13 21:27:41 +02:00
[eric] canvas: a collapsed chat's browser is parked or a 320px miniature at EVERY stage (drag/resize/capture included), and the attachment never casts a shadow
This commit is contained in:
@@ -1175,8 +1175,11 @@ const BrowserCard: React.FC<Props> = ({
|
||||
// leaves it behind. An agent-driven browser skips the park (above), so it painted itself over
|
||||
// wherever the chat USED to be, sometimes exactly on the chat's own header, where a press grabs the
|
||||
// browser and drags that instead of the chat. Follow the parent's live rect while it is collapsed.
|
||||
// NO exclusions for dragging/resize/capture-wait: any gap here rendered the FULL-SIZE card
|
||||
// halfway up the pill during transient states (thinking, mid-capture, mid-drag; Eric's shots x3).
|
||||
// Collapsed parent = parked or 320px miniature, at every stage, no third state.
|
||||
const followsParent = !!dockedTo && !!dockParentCard && !dockParentExpanded && !dockParked
|
||||
&& !dragging && !localResize && !isTiled && !isMinimized && !keepAliveHidden;
|
||||
&& !isTiled && !isMinimized && !keepAliveHidden;
|
||||
// Tell the pill a live miniature is underneath it, so it suppresses its own artifacts instead of
|
||||
// stacking a widget/frozen shot on top of the browser (Eric's overlap screenshots).
|
||||
useEffect(() => {
|
||||
@@ -1269,12 +1272,12 @@ const BrowserCard: React.FC<Props> = ({
|
||||
// Docked = a TRUE miniature: the card keeps its full-size layout and shrinks by uniform
|
||||
// transform (centered in the slot), so the page never reflows and agent clicks stay valid.
|
||||
// Resizing the webview to the slot re-rendered the page as a narrow window, which is wrong.
|
||||
left: keepAliveHidden || isMinimized || dockParked ? -100000 : (dockActive ? dockRect!.x + (dockRect!.w - displayW * Math.min(dockRect!.w / displayW, dockRect!.h / displayH)) / 2 : (dragging ? cardX : (followX ?? displayX))),
|
||||
top: dockActive ? dockRect!.y + (dockRect!.h - displayH * Math.min(dockRect!.w / displayW, dockRect!.h / displayH)) / 2 : (dragging ? cardY : (followY ?? displayY)),
|
||||
left: keepAliveHidden || isMinimized || dockParked ? -100000 : (dockActive ? dockRect!.x + (dockRect!.w - displayW * Math.min(dockRect!.w / displayW, dockRect!.h / displayH)) / 2 : (followX ?? (dragging ? cardX : displayX))),
|
||||
top: dockActive ? dockRect!.y + (dockRect!.h - displayH * Math.min(dockRect!.w / displayW, dockRect!.h / displayH)) / 2 : (followY ?? (dragging ? cardY : displayY)),
|
||||
// Following a collapsed pill = a TRUE 320px miniature (uniform scale, no reflow, agent
|
||||
// coordinates stay valid), the same contract as the in-chat dock; full-size beside a pill
|
||||
// read as a detached window and buried the pill (Eric's 1.7.7 comparison).
|
||||
transform: tiledSize ? undefined : (dragging ? `translate3d(${dragTx}px, ${dragTy}px, 0)` : dockActive ? `scale(${Math.min(dockRect!.w / displayW, dockRect!.h / displayH)})` : followsParent ? `scale(${Math.min(1, 320 / displayW)})` : undefined),
|
||||
transform: tiledSize ? undefined : (dragging ? `translate3d(${dragTx}px, ${dragTy}px, 0)${followsParent ? ` scale(${Math.min(1, 320 / displayW)})` : ''}` : dockActive ? `scale(${Math.min(dockRect!.w / displayW, dockRect!.h / displayH)})` : followsParent ? `scale(${Math.min(1, 320 / displayW)})` : undefined),
|
||||
transformOrigin: tiledSize || dockActive || followsParent ? '0 0' : undefined,
|
||||
width: tiledSize ? tiledSize.width : displayW,
|
||||
height: tiledSize ? tiledSize.height : displayH,
|
||||
|
||||
@@ -171,7 +171,7 @@ function AgentNarratorPill({ label, running, todos, liveSteps, artifact, askPair
|
||||
component="img"
|
||||
src={browserShot}
|
||||
alt=""
|
||||
sx={{ width: 320, display: 'block', borderRadius: '12px', boxShadow: '0 10px 30px rgba(0,0,0,0.35)' }}
|
||||
sx={{ width: 320, display: 'block', borderRadius: '12px' }}
|
||||
/>
|
||||
) : visibleTodos.length > 0 ? (
|
||||
<Box
|
||||
|
||||
Reference in New Issue
Block a user