Skip to content

Commit 910da6b

Browse files
committed
ui updates
1 parent 9b15825 commit 910da6b

29 files changed

+1552
-575
lines changed

pagenodes2.png

238 KB
Loading

src/App.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,28 @@
5151

5252
.sidebar-tab {
5353
flex: 1;
54-
padding: 8px 12px;
54+
padding: 10px 12px;
5555
font-size: 12px;
5656
font-weight: 500;
5757
border: none;
58-
background: transparent;
58+
background: linear-gradient(to bottom, #3a3a3a 0%, #2d2d2d 100%);
5959
color: var(--text-muted);
6060
cursor: pointer;
6161
border-bottom: 2px solid transparent;
6262
transition: all 0.15s ease;
63+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
6364
}
6465

6566
.sidebar-tab:hover {
6667
color: var(--text-color);
67-
background: rgba(255, 255, 255, 0.05);
68+
background: linear-gradient(to bottom, #454545 0%, #3a3a3a 100%);
6869
}
6970

7071
.sidebar-tab.active {
7172
color: var(--text-color);
73+
background: linear-gradient(to bottom, #4a4a4a 0%, #3d3d3d 100%);
7274
border-bottom-color: var(--accent-color);
75+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
7376
}
7477

7578
.tab-badge {

src/App.jsx

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { NodeEditor } from './components/Editor';
1111
import { DebugPanel } from './components/Debug';
1212
import { InfoPanel } from './components/Info';
1313
import { CanvasPanel } from './components/Canvases/CanvasPanel';
14-
import { ButtonsPanel } from './components/Buttons';
1514
import { generateId } from './utils/id';
1615
import { storage } from './utils/storage';
1716
import { nodeRegistry } from './nodes';
@@ -27,7 +26,7 @@ function AppContent() {
2726
const { state: editor, dispatch: editorDispatch } = useEditor();
2827
const { dispatch: flowDispatch } = useFlows();
2928
const { messages, downloads } = useDebug();
30-
const { inject: runtimeInject, callMainThread, isRunning, isReady, deploy, hasCanvasNodes, hasButtonsNodes } = useRuntime();
29+
const { inject: runtimeInject, callMainThread, isRunning, isReady, deploy, hasCanvasNodes, emitNodeEvent } = useRuntime();
3130
const { state: flowState } = useFlows();
3231
const { addNode, deleteSelected, nodes } = useNodes();
3332

@@ -274,8 +273,31 @@ function AppContent() {
274273
}
275274
}, [isRunning, callMainThread]);
276275

277-
// Get undo/redo from flow context
278-
const { undo, redo, canUndo, canRedo } = useFlows();
276+
// Get undo/redo and runtime update from flow context
277+
const { undo, redo, canUndo, canRedo, updateNodeRuntime } = useFlows();
278+
279+
// Handle interactive node events (buttons, sliders, etc.)
280+
const handleNodeInteraction = useCallback((nodeId, eventName, data) => {
281+
// Update visual state if requested (for sliders, buttons, etc.)
282+
if (data?.updateValue) {
283+
const runtimeProps = {};
284+
if (data.value !== undefined) {
285+
runtimeProps._currentValue = data.value;
286+
}
287+
if (data.activeButton !== undefined) {
288+
runtimeProps._activeButton = data.activeButton;
289+
}
290+
if (Object.keys(runtimeProps).length > 0) {
291+
updateNodeRuntime(nodeId, runtimeProps);
292+
}
293+
}
294+
295+
if (!isRunning) {
296+
logger.warn('Runtime not running - deploy first');
297+
return;
298+
}
299+
emitNodeEvent(nodeId, eventName, data);
300+
}, [isRunning, emitNodeEvent, updateNodeRuntime]);
279301

280302
// Copy selected nodes
281303
const copyNodes = useCallback(() => {
@@ -422,9 +444,8 @@ function AppContent() {
422444
// Compute effective tab - fall back to debug if selected tab is unavailable
423445
const effectiveTab = useMemo(() => {
424446
if (sidebarTab === 'canvases' && !hasCanvasNodes) return 'debug';
425-
if (sidebarTab === 'buttons' && !hasButtonsNodes) return 'debug';
426447
return sidebarTab;
427-
}, [sidebarTab, hasCanvasNodes, hasButtonsNodes]);
448+
}, [sidebarTab, hasCanvasNodes]);
428449

429450
return (
430451
<div className="app">
@@ -436,7 +457,7 @@ function AppContent() {
436457
onDrop={handleDrop}
437458
onDragOver={handleDragOver}
438459
>
439-
<Canvas onEditNode={handleEditNode} onInject={handleInject} onFileDrop={handleFileDrop} />
460+
<Canvas onEditNode={handleEditNode} onInject={handleInject} onFileDrop={handleFileDrop} onNodeInteraction={handleNodeInteraction} />
440461
</div>
441462
<div
442463
className={`resize-handle ${isResizing ? 'resizing' : ''}`}
@@ -468,14 +489,6 @@ function AppContent() {
468489
Canvases
469490
</button>
470491
)}
471-
{hasButtonsNodes && (
472-
<button
473-
className={`sidebar-tab ${effectiveTab === 'buttons' ? 'active' : ''}`}
474-
onClick={() => setSidebarTab('buttons')}
475-
>
476-
Buttons
477-
</button>
478-
)}
479492
</div>
480493
{effectiveTab === 'debug' && <DebugPanel />}
481494
{effectiveTab === 'info' && <InfoPanel onEditNode={handleEditNode} />}
@@ -485,7 +498,6 @@ function AppContent() {
485498
<CanvasPanel />
486499
</div>
487500
)}
488-
{hasButtonsNodes && effectiveTab === 'buttons' && <ButtonsPanel />}
489501
</div>
490502

491503
{/* Node editor dialog */}

src/components/Buttons/ButtonsPanel.css

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)