Skip to content

fix(web): graph repaints in place instead of full-scene refresh (BUG-1742) - #707

Merged
xarmian merged 1 commit into
mainfrom
fix/graph-refresh-flash
Jun 6, 2026
Merged

fix(web): graph repaints in place instead of full-scene refresh (BUG-1742)#707
xarmian merged 1 commit into
mainfrom
fix/graph-refresh-flash

Conversation

@xarmian

@xarmian xarmian commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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 = truenodeDataMapper.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. linkWidth re-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: transparent on the canvas.

Context

Fixes BUG-1742 (reported by Dave, mobile). Follow-up to PLAN-1730.

Test plan

  • make check — all green (svelte-check 0 errors)
  • Flush behavior + clear-list membership verified against three-forcegraph dist source
  • On-device verification post-merge (tap empty space after selecting — no flash)

…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.
@xarmian
xarmian merged commit 38f18ac into main Jun 6, 2026
4 checks passed
@xarmian
xarmian deleted the fix/graph-refresh-flash branch June 6, 2026 01:00
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