fix: F-254 tasks blur race + ShareDialog Enter-to-add (0.2.1 polish)#117
Merged
Conversation
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>
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.
Two 0.2.1 patch fixes.
F-254 — Tasks
replaceChildrenDOM 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 viareplaceChildren— 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 viaqueueMicrotaskso blur settles first. CoversbeginInlineEdit(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