Skip to content

Frontend window fix: websocket refactor, UI #79

Merged
MaddieWright merged 2 commits intomainfrom
window-node
Mar 21, 2026
Merged

Frontend window fix: websocket refactor, UI #79
MaddieWright merged 2 commits intomainfrom
window-node

Conversation

@MaddieWright
Copy link
Collaborator

Pull Request Template

What?

Fixed and refactored the Window Node: corrected broken option selection UI, migrated WebSocket config from the old useWebsocket/GlobalContext pattern to the new custom event bus, and redesigned the expanded panel with a step-by-step input flow.


How?

  • UI fixes: Set a fixed width: 396px (was fit-content, causing expansion), increased maxHeight from 120px to 320px so the overlap input was visible, added nodrag class to all buttons/inputs so React Flow doesn't intercept clicks as drags, and gave preset options unique value fields ('default' / 'custom') so only one highlights at a time
  • WebSocket migration: Replaced sendWindowingConfig from GlobalContext with window.dispatchEvent(new CustomEvent('windowing-config-update', ...)). The WebSocketContext listener picks this up and sends to the backend. Removed the dataStreaming guard so config is always dispatched and the ref in WebSocketContext stays current even before streaming starts
  • Step-based UX: Expanded panel now shows input size options first; selecting one collapses that section and shows overlap options; selecting overlap collapses the whole panel. Both sections offer Default and Custom options
  • Cleanup: Migrated SignalGraphNode from renderData via GlobalContext to useNodeData, migrated FilterNode from sendProcessingConfig via GlobalContext to dispatching processing-config-update, and removed useWebsocket from GlobalContext entirely

Testing

  • Verified preset selection highlights only the selected option and advances to the overlap step
  • Verified custom window/overlap inputs accept only integers and show validation errors for invalid values
  • Verified panel auto-collapses after both fields are confirmed
  • Verified collapsed state shows current Size and Overlap Size values
  • Verified windowing config dispatches on mount and on every option change via browser DevTools network tab (WebSocket messages)
  • Backend verification pending: RUST_LOG=info cargo run should log Received WindowingConfig: chunk=64, overlap=0 on connect and Windowing update: chunk=, overlap= on changes (blocked by local Python 3.13 dylib issue)

@MaddieWright MaddieWright merged commit 2b5fa51 into main Mar 21, 2026
1 check failed
@MaddieWright MaddieWright deleted the window-node branch March 21, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant