Skip to content

Stop stationary Node tooltips from redrawing the graph - #352

Merged
joesobo merged 6 commits into
mainfrom
codex/fix-stationary-tooltip-frames
Aug 7, 2026
Merged

Stop stationary Node tooltips from redrawing the graph#352
joesobo merged 6 commits into
mainfrom
codex/fix-stationary-tooltip-frames

Conversation

@joesobo

@joesobo joesobo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Stop stationary Node tooltips from redrawing the graph

Trello: https://trello.com/c/qvCouwTJ

Bug boundary

A visible stationary Node tooltip owned a separate animation-frame loop. Each tick wrote React state, rebuilt graph-surface props, and requested another owned WebGPU frame after physics settled. A retained Graph View could also keep work alive while VS Code hid it because the webview document remained visible.

This change does not throttle tooltip updates and does not add broad prop-equality exceptions.

Implementation

  • Update the tooltip anchor only from graph frames that already exist for Node or camera movement.
  • Keep tooltip-only React state outside the memoized graph-surface prop boundary.
  • Cancel tooltip anchor state on hover leave, window blur, document visibility change, Extension host visibility change, context cleanup, and disposal.
  • Forward actual visibility from both sidebar WebviewView.onDidChangeVisibility and editor WebviewPanel.onDidChangeViewState.
  • Use one owned frame-loop visibility gate to cancel pending graph work, preserve demand, and resume only after both the host and document are visible. Synchronize host visibility before the next browser frame.
  • Name the anchor snapshot operations for the state they initialize or clear; they do not own a tracking session.
  • Add an Extension patch changeset.

Verification

  • Review-focused host, tooltip, React surface-boundary, renderer, physics, and CI-selection suite: 39 tests passed.
  • The React surface-boundary regression drives the real tooltip hook and state setter, displays the tooltip, then runs repeated stationary anchor updates without another surface render or frame request.
  • Mutation check: removing the memo boundary makes that focused regression fail with two surface renders; restoring it returns the test to green.
  • The hidden-view integration starts the real graph layout and renderer seam, then proves no further WebGPU submissions or physics engine ticks after host visibility changes to hidden.
  • The Extension Host regression is assigned to the Graph interactions - hover and selection CI shard.
  • Focused ESLint on all review-changed TypeScript and Playwright files.
  • TURBO_FORCE=true pnpm --filter @codegraphy-dev/extension typecheck passed; the dependency build reported Cached: 0.
  • TURBO_FORCE=true pnpm --filter @codegraphy-dev/extension run build:vscode passed: 10/10 tasks, Cached: 0.
  • Real VS Code 1.132.0 Extension Development Host scenario passed: a settled stationary Node tooltip produced zero repeated webview frame requests; a retained host-hidden Graph View produced zero webview frame requests after lifecycle teardown, with idle physics/rendering.

CI follow-up

Run 31190909566, job 92907168039, failed only the first Background Context Menu scenario. All three attempts timed out in waitForGraphFrame before any canvas or favorites assertion. The uploaded screenshots show the Extension Development Host on CodeGraphy's Loading graph... screen. The Dragging, Edge Context Menu, and Favorite scenarios then passed in the same job.

The same job passed at the prior PR head 0b16ed40bda5b369253fbda0b7d4932576da0f09. The review checkpoint changes do not modify extension activation, webview bootstrap, or graph-data delivery. The exact four-scenario shard also passed locally, 4/4, on VS Code 1.125.1 with software WebGPU enabled, including the first cold-start scenario. This evidence supports a cold-start readiness flake.

The same run also found a branch-owned portability defect in job 92907168183: the new hidden-view proof used the macOS-only Meta+Shift+E shortcut on Linux, so all three attempts left the Graph View visible. Checkpoint 3507c9280 now selects Meta+Shift+E on macOS and Control+Shift+E elsewhere, matching the existing acceptance-test convention. The exact hover-and-selection shard passed locally, 4/4, on VS Code 1.125.1 with software WebGPU enabled.

Replacement run 31192166270 completed at 3507c9280 with all 36 CI jobs green. This includes both Graph interactions - hover and selection and Graph interactions - canvas basics and favorites.

Visual proof

Playwright injects the green evidence panel into the live Extension Development Host for this test only. It is not shipped Extension UI. The panel reports the measured webview frame requests for the stationary tooltip and the retained host-hidden Graph View; the visible tooltip and graph are the real Extension runtime.

tooltip-frame-lifecycle-review-final.png

Work log

The first real host run showed that switching to Explorer leaves the retained webview document at document.visibilityState === "visible". That evidence led to the Extension-owned sidebar and editor visibility signal instead of another browser visibility workaround.

Before the manager supplied the bundled runtime path, I ran the exact command brew reinstall node@22 after the active Homebrew Node failed to load libsimdjson.29.dylib. Homebrew reinstalled node@22 22.23.2 successfully. This was outside the repository task and should not have happened without approval. I did not revert it or make further machine-package changes. I logged the friction in ~/.codex/PAPERCUTS.md and used the manager-provided bundled runtime path for all remaining project commands.

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3507c92

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@codegraphy-dev/extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codegraphy Skipped Skipped Aug 7, 2026 3:21pm

@joesobo
joesobo marked this pull request as ready for review August 6, 2026 17:57
@joesobo
joesobo marked this pull request as draft August 7, 2026 15:06
@joesobo
joesobo marked this pull request as ready for review August 7, 2026 15:55
@joesobo
joesobo merged commit c46f9c0 into main Aug 7, 2026
38 checks passed
@joesobo
joesobo deleted the codex/fix-stationary-tooltip-frames branch August 7, 2026 15:55
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