Debounce continuous View controls, and fix review findings from #331 - #332
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Five issues found reviewing #331:
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.ConnectionCanvasset a stroke width before its draw loop that every iteration immediately overwrote.Change
pointercancel, and the pane setstouch-actionso the browser cannot claim a touch drag for scrolling before the handler sees it.dragStartRefis aSetof the ids the gesture is carrying, which is all the drag-stop change needs in order to be recognised.Test plan
ChartNodeViewfailures 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