Give the pulse its own duration, and let the editor fill the screen
The shared duration tokens had been stretched to slow the pulses down, which also slowed every panel and dock animation and left `motion.ts` out of step with the CSS. Both are back to 200/300 ms, and the pulses use a new `--duration-pulse` (500 ms): a message arriving is a signal, not a state change, and it is the only thing here that should linger. The edge pulse read its own 300 ms constant, so it now takes the token through `motion.ts` and the two sides cannot drift again. The code editor also expands: the same node panel fills the content region beside the sidebar, the canvas chrome steps aside rather than floating on top, and the settings above the editor keep a readable width. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WzrvW7rjQbynnhF6pxh6i
This commit is contained in:
co-authored by
Claude Fable 5
parent
f05831b4a5
commit
aa0e760615
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { X } from "lucide-react"
|
||||
import { Maximize2, Minimize2, X } from "lucide-react"
|
||||
import { lazy, Suspense, useEffect, useRef, useState } from "react"
|
||||
|
||||
import type { DType, MessageSpec, NodeDef_Input, NodeTypeInfo } from "@/client"
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select"
|
||||
import { Switch } from "@/components/ui/switch"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { nodeSourceQueryOptions } from "./queries"
|
||||
import { PANEL_SECTION, SidePanel } from "./SidePanel"
|
||||
|
||||
@@ -276,15 +277,19 @@ function PanelBody({
|
||||
flow,
|
||||
nodeType,
|
||||
suggestions,
|
||||
expanded,
|
||||
onChange,
|
||||
onSaveSource,
|
||||
onToggleExpand,
|
||||
}: {
|
||||
node: NodeDef_Input
|
||||
flow: string
|
||||
nodeType: NodeTypeInfo | undefined
|
||||
suggestions: PortSuggestions
|
||||
expanded: boolean
|
||||
onChange: (next: NodeDef_Input) => void
|
||||
onSaveSource: (code: string) => void
|
||||
onToggleExpand: () => void
|
||||
}) {
|
||||
const hasSource = nodeType?.has_source ?? node.type === "python"
|
||||
const { data: source } = useQuery({
|
||||
@@ -320,7 +325,7 @@ function PanelBody({
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid gap-5 p-4">
|
||||
<div className={cn("grid gap-5 p-4", expanded && "max-w-2xl")}>
|
||||
<PortList
|
||||
title="Consumes"
|
||||
specs={node.requires ?? []}
|
||||
@@ -346,7 +351,21 @@ function PanelBody({
|
||||
|
||||
{hasSource ? (
|
||||
<div className="flex min-h-[280px] flex-1 flex-col gap-2 px-4 pb-4">
|
||||
<span className={SECTION}>Code</span>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className={SECTION}>Code</span>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
className="hidden text-muted-foreground md:inline-flex"
|
||||
onClick={onToggleExpand}
|
||||
aria-label={
|
||||
expanded ? "Collapse the editor" : "Expand the editor"
|
||||
}
|
||||
data-testid="toggle-editor-size"
|
||||
>
|
||||
{expanded ? <Minimize2 /> : <Maximize2 />}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="min-h-0 flex-1 overflow-hidden rounded-md border border-border">
|
||||
<Suspense
|
||||
fallback={
|
||||
@@ -377,8 +396,10 @@ export function NodePanel({
|
||||
flow,
|
||||
nodeTypes,
|
||||
suggestions,
|
||||
expanded,
|
||||
onChange,
|
||||
onSaveSource,
|
||||
onToggleExpand,
|
||||
onClose,
|
||||
onDelete,
|
||||
}: {
|
||||
@@ -386,8 +407,10 @@ export function NodePanel({
|
||||
flow: string
|
||||
nodeTypes: NodeTypeInfo[]
|
||||
suggestions: PortSuggestions
|
||||
expanded: boolean
|
||||
onChange: (next: NodeDef_Input) => void
|
||||
onSaveSource: (code: string) => void
|
||||
onToggleExpand: () => void
|
||||
onClose: () => void
|
||||
onDelete: () => void
|
||||
}) {
|
||||
@@ -399,6 +422,7 @@ export function NodePanel({
|
||||
label="Node settings"
|
||||
testId="node-panel"
|
||||
bodyKey={node?.id ?? "none"}
|
||||
expanded={expanded}
|
||||
onClose={onClose}
|
||||
header={
|
||||
node ? (
|
||||
@@ -429,8 +453,10 @@ export function NodePanel({
|
||||
flow={flow}
|
||||
nodeType={nodeType}
|
||||
suggestions={suggestions}
|
||||
expanded={expanded}
|
||||
onChange={onChange}
|
||||
onSaveSource={onSaveSource}
|
||||
onToggleExpand={onToggleExpand}
|
||||
/>
|
||||
) : null}
|
||||
</SidePanel>
|
||||
|
||||
Reference in New Issue
Block a user