Browse Source

fix: move batch and auto-route buttons inline with split row

Removes the absolute-positioned header div and places the buttons
in the same flex row as the Split select, preventing overlap at
narrow widths and ensuring vertical alignment.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
259c2a39ab
  1. 31
      src/components/nodes/ArrayNode.tsx

31
src/components/nodes/ArrayNode.tsx

@ -226,8 +226,18 @@ export function ArrayNode({ id, data, selected }: NodeProps<ArrayNodeType>) {
{/* Single text output point (each outgoing edge receives a separate item) */}
<Handle type="source" position={Position.Right} id="text" data-handletype="text" style={{ top: 48 }} />
{/* Header buttons - floating absolute positioned */}
<div className="absolute top-2 right-2 z-10 flex items-center gap-1">
<div className="flex flex-col gap-2 pt-3 flex-1 min-h-0">
<div className="flex items-center gap-2">
<label className="shrink-0 text-[11px] text-neutral-400">Split</label>
<select
value={nodeData.splitMode}
onChange={handleBasicModeChange}
className="nodrag nopan flex-1 min-w-0 text-[11px] py-1 px-2 bg-[#1a1a1a] rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-600 text-white"
>
<option value="delimiter">Delimiter</option>
<option value="newline">Newline</option>
<option value="regex">Regex (Advanced)</option>
</select>
{/* Batch mode toggle */}
<button
type="button"
@ -241,14 +251,13 @@ export function ArrayNode({ id, data, selected }: NodeProps<ArrayNodeType>) {
>
Batch
</button>
{/* Auto-route button (hidden in batch mode) */}
{!nodeData.batchMode && (
<button
type="button"
onClick={handleAutoRouteToPrompts}
disabled={previewItems.length === 0}
className="nodrag nopan shrink-0 py-1 px-2 bg-[#1a1a1a] rounded-md text-neutral-400 hover:text-neutral-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
className="nodrag nopan shrink-0 py-1 px-1.5 bg-[#1a1a1a] rounded-md text-neutral-400 hover:text-neutral-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
title="Auto-route to Prompts"
>
<svg className="w-3.5 h-3.5 rotate-90" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round">
@ -261,20 +270,6 @@ export function ArrayNode({ id, data, selected }: NodeProps<ArrayNodeType>) {
)}
</div>
<div className="flex flex-col gap-2 pt-3 flex-1 min-h-0">
<div className="flex items-center gap-2 max-w-[75%]">
<label className="shrink-0 text-[11px] text-neutral-400">Split</label>
<select
value={nodeData.splitMode}
onChange={handleBasicModeChange}
className="nodrag nopan flex-1 min-w-0 text-[11px] py-1 px-2 bg-[#1a1a1a] rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-600 text-white"
>
<option value="delimiter">Delimiter</option>
<option value="newline">Newline</option>
<option value="regex">Regex (Advanced)</option>
</select>
</div>
{nodeData.splitMode === "delimiter" && (
<div className="flex items-center gap-2 max-w-[75%]">
<label className="shrink-0 text-[11px] text-neutral-400">By</label>

Loading…
Cancel
Save