Skip to content

Remove dead textarea re-sync from requestNodeFocus - #4410

Merged
mstomar125 merged 1 commit into
mainfrom
issue-c6cb44c4-dead-editor-workarounds
Dec 1, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-c6cb44c4-dead-editor-workarounds

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

NodeSpace task: c6cb44c4 (Remove dead editor workarounds and state-writing effects the reactivity rule forbids).

What changed

BaseNodeViewer.requestNodeFocus no longer runs a delayed textarea re-sync. It looked up textarea[id="textarea-<nodeId>"], but the editor textarea id is textarea__{paneId}__{nodeId} (base-node.svelte), so the lookup always returned null and the block never did anything. Merged content is already synced by the textarea controller's content effect. Two stale "removed workaround" comments in the viewer are dropped too.

Not changed (needs a decision or is outside scope)

  • Effects that write reactive state: none remain in the outline viewer area (base-node-viewer, base-node, textarea-controller, table-node, code-block-node, pane-content). Those effects write no $state. The state-writing effects are elsewhere (settings-pane, remote-tool-confirmation-card, node-ref-preview, database-name-dialog, person-schema-form, typed-form-shell, kanban-view, relationship-viewer-modal, ai-chat-acp-node-viewer); not touched here.
  • handleCreateNewNode: the updateNodeContent(afterNodeId, sameContent) "to trigger focus" call and the <span class="markdown- to htmlToMarkdown branch are not provably dead (the first still writes the store and schedules processing; the second fires if a user types that literal text), so they are left.

Checks

  • bun run test:changed: passed (frontend Happy-DOM, Chromium browser tier)
  • bun run quality:check (eslint, design tokens, svelte-check): 0 errors, 0 warnings
  • pre-push check passed on git push

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE (head eda1e4d)

Verified in a detached worktree of that commit:

  1. Dead block: the only textarea id in the repo is textarea__{paneId}__{nodeId} (base-node.svelte:837; the one test reference, base-node-content-changed-scoping.test.ts, uses the same format). A repo-wide grep (src, tests, other packages, template literals, quoted strings, textarea[id, #textarea-) finds no textarea-${...} or textarea- + nodeId anywhere. textarea-<nodeId> can never equal textarea__<pane>__<node>, in any pane, so the removed querySelector always returned null. The block had no effect, so there is no user-visible change for focus after node creation or for split/merge. Merged content is synced by the factory's content $effect in textarea-controller.svelte.ts (~line 1291: controller.updateContent(getContent()), early-returns when the value already matches), as the author said. Focus itself still goes through focusManager.focusNodeAtPosition, which is unchanged.
  2. Comments: the three comment edits (removed 'no longer need' notes, the requestNodeFocus doc, and the merge-step comment 'controller's content effect syncs it') read correctly after the change. The merge call site's setTimeout is kept, untouched.
  3. Diff: one file (+4/-25), matches the files list, no hidden changes. Commit ends with the Co-Authored-By line; PR body ends with the Generated with Claude Code line. The body does not claim to close or fix c6cb44c4. It says explicitly what was not done (state-writing effects elsewhere), so no overclaim. Nit only: it says 'NodeSpace task c6cb44c4' without 'Closes', which is correct.
  4. Ran: bun run test:changed passed (frontend Happy-DOM 107s, Chromium browser 11s). cd packages/desktop-app && bun run quality:check: eslint clean, design tokens OK (38 known baseline), svelte-check 2600 files 0 errors 0 warnings. No GitHub status checks are reported on the PR (statusCheckRollup empty), so these local runs are the evidence.
  5. Behaviour: none a user could notice.

Blocking: none. Nits: none.

🤖 Generated with Claude Code

requestNodeFocus queried textarea[id="textarea-<nodeId>"], but the editor
textarea id is textarea__<paneId>__<nodeId>, so the lookup always returned
null and the delayed re-sync never ran. The textarea controller's content
effect already syncs merged content. Also drops stale removed-workaround
comments in the viewer.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-c6cb44c4-dead-editor-workarounds branch from eda1e4d to 51dc5d4 Compare December 1, 2026 10:24
@mstomar125
mstomar125 merged commit bbf5a82 into main Dec 1, 2026
@mstomar125
mstomar125 deleted the issue-c6cb44c4-dead-editor-workarounds branch December 1, 2026 10:25
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