LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-maryam
createdAtNov 12, 2026, 2:38 AM
updatedAtNov 15, 2026, 11:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/20800
authorneo-fable-mnemosyne
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 15, 2026, 11:51 PM

An open cell edit survives its grid's move to another window

Closed v14.0.0/archive-v14-0-0-chunk-1 enhancementaigrid
neo-fable-mnemosyne
neo-fable-mnemosyne commented on Nov 12, 2026, 2:38 AM

Context

Neo.grid.plugin.CellEditing keeps an edit as a logical session in the App Worker and projects its editor into whichever cell renders it. The epic that built it left one case out on purpose: #18762 lists "cross-window editing" under Out of scope, and its design record #17832 lists "no cross-window editing" under its non-goals.

A docked grid can change windows while an edit is open and without a click from the person typing: a pop-out or a perspective applied through the Neural Link, a keyboard command, any layout transaction another actor starts. A click on the pane's own pop-out button is a different case: the click moves focus first, and that commit is the designed one.

@neo-gemini-julia read the seams from source on 2026-11-12 (defect-note); the browser run below measures them and corrects two of her three predictions.

The Problem

Measured on dev at be8d0b0340, 2026-11-12, headless Chrome, apps/workstation. The scale grid (100,000 rows) gets cell editing at runtime (cellEditing: true, the name column editable), is scrolled to 6,000 px, an edit is opened by double-click on record 125, and the pane is popped out with popOutDockItem({itemId: 'scale', pane: null}) through the Neural Link, so nothing takes the editor's focus before its DOM leaves.

a valid draft an invalid draft (editor: {required: true}, emptied)
The session after the move gone still open
The record holds the draft: name went from Echo 000125 to the typed text with no Enter, Tab or click unchanged
The editor destroyed rendered in the new window with its draft, without focus; its windowId is still the old window's while the grid's is the new one
Finishing in the new window nothing left to finish a click into the field, then typing and Enter commit; Tab commits and edits record 126, whose new editor carries the new windowId
Scroll position 6,000 px in the engine and in the DOM, before and after the same
Console errors none none

The valid arm ran three times and the invalid arm three times (twice finished with Enter, once with Tab), with the same result each time. A control without a move shows the same Tab behaviour in the opener.

So one move writes one draft into the store and keeps the other open, and the surviving editor names a window it is no longer in.

The Architectural Reality

  • Design authority: "projection loss by itself is neutral—never commit and never cancel. Projection marks the session suspending before embodiment removal, so the resulting DOM focus-leave is classified as projection loss and cannot invoke the user focus-leave terminal." (#17832, the resolved contract.) The plugin's class JSDoc carries it as "Losing the projection is neutral: scrolling never commits and never cancels" (src/grid/plugin/CellEditing.mjs:22) and names three losses: a scroll that rebinds the row, a column leaving the mounted range, a column lock change. A change of window is not among them, because #18762 excluded it.
  • CellEditing#onEditorFocusLeave (:431) commits when the session is embodied and no blur is owed. isEmbodied (:363) asks whether the record is in the row pool and the column in the mounted range. It does not ask whether the grid is mounted. Inferred, not measured: the leave that the old window's unmount causes arrives while isEmbodied still answers true.
  • The editor is created with windowId: owner.windowId (:752). grid.Body#afterSetWindowId (src/grid/Body.mjs:689) hands a new window to its rows, and grid.Row#forwardToCells (src/grid/Row.mjs:142) hands it to the row's cell components only. The session's editor is not one of them.
  • A hold already exists for the one structural change the epic covered: holdEdit and releaseEdit keep the editor out of every cell while a column changes body (:338, :637; the caller is grid.Container#onColumnLockChange, src/grid/Container.mjs:1326).
  • grid.Container#afterSetWindowId (src/grid/Container.mjs:847) and restoreLostScroll (:1710) are why the scroll position survives.
  • Tab's prevent-default registration is made for the view's window when a session starts (:694). The run found no Tab defect in the new window; the registration is named here only so a fix does not break it.

The Fix

Treat the grid's change of window as a fourth projection loss:

  1. The leave that the old window's unmount causes is neutral for a valid and for an invalid draft: no commit, no cancel.
  2. The session's editor follows the grid's windowId.
  3. Once the grid is mounted in the new window, the cell that proves the session embeds the editor again, and focus returns to it if the editor had focus when the move began. onEditorReprojected already applies that rule after a scroll.
  4. The class JSDoc names the window change beside the other three losses.

Two seams to weigh, the choice is the implementer's: the existing hold around the move, or isEmbodied answering false while the grid is not mounted.

Acceptance Criteria

  • After a grid with an open edit and a valid draft moves to another window, the record holds its old value, the session is open, and the editor shows the draft in the new window.
  • The same holds for an invalid draft.
  • In both cases the editor's windowId equals the grid's.
  • An editor that had focus before the move has it after the move. Enter commits, Escape cancels, and Tab commits and edits the next editable cell, all in the new window.
  • A click on another cell, before or after the move, still commits a valid draft: the user's own terminal is unchanged.
  • An e2e spec with a real second window covers both drafts (test/playwright/e2e/, the neuralLink fixture; the probe in the first comment is a starting point). test/playwright/component/grid/CellEditing.spec.mjs stays green.
  • The class JSDoc of Neo.grid.plugin.CellEditing lists the window change among the projection losses.

Out of Scope

Editing one record from two windows at once. The Table plugin. What a pane's own pop-out button does to an open edit. Changes to the dock.

Avoided Traps

  • Keeping the commit and calling it "focus left": the person did not leave, the DOM did.
  • Fixing only the valid draft: the invalid one already survives, with a stale windowId and without focus.

Related

#18762 (the epic; cross-window editing out of scope) · #17832 (the contract) · #18863 (reprojection focus and invalid drafts) · #18883 (Tab while an edit is suspended)

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Live latest-open + closed sweep: the latest 20 open (33 open in all, orange band; no open ticket or epic owns cell editing, so this one is filed) and closed searches (cell edit window; editor pop-out; draft committed; cross-window editing; Out of Scope read on #18762, non-goals read on #17832) at 2026-11-12T01:37Z; no equivalent found, and the one prior exclusion is the scope this ticket takes up. A2A in-flight claim sweep: the latest 30 messages of all read states at 01:37Z; one defect-note on this surface (the source read named above), no claim. MC sweep: "half-typed cell value written to the record when a grid pane is popped out or moved to another window while editing", 6 results; a second-window editing probe of 2026-09-19 that did not finish, no prior decision. Own-assignment sweep: 0 open in this repository. Knowledge Base: asked what happens to an open edit when the grid changes its browser window; the answer describes suspension on scroll (learn/guides/datahandling/Grids.md) and names no window change. Structure map: N/A, no file is placed and nothing under ai/ is touched.

Origin Session ID: 582c45b1-0ae3-411a-80e5-9db0979d4fab

Retrieval Hint: "cell edit committed when the grid pane moves to another window, editor windowId stale"

🪢 Mnemosyne (Claude Fable 5.2, Claude Code) · session 582c45b1-0ae3-411a-80e5-9db0979d4fab

tobiu referenced in commit ce985e8 - "feat(grid): preserve open cell edits across window moves (#20800) (#21048) on Nov 15, 2026, 11:51 PM