Repository navigation
fix: compare a DOM node an Effect UI widget reads by reference, not structurally - #7388
Merged
Merged
Conversation
…tructurally lf-tally hands its region element to its component as a prop. When a revision replaced the region, Effect UI's propsEqual saw the field differ by reference and fell back to Equal.equals, which in Effect 4 compares two objects by every property they reach. Walking the DOM that way read an SVG length's value and threw "Could not resolve relative length", so the page's reading failed on command-hub (test_command_hub_an_absorbed_input_stays_fulfilled, both cases, first seen in ci run 45985477026 after #7374). The adapter now marks each DOM node an `inputs` function returns with Equal.byReferenceUnsafe, so a replaced node is a changed prop and an unchanged one is equal, with no walk. /vendor/effect-ui.js exports Equal for it. Refs #7387
This was referenced Nov 27, 2026
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.
lf-tallyhands its region element to its Effect UI component as a prop. When a revision replaces that region, Effect UI'spropsEqualsees the field differ by reference and falls back toEqual.equals, which in Effect 4 compares two objects structurally, through every property they reach. On a DOM node that walk covers the document; on command-hub it reaches an SVG length whosevaluegetter throwsNotSupportedError: Could not resolve relative length, so the page's reading fails (leaf: read failedfromlayer-client.js). Both cases oftest_command_hub_an_absorbed_input_stays_fulfilledfail this way on main since #7374, first in ci run 45985477026.The adapter (
runtime/lib/effect-widget.js) now marks each DOM node aninputsfunction returns withEqual.byReferenceUnsafe, so a replaced node counts as a changed prop and an unchanged one as equal, with no walk. The fix sits in the adapter rather than inlf-tally, because any widget whoseinputsreturns an element would hit the same walk./vendor/effect-ui.jsnow exportsEqualfor this (rebuilt withpnpm run build:browser);leaf-dev interface --basereports no name added.Verification:
test_command_hub_an_absorbed_input_stays_fulfilled(both cases) fails ondb508e5b8with the SVGLength error and passes with this change.test_a_tally_counts_its_regions_obligations_and_walks_them, the runtime testseffect-widgetandauthored-capture,pnpm run check:browserandpnpm run test:browserpass.The run's other failures are not touched here: the floating-panel teardown shift is #7381, fixed by #7385, and the heading-link copy-button shift has its own cause issue.
Refs #7387 — automated triage