Repository navigation
Conversation
…out updates React Flow renders a node with visibility:hidden until it has a `measured` size, and only re-observes the node's element when it goes from measured to unmeasured in a committed render. The builder canvas replaced its nodes with measurement-less copies on every layout recompute (setNodes(computedNodes)), so two recomputes landing before the measured state was committed left every card - and therefore every edge - hidden for good. That is the empty canvas in the deep-link failure of builder-imported-pending.spec.ts on #449. The sync now carries `measured` over for cards that still exist (functional update, so queued dimension changes are not overwritten) and asks React Flow to re-measure the cards whose connector dots moved without a resize. Tests: unit spec for syncMeasuredNodes, and an isolated browser spec that fails 5/5 on the old canvas and passes 5/5 with the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rkSXFA7AZFzsUvB1Cgq4K
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
The transaction builder canvas could leave every card hidden for good (empty canvas, no edges) while the page around it had loaded. This PR fixes that. It is the root cause of the
playwright-browserfailure on #449:builder-imported-pending.spec.ts› via deep link waited 120 s for theSigner 1output, and Playwright reported "element is not visible" the whole time.Why it happened
visibility: hiddenuntil the node has ameasuredsize.useNodeObserver, deps[isInitialized, hidden]).BuilderCanvasreplaced its nodes on every layout recompute withsetNodes(computedNodes), using copies that carry no measurement.Fix
syncMeasuredNodes(intoken-flow/measured-nodes.ts) carriesmeasuredover for cards that still exist. The canvas now applies it as a functional update, so a queued dimensions change can no longer be overwritten. Brand-new cards are still measured on mount.RemeasureMovedHandlescallsuseUpdateNodeInternalsafter the commit. Changes that resize a card were already caught by React Flow's ResizeObserver.No changes to transactions, signing or the draft model. This only affects how the canvas is rendered.
Tests
npx tsc --noEmitnpx jest src/__tests__/tokenFlowMeasuredNodes.test.tsnode scripts/run-tests.mjs(full unit run)e2e/risk-components/builder-canvas.spec.ts(realBuilderCanvas+ React Flow in Chromium; 4 rounds of new recipient + 40 macrotask-spaced recomputes)RemeasureMovedHandlesnpx playwright test -c e2e/risk-components.config.ts --repeat-each 3(whole config)SKIP_ENV_VALIDATION=1 npx next build --webpack+check-bundle-budget.mjs --reportA cold review by a separate agent found no blockers. I applied two of its nits: a redundant unit case was removed, and the harness hook now lives in a
useEffect.Not verified
playwright-browserjob locally, because it needs the CI mnemonics and Blockfrost secrets. The deep-link spec should go green here, and on perf(api-docs): serve the API reference without the Cardano stack (1980 → 196 KB first-load JS) #449 once this is merged and perf(api-docs): serve the API reference without the Cardano stack (1980 → 196 KB first-load JS) #449 is updated frompreprod.e2e/risk-components.config.ts(and so the new spec) is not wired into any workflow, which matches the existingreview.spec.ts. Adding it to CI is a separate decision.Generated by Claude Code