Give the panel the canvas, and open a flow already fitted
Opening a node or the flow settings now takes the flowbar and the dock away, leaving the graph and the panel; they come back on close, leaving by the same slideUp they arrive with. The panel header names the flow before the node, `/heating/`, which is how messages are qualified everywhere else. Opening a flow already fitted, and pressing Fit to screen, disagreed: one used a 0.25 padding capped at 1x, the other xyflow's defaults, so the button visibly jumped and a small flow opened at 100% in an empty canvas. Both read one constant now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KkmeRiyeYmVZqJVwuyHq9o
This commit is contained in:
co-authored by
Claude Opus 5
parent
2bc9f684e8
commit
bcdc90edbb
@@ -25,6 +25,14 @@ import {
|
||||
} from "@/components/ui/tooltip"
|
||||
import { slideUp, transitions } from "@/lib/motion"
|
||||
|
||||
/**
|
||||
* What "fit" means on this canvas: the view a flow opens with, and the one the
|
||||
* fit button returns to. The generous padding keeps the graph clear of the
|
||||
* chrome floating over it, and the cap stops a two-node flow from being blown
|
||||
* up past legibility.
|
||||
*/
|
||||
export const FIT_VIEW = { padding: 0.25, maxZoom: 1.2 }
|
||||
|
||||
/**
|
||||
* The action bar, floating bottom-centre. Run is the one brand-secondary
|
||||
* affordance on this view; everything else stays quiet.
|
||||
@@ -49,6 +57,7 @@ export function FlowDock({
|
||||
variants={slideUp}
|
||||
initial="hidden"
|
||||
animate="visible"
|
||||
exit="exit"
|
||||
transition={transitions.emphasized}
|
||||
className="pointer-events-auto absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-full border border-border bg-card/80 px-1.5 py-1 shadow-e2 backdrop-blur-md pb-[max(0.25rem,env(safe-area-inset-bottom))]"
|
||||
>
|
||||
@@ -85,7 +94,7 @@ export function FlowDock({
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-11 text-muted-foreground md:size-8"
|
||||
onClick={() => fitView({ duration: 300 })}
|
||||
onClick={() => fitView({ ...FIT_VIEW, duration: 300 })}
|
||||
aria-label="Fit the flow to the screen"
|
||||
>
|
||||
<Maximize2 />
|
||||
|
||||
Reference in New Issue
Block a user