fix(web): graph repaints in place instead of full-scene refresh (BUG-1742) - #707
Merged
Conversation
…1742) graph.refresh() sets three-forcegraph's _flushObjects flag, which destroys and recreates every Three.js object in the scene. Desktop GPUs hide the rebuild inside a frame; on mobile it reads as a full-screen flash on every select, deselect (background tap), SSE pulse, and 2s fade tick. Replace all refresh() call sites with repaint(): re-assigning fresh closures for the selection/pulse/chain-dependent accessors (nodeColor, linkColor, particle trio) takes the lib's in-place material/particle update path — objects survive, no flash. linkWidth is the one visual accessor whose prop-change DOES flush link objects (cylinder geometry is in the clear list), so width is now static per edge type and chain emphasis rides on full-alpha red + particles, as it already did visually. Also kill the gray mobile tap-highlight on the canvas. Reported by Dave on mobile right after PLAN-1730 shipped.
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.
Summary
Fixes the mobile full-screen flash on background tap (and on select / SSE pulses) in the /graph view.
Cause (confirmed in vendored lib source):
graph.refresh()→_flushObjects = true→nodeDataMapper.clear()+linkDataMapper.clear()— every scene object destroyed and recreated. Sub-frame on desktop, visible blank-and-redraw on mobile. We called it on select, deselect, every SSE item event, and every 2s while pulses decayed.Fix:
repaint()re-assigns fresh closures for the mutable-state accessors (nodeColor, linkColor, linkDirectionalParticles/Width/Speed) — a changed prop takes the lib's in-place update path with no object flush.linkWidthre-assignment is the one that does flush (it's in the lib's clear list), so width is now static per edge type; chain emphasis keeps full-alpha red + particles. Plus-webkit-tap-highlight-color: transparenton the canvas.Context
Fixes
BUG-1742(reported by Dave, mobile). Follow-up toPLAN-1730.Test plan