Skip to content

v0.28.3 — undo and redo leave nothing selected - #358

Merged
MerciHanrim merged 4 commits into
mainfrom
fix/undo-clears-selection
Oct 15, 2026
Merged

MerciHanrim merged 4 commits into
mainfrom
fix/undo-clears-selection

Conversation

@MerciHanrim

@MerciHanrim MerciHanrim commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

v0.28.3 — undo and redo leave nothing selected

A history entry kept the nodes and edges as they were, React Flow's selected flags included, while undo / redo set the Inspector's selectedNodeId / selectedEdgeId to null. React Flow reports a selection only when it changes, so an undo could leave a connection or node marked that the Inspector did not show (a click on it changed nothing; Delete or an arrow key acted on it, and the arrow-key move discarded the redo branch), or, where the flags differed, bring an old selection back from the history. Share note 56 holds the investigation (cases A–F, reproduced on b11ff65 with real pointer clicks and keys). Four commits: the fix, the release, and two wording commits from Lumi's review.

1. The fix (195244a, src/store/graphStore.ts)

  • Ordinary undo / redo clear every selected flag of the restored entry and both Inspector ids. Only an element whose flag changes is copied; the flags are never serialized, so it is no document change and no history entry.
  • The one exception is a module insert (docs/module-system.md §MS3.5): its entries carry the selection from before the insert (undo) and the inserted set (redo), restored as flags and ids together, however often the step is undone and redone. Ids of elements the restored entry does not have are dropped.
  • Found in passing, in scope: the insert cleared node flags but not edge flags, so a connection selected before an insert stayed marked beside the inserted block with no Inspector id — the same mismatch. §MS3.3 says the insert selects "inserted nodes, and nothing else"; it now clears edge flags too, and its undo selects that connection again.
  • Docs: docs/large-graph-readability.md LGR-D17 (new row), docs/module-system.md §MS3.5.

2. Tests

  • src/store/graphStore.undoSelection.test.ts (6): flags and ids cleared on undo and redo; no old selection back; a selection made after an undo is the only one; no history entry, serialize() unchanged, unflagged objects kept; the module insert's undo / redo restore flags and ids, repeatably, including a connection selected before it; ordinary steps around the insert still clear.
  • src/store/frameStore.test.ts: a frame undo / redo keeps the nodes / edges apart from the selection flags and leaves no node selected (it compared whole objects before).
  • e2e/undo-redo-selection.spec.ts (5): the stale mark and a click that selects again, no old selection back, Delete and an arrow key after an undo, and a module insert through the toolbar menu with the canvas marks matching the flags at each step. Tests 1 to 4 fail on b11ff65.

3. Release (9c32ccd, wording ba78c4a, 6306c86)

  • 0.28.3: .changes/undo-clears-selection.json (user-facing), CHANGELOG v0.28.3, README Latest. Release date 2026-10-15, to be checked on the merge day.
  • Four What's new lines in 18 languages, after Lumi's review of a three-line draft: nothing is selected after Undo or Redo, on the canvas or in the Inspector; a connection or node no longer stays highlighted while the Inspector is empty, and Delete won't remove it nor the arrow keys move a node until you select it (English in Lumi's wording); no selection from an earlier step comes back; a module insert is the one exception (Undo selects what was selected before it, Redo the inserted nodes).
  • The translation contract tests pass: evidence of the catalogs' structure and terms, not a review of how the lines read. The English and Korean lines were reviewed; the other 16 had no native-speaker review.

Verification, by head

Head What ran Result
6306c86 PR CI, run 38708671125 success: checks, e2e shards 1–6, production bundle, PWA
6306c86 Unit (vitest, full); tsc; check:i18n, check:i18n-surface, check:control-bytes, check:functional-glyphs 3 592 passed, 1 skipped; all pass
ba78c4a Unit (vitest, full); tsc; lint; check:change-declaration, check:i18n, check:i18n-surface, check:control-bytes, check:isolate-arguments, check:icu-arguments, check:locale-lists, check:functional-glyphs; whats-new.spec.ts on Chromium 3 592 passed, 1 skipped; lint 0 errors; all pass; 96 passed
9c32ccd PR CI, run 38705969992 success: checks, e2e shards 1–6, production bundle, PWA
9c32ccd Full local e2e, --workers=1 --retries=0 2 196 passed, 0 failed, 10 skipped (47.7 min)
9c32ccd dist config, then pwa config, run separately 16 passed; 19 passed
9c32ccd Unit (vitest, full); tsc; lint; check:change-declaration, check:i18n, check:i18n-surface, check:control-bytes, check:isolate-arguments, check:icu-arguments, check:locale-lists, check:functional-glyphs, check:e2e-shards, check:snapshot-policy, check:form-direction, check:content-direction, check:no-pseudo-locales 3 592 passed, 1 skipped; lint 0 errors; all pass
195244a 16 related e2e specs on Chromium (undo / redo, module, colour, keyboard move, frames) 307 passed

The two wording commits change only release-note strings, the locale count pins and README; the full local e2e was not rerun for them.

Seen in passing, not in this PR

docs/edge-routing.md §ER8 describes a right-click menu on a connection (route mode, "Remove point", "Reset route") that the app does not have; the same actions exist in the Inspector and by keyboard. No context menu is wired anywhere.

…restores its own selection

Share note 56. A history entry keeps the nodes and edges as they were,
React Flow's `selected` flags included, while undo / redo set the
Inspector's `selectedNodeId` / `selectedEdgeId` to null. React Flow reports
a selection only when it changes, so:
- restored flags equal to the current ones left a connection or node
  marked that the Inspector did not show; a click on it changed nothing,
  and Delete or an arrow key acted on it (the node move also discarded the
  redo branch);
- restored flags that differed brought an old selection back from the
  history.

Undo / redo now clear every flag of the restored entry and both ids. Only
an element whose flag changes is copied; the flags are never serialized,
so it is no document change and no history entry.

The one exception is a module insert (docs/module-system.md §MS3.5): its
entries carry the selection from before the insert (undo) and the inserted
set (redo), restored as flags and ids together, however often the step is
undone and redone. The insert also clears edge flags now: a connection
selected before it stayed marked beside the inserted block with no
Inspector id, against §MS3.3 "inserted nodes, and nothing else".

Docs: large-graph-readability.md LGR-D17, module-system.md §MS3.5.

Tests:
- graphStore.undoSelection.test.ts (6): flags and ids cleared, no old
  selection back, no history entry, serialize() unchanged, unflagged
  objects kept; the module insert's undo / redo, repeatable, including a
  connection selected before it; ordinary steps around it clear.
- frameStore.test.ts: a frame undo / redo keeps the nodes / edges apart
  from the selection flags, and leaves no node selected.
- e2e/undo-redo-selection.spec.ts (5): the stale mark, the old selection,
  Delete and an arrow key after an undo, and a module insert through the
  toolbar menu with the marks matching the flags. Tests 1 to 4 fail on
  b11ff65.

Checks: tsc, lint, full vitest (3 592 passed, 1 skipped); 16 related e2e
specs on Chromium, 307 passed.
- package.json / package-lock.json 0.28.3; `.changes/undo-clears-selection.json`
  (user-facing, `release:0.28.3`, Lumi's classification 2026-10-15), date
  2026-10-15, to be checked on the merge day.
- What's new 0.28.3, three lines in 18 languages (Daisy's draft, for
  review): after Undo or Redo nothing is selected on the canvas or in the
  Inspector, so a click selects again and Delete or the arrow keys act on
  nothing hidden; Undo and Redo bring no earlier selection back; a module
  insert is the one exception, and a connection selected before it no
  longer stays highlighted. Undo / Redo / Inspector / canvas / module and
  the Delete key follow each locale's UI (Entf, Suppr, Suprimir, Canc where
  the UI names the key so). es-ES = es-419 and pt-PT = pt-BR, written
  neutrally; French avoids the punctuation its spacing rule governs. Locale
  count pins follow (catalog 1144, runtime 1366); th and vi declare the
  Latin `Delete` in the new line; the e2e release list pins 0.28.3.
- CHANGELOG v0.28.3; README Latest v0.28.3 (v0.28.2 kept as a section,
  v0.27.0 moved into the CHANGELOG list).

The translation contract tests pass: evidence of the catalogs' structure
and terms, not a review of how the lines read; no native-speaker review.
Checks: tsc, lint, full vitest (3 592 passed, 1 skipped), change
declaration, i18n, i18n surface, control bytes, isolate arguments, ICU
arguments, locale lists, functional glyphs, e2e shards, snapshot policy,
form / content direction, no pseudo-locales.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying cozy-loop-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6306c86
Status: ✅  Deploy successful!
Preview URL: https://53c31064.cozy-loop-studio.pages.dev
Branch Preview URL: https://fix-undo-clears-selection.cozy-loop-studio.pages.dev

View logs

Lumi's review of the draft (2026-10-15): the first line carried too many
results at once, and the module line's last sentence explained an internal
detail. Now four lines, in 18 languages:
- `cleared`: after Undo or Redo nothing is selected, on the canvas or in
  the Inspector (the first line, shortened);
- `hidden` (new): a connection or node no longer stays highlighted while
  the Inspector shows nothing; Delete does not remove it, and the arrow keys
  do not move a node, until you click to select it — the action named per
  key, and the arrow keys for nodes only;
- `history`: unchanged;
- `module`: the exception, without the sentence on the connection selected
  before the insert (it stays in the CHANGELOG).

Count pins follow (catalog 1145, runtime 1367); th and vi declare the Latin
`Delete` on the new line instead of the first. README Latest follows the
four lines; CHANGELOG says four lines.

No native-speaker review. Checks: tsc, lint, full vitest (3 592 passed, 1
skipped), change declaration, i18n, i18n surface, control bytes, isolate /
ICU arguments, locale lists, functional glyphs; e2e whats-new.spec.ts on
Chromium, 96 passed.
English `whatsNew.v0283.hidden` takes Lumi's wording (2026-10-15): "After
Undo or Redo, a connection or node no longer stays highlighted while the
Inspector is empty. Delete won't remove it, and the arrow keys won't move a
node until you select it." README Latest follows. The other 17 locales are
unchanged; the 16 besides English and Korean still have no native-speaker
review.

Checks: tsc, full vitest (3 592 passed, 1 skipped), i18n, i18n surface,
control bytes, functional glyphs.
@MerciHanrim
MerciHanrim merged commit b117cdb into main Oct 15, 2026
11 checks passed
@MerciHanrim
MerciHanrim deleted the fix/undo-clears-selection branch October 17, 2026 02:56
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