Yuchen Yuan commited on
Commit
4d90ed6
·
1 Parent(s): 581e2dc

Sharper visual affordance on params toggle + match desktop/mobile pane icons

Browse files

Two follow-ups from user feedback that the previous implementation
was too subtle:

* The block params toggle was a small chevron + tiny grey text — easy
to miss as something clickable. Promote it to a chip-like button:
SlidersHorizontal icon (signals 'tune'), uppercase 'PARAMS' label
in tracking-wider, current-value summary on the right, ChevronDown
that rotates on open. The whole row gets a hover background +
border, so the affordance reads even on a first glance. Open state
flips background and tints the icon accent for an obvious "active"
cue.

* Desktop's collapsed-strip used ChevronLeft / ChevronRight; mobile
TopBar uses PanelLeft / PanelRight (lucide). Switching desktop to
the same panel icons so the cue for 'open this side panel' is
identical across breakpoints. Bumped icon size from w-4 to w-5 so
it's easy to spot in the narrow 32px collapsed column.

frontend/src/App.tsx CHANGED
@@ -1,7 +1,7 @@
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
  import { ReactFlowProvider } from "@xyflow/react";
3
  import "@xyflow/react/dist/style.css";
4
- import { ChevronLeft, ChevronRight } from "lucide-react";
5
  import { api } from "./lib/api";
6
  import { useApp } from "./lib/store";
7
  import { useIsDesktop } from "./lib/useMediaQuery";
@@ -277,7 +277,12 @@ function CollapsedStrip({
277
  side: "left" | "right";
278
  onExpand: () => void;
279
  }) {
280
- const Chevron = side === "left" ? ChevronRight : ChevronLeft;
 
 
 
 
 
281
  return (
282
  <button
283
  type="button"
@@ -286,7 +291,7 @@ function CollapsedStrip({
286
  aria-label={`Expand ${label}`}
287
  className="flex flex-col items-center gap-2 py-2 px-0 w-full h-full text-mute hover:text-ink hover:bg-surfaceAlt transition-colors"
288
  >
289
- <Chevron className="w-4 h-4 shrink-0" />
290
  <span
291
  className="text-[11px] uppercase tracking-wider whitespace-nowrap select-none"
292
  style={{ writingMode: "vertical-rl" }}
 
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
  import { ReactFlowProvider } from "@xyflow/react";
3
  import "@xyflow/react/dist/style.css";
4
+ import { PanelLeft, PanelRight } from "lucide-react";
5
  import { api } from "./lib/api";
6
  import { useApp } from "./lib/store";
7
  import { useIsDesktop } from "./lib/useMediaQuery";
 
277
  side: "left" | "right";
278
  onExpand: () => void;
279
  }) {
280
+ // Use the same panel-toggle icons the mobile TopBar uses for its
281
+ // drawer toggles, so the visual cue for "open this side panel" is
282
+ // consistent across breakpoints. PanelLeft = left edge highlight;
283
+ // PanelRight = right edge highlight — picks the one that points
284
+ // *toward* the pane that's about to slide open.
285
+ const Icon = side === "left" ? PanelLeft : PanelRight;
286
  return (
287
  <button
288
  type="button"
 
291
  aria-label={`Expand ${label}`}
292
  className="flex flex-col items-center gap-2 py-2 px-0 w-full h-full text-mute hover:text-ink hover:bg-surfaceAlt transition-colors"
293
  >
294
+ <Icon className="w-5 h-5 shrink-0" strokeWidth={1.8} />
295
  <span
296
  className="text-[11px] uppercase tracking-wider whitespace-nowrap select-none"
297
  style={{ writingMode: "vertical-rl" }}
frontend/src/components/QNode.tsx CHANGED
@@ -1,6 +1,12 @@
1
  import { Handle, Position, useReactFlow, type NodeProps } from "@xyflow/react";
2
  import { useState } from "react";
3
- import { AlertTriangle, ChevronDown, FileText, X } from "lucide-react";
 
 
 
 
 
 
4
  import {
5
  NODE_BY_KIND,
6
  type NodeKind,
@@ -132,9 +138,13 @@ export function QNode({ id, data, selected }: NodeProps) {
132
  )}
133
 
134
  {/* Editable params (schema-driven) start collapsed so the block
135
- stays compact on a busy canvas. Header row shows a one-line
136
- summary of the current values; click to expand the full
137
- editor. Other node kinds fall back to the static read-out. */}
 
 
 
 
138
  {spec.params && spec.params.length > 0 ? (
139
  <div className="mt-2 pt-2 border-t border-edge/60">
140
  <button
@@ -147,20 +157,30 @@ export function QNode({ id, data, selected }: NodeProps) {
147
  aria-label={
148
  paramsOpen ? "Hide parameters" : "Show parameters"
149
  }
150
- className="nodrag w-full flex items-center gap-1.5 text-[10px] text-mute hover:text-ink transition-colors"
 
 
 
 
151
  >
 
 
 
 
 
 
 
 
 
 
 
 
152
  <ChevronDown
153
  className={`w-3 h-3 shrink-0 transition-transform ${
154
- paramsOpen ? "rotate-0" : "-rotate-90"
155
  }`}
156
  strokeWidth={2.5}
157
  />
158
- <span className="shrink-0">params</span>
159
- {!paramsOpen && (
160
- <span className="font-mono text-ink truncate text-[10px]">
161
- {summariseParams(spec.params, d.params ?? {})}
162
- </span>
163
- )}
164
  </button>
165
  {paramsOpen && (
166
  <NodeParamEditor
 
1
  import { Handle, Position, useReactFlow, type NodeProps } from "@xyflow/react";
2
  import { useState } from "react";
3
+ import {
4
+ AlertTriangle,
5
+ ChevronDown,
6
+ FileText,
7
+ SlidersHorizontal,
8
+ X,
9
+ } from "lucide-react";
10
  import {
11
  NODE_BY_KIND,
12
  type NodeKind,
 
138
  )}
139
 
140
  {/* Editable params (schema-driven) start collapsed so the block
141
+ stays compact on a busy canvas. Header row is a chip-like
142
+ button so it reads as obviously clickable: SlidersHorizontal
143
+ icon + uppercase "PARAMS" label, current-value summary on
144
+ the right, ChevronDown that rotates on toggle. The whole row
145
+ gets a hover background + border so newcomers see the
146
+ affordance without needing to hover over the chevron. Other
147
+ node kinds fall back to the static read-out. */}
148
  {spec.params && spec.params.length > 0 ? (
149
  <div className="mt-2 pt-2 border-t border-edge/60">
150
  <button
 
157
  aria-label={
158
  paramsOpen ? "Hide parameters" : "Show parameters"
159
  }
160
+ className={`nodrag w-full flex items-center gap-1.5 px-1.5 py-1 -mx-0.5 rounded-md border text-[10px] transition-colors ${
161
+ paramsOpen
162
+ ? "border-edge bg-surfaceAlt text-ink"
163
+ : "border-transparent text-mute hover:text-ink hover:border-edge/60 hover:bg-surfaceAlt"
164
+ }`}
165
  >
166
+ <SlidersHorizontal
167
+ className={`w-3 h-3 shrink-0 ${
168
+ paramsOpen ? "text-accent" : ""
169
+ }`}
170
+ strokeWidth={2.2}
171
+ />
172
+ <span className="shrink-0 uppercase tracking-wider font-medium">
173
+ params
174
+ </span>
175
+ <span className="font-mono text-ink truncate flex-1 text-right">
176
+ {!paramsOpen && summariseParams(spec.params, d.params ?? {})}
177
+ </span>
178
  <ChevronDown
179
  className={`w-3 h-3 shrink-0 transition-transform ${
180
+ paramsOpen ? "rotate-180" : "rotate-0"
181
  }`}
182
  strokeWidth={2.5}
183
  />
 
 
 
 
 
 
184
  </button>
185
  {paramsOpen && (
186
  <NodeParamEditor