Skip to content

fix: compare a DOM node an Effect UI widget reads by reference, not structurally - #7388

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-7387
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-7387

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

lf-tally hands its region element to its Effect UI component as a prop. When a revision replaces that region, Effect UI's propsEqual sees the field differ by reference and falls back to Equal.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 whose value getter throws NotSupportedError: Could not resolve relative length, so the page's reading fails (leaf: read failed from layer-client.js). Both cases of test_command_hub_an_absorbed_input_stays_fulfilled fail this way on main since #7374, first in ci run 45985477026.

The adapter (runtime/lib/effect-widget.js) now marks each DOM node an inputs function returns with Equal.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 in lf-tally, because any widget whose inputs returns an element would hit the same walk. /vendor/effect-ui.js now exports Equal for this (rebuilt with pnpm run build:browser); leaf-dev interface --base reports no name added.

Verification: test_command_hub_an_absorbed_input_stays_fulfilled (both cases) fails on db508e5b8 with the SVGLength error and passes with this change. test_a_tally_counts_its_regions_obligations_and_walks_them, the runtime tests effect-widget and authored-capture, pnpm run check:browser and pnpm run test:browser pass.

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

…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
@max-sixty
max-sixty merged commit 890839a into main Nov 27, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/issue-7387 branch November 27, 2026 13:59
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.

2 participants