Skip to content

fix: F-254 tasks blur race + ShareDialog Enter-to-add (0.2.1 polish)#117

Merged
th3-br41n merged 2 commits into
mainfrom
fix/0.2.1-small-fixes
Jul 8, 2026
Merged

fix: F-254 tasks blur race + ShareDialog Enter-to-add (0.2.1 polish)#117
th3-br41n merged 2 commits into
mainfrom
fix/0.2.1-small-fixes

Conversation

@th3-br41n

@th3-br41n th3-br41n commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Two 0.2.1 patch fixes.

F-254 — Tasks replaceChildren DOM race on edit-blur. Editing a task field and blurring logged a non-fatal Chromium error ("node … moved in a 'blur' event handler"). Root cause: the blur handler synchronously ran the reactive commit (onCommit/onRenameProject/onAddTask), which re-renders the host via replaceChildren — mutating the subtree the blurring input lives in, mid-blur-dispatch. Fix (all three inline-edit sites): restore the DOM synchronously, then defer the reactive callback via queueMicrotask so blur settles first. Covers beginInlineEdit (row name, inspector/header title, task-row rename), board-view add-task, sidebar rename. Tests pin the invariant (callback not invoked synchronously during blur; DOM restore synchronous) — the original Chromium timing throw isn't faithfully reproducible in jsdom.

ShareDialog Enter-to-add. From a code-polish pass over the 0.2.0 share dialog: the add-by-code field required clicking "Add" — Enter did nothing, unlike every other single-field commit input. Enter now submits when the code is non-empty and not busy. +2 tests.

Tasks-UI + SDK share-dialog suites green; typecheck + lint clean.

🤖 Generated with Claude Code

th3-br41n and others added 2 commits July 8, 2026 17:49
Editing a task field and blurring logged a Chromium DOM error:
"replaceChildren … The node to be removed is no longer a child of this
node. Perhaps it was moved in a 'blur' event handler?" Non-fatal but a
real race: the blur handler synchronously ran the reactive commit
(onCommit / onRenameProject / onAddTask), which re-renders the host via
`replaceChildren` — mutating the very subtree the blurring input lives in,
mid-blur-dispatch.

Correct-by-construction fix at all three inline-edit sites: restore the
DOM synchronously, then defer the reactive callback with queueMicrotask so
the blur event settles before the re-render. Covers the shared
`beginInlineEdit` (row name, inspector/header title, task-row rename),
board-view add-task, and sidebar project rename.

The original was a Chromium-specific timing throw not faithfully
reproducible in jsdom; the tests instead pin the invariant that removes it
— the reactive callback is NOT invoked synchronously during the blur/key
dispatch (fires after a microtask), and the DOM restore is synchronous.
Existing sync-callback assertions updated to await a microtask.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
From a code-polish pass over the 0.2.0 ShareDialog: the add-by-code input
required clicking "Add" — Enter did nothing, unlike every other
single-field commit input in the product. Enter now submits when the code
is non-empty and not busy. +2 tests (Enter adds, empty Enter no-ops).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@th3-br41n th3-br41n changed the title fix(tasks): F-254 — defer inline-edit commits out of the blur dispatch fix: F-254 tasks blur race + ShareDialog Enter-to-add (0.2.1 polish) Jul 8, 2026
@th3-br41n th3-br41n merged commit 60764d4 into main Jul 8, 2026
2 of 3 checks passed
@th3-br41n th3-br41n deleted the fix/0.2.1-small-fixes branch July 8, 2026 15: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.

1 participant