Skip to content

Debounce continuous View controls, and fix review findings from #331 - #332

Merged
dovvnloading merged 1 commit into
mainfrom
fix/view-panel-review-followups
Aug 15, 2026
Merged

Debounce continuous View controls, and fix review findings from #331#332
dovvnloading merged 1 commit into
mainfrom
fix/view-panel-review-followups

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

Problem

Five issues found reviewing #331:

  1. Continuous controls flooded the wire. The colour pickers and sliders committed on every change event. A native colour picker emits changes continuously while the pointer moves inside it, and each one fired an intent that triggered a full state republish - so choosing a colour, or dragging any slider, put roughly a hundred round trips on the wire. This is the only finding with user-visible impact.
  2. Touch and pen could not pan. Redesign the View panel and restore drag speed's real meaning: pan sensitivity #331 disabled React Flow's built-in pan so the speed factor could apply, but bound the replacement to mouse events only. React Flow's own pan was pointer-based, so touch and stylus users lost canvas panning entirely.
  3. Dead values in dragStartRef. It held start positions only while the drag-speed factor scaled node motion from its origin. That factor now applies to panning, so nothing read the values - only membership was ever checked.
  4. Dead assignment. ConnectionCanvas set a stroke width before its draw loop that every iteration immediately overwrote.
  5. The stylesheet contradicted itself. It described the chip class as the multi-select idiom, and Redesign the View panel and restore drag speed's real meaning: pan sensitivity #331 then applied it to the Chat Library's single-select workspace tabs.

Change

  • Continuous controls show the in-flight value immediately and commit the last one after a short pause, using the same debounce posture the canvas already uses for viewport reporting. Pending state clears whenever a fresh value arrives with nothing in flight, so a server-side clamp is always what ends up displayed rather than a local value the backend rejected. Discrete controls - presets, grid style, toggles - stay immediate.
  • Pan handlers are pointer-based, including pointercancel, and the pane sets touch-action so the browser cannot claim a touch drag for scrolling before the handler sees it.
  • dragStartRef is a Set of the ids the gesture is carrying, which is all the drag-stop change needs in order to be recognised.
  • The redundant stroke-width assignment is removed.
  • The chip class comment now describes what it is actually for: selections drawn from an open-ended, data-driven set, carrying no single/multi-select meaning of its own, as distinct from the segmented control used for short fixed sets of mutually exclusive choices.

Test plan

  • Full frontend check passes: schema, types, lint (0 errors), 1928 tests, production build, bundle size
  • Two ChartNodeView failures observed during one run were reproduced as pre-existing parallel-load flakiness on a lazily-loaded component - the file passes in isolation and on a repeat full run, and this change touches only a comment in it

Five issues found reviewing the View panel redesign:

The colour pickers and sliders committed on every change event. A native
colour picker emits changes continuously while the pointer moves inside
it, and each one fired an intent that triggered a full state republish -
so choosing a colour, or dragging any slider, put roughly a hundred round
trips on the wire. Continuous controls now show the in-flight value
immediately and commit the last one after a short pause, the same
debounce posture the canvas already uses for viewport reporting. Pending
state clears whenever a fresh value arrives with nothing in flight, so a
server-side clamp is always what ends up displayed. Discrete controls -
presets, grid style, toggles - stay immediate.

Panning was bound to mouse events only. React Flow's own pan, which #331
disabled so the speed factor could apply, was pointer-based, so touch and
pen users were left unable to pan at all. The handlers are pointer-based
now, including pointercancel, and the pane sets touch-action so the
browser cannot claim a touch drag for scrolling first.

dragStartRef was left as a Map whose values nothing read: it held start
positions only while the drag-speed factor scaled node motion from its
origin, and that factor now applies to panning. It is a Set of the ids
the gesture is carrying, which is all the drag-stop change needs to be
recognised.

ConnectionCanvas set a stroke width before its draw loop that every
iteration immediately overwrote.

The stylesheet described the chip class as the multi-select idiom, then
#331 applied it to the Chat Library's single-select workspace tabs. The
comment now describes what the class is actually for - selections from an
open-ended, data-driven set, carrying no single/multi-select meaning of
its own - as distinct from the segmented control used for short fixed
sets of mutually exclusive choices.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dovvnloading
dovvnloading merged commit b2e0bd9 into main Aug 15, 2026
@dovvnloading
dovvnloading deleted the fix/view-panel-review-followups branch August 15, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant