Skip to content

build(deps): update the app's npm packages; remake the @codemirror/view patch for 6.43.15 - #139

Merged
bketelsen merged 2 commits into
mainfrom
irulan/app-npm-updates
Nov 7, 2026
Merged

bketelsen merged 2 commits into
mainfrom
irulan/app-npm-updates

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Dependabot's npm update fails on main with ERR_PNPM_UNUSED_PATCH: it moves @codemirror/view to 6.43.15, and app/pnpm-workspace.yaml still names the patch for 6.43.13. This PR moves the package itself, with the patch remade, and takes the rest of Dependabot's app-npm group (#135, which it replaces).

  • The patch stays. @codemirror/view 6.43.15 (the latest) still walks every node of the height map on every measure (HeightMapBranch.updateHeight), the cost ADR-0025 patches. app/patches/@[email protected] is the same change as the 6.43.13 patch: a branch visits a child that is not measured only when it is forced or outdated. Only the line offsets differ.
  • New test: app/src/editor/heightmap-patch.test.ts reads the installed dist/index.js and dist/index.cjs and fails when either lacks the patch. Before, nothing but pnpm's own check held it, and that check passes when the patch is dropped.
  • The other 23 updates are build(deps): bump the app-npm group across 1 directory with 24 updates #135's versions. The lockfile is deduplicated: build(deps): bump the app-npm group across 1 directory with 24 updates #135 installed @lezer/common 1.5.3 and 1.5.5 side by side, and the typecheck failed on the 2 types.
  • @types/node stays on Node 24 (24.19.2, not 26): the app and CI run Node 24 (NODE_VERSION in ci.yml). .github/dependabot.yml now ignores its majors.
  • happy-dom 21 fires selectionchange at once, inside the call that moves the selection, and again for a new range at the same points. Fired at once, it reaches CodeMirror inside an update, which CodeMirror refuses ("Calls to EditorView.update are not allowed while an update is in progress"); 5 editor tests in MainWindow.test.tsx and editing.test.tsx failed. app/src/testing/setup.ts queues the event, as a browser does (Selection API), and fires it only when the selection moved. Queuing alone loops: the editor sets the same selection again, and happy-dom fires again. happy-dom's dispatch calls dispatchEvent again on each target of the event's path, so the event being delivered passes straight through. app/src/testing/setup.test.ts tests the guard: the event comes after the call, not inside it; once for a new range at the same points; for a move, a reversed selection and a cleared one; other events at once.
  • Biome 2.6: 2 unused type imports removed, 1 optional chain (app/src/spike/drive.tsx).
  • packaging/flatpak/node-sources.json is regenerated.

Replaces #135.

Risk tier

Risk tier: 2 — a runtime dependency update of the app (React, CodeMirror, KaTeX, DOMPurify, Tauri's API) and a test-setup change. No path in .github/risk-paths.json changes.

Verification

  • make verify green (host)
  • make ui-check green (nsl): 104 files, 846 tests
  • make app-build, make app-test (40 tests) and make web-build green (nsl)
  • make flatpak-sources run: only node-sources.json changes
  • Revert test for the patch's test: in a scratch worktree of d3b62dc, with the patch file and its patchedDependencies entry removed, corepack pnpm install --no-frozen-lockfile && corepack pnpm exec vitest run src/editor/heightmap-patch.test.ts fails both cases (is applied to dist/index.js, is applied to dist/index.cjs) on expect(source).toContain("else if (force || left.outdated)").
  • Revert test for the happy-dom guard: with app/src/testing/setup.ts as on main, vitest run fails 5 tests (saves what is typed in a note's editor, runs Obsidian's keys on the editor, follows with Alt+Enter…, completes a link to a note and its heading, completes a block ID and a tag) with the CodeMirror error above; and vitest run src/testing/setup.test.ts fails 2 tests (fires after the call that moved the selection, not inside it: 1 event inside the call; fires once for a new range at the same points: 2 events). With the guard of d3b62dc, which swallowed every event, 3 of its tests fail (0 events).
  • .memory/corrections.jsonl: 1 line for the swallowed events (found by the cross-review of d3b62dc).

…ew patch for 6.43.15

@codemirror/view 6.43.15 still walks the whole height map on every
measure, so the patch of ADR-0025 is remade for it, unchanged but for its
offsets. Dependabot could not move the package: pnpm stops with
ERR_PNPM_UNUSED_PATCH while patchedDependencies names 6.43.13. A new
test, src/editor/heightmap-patch.test.ts, fails when the installed
package lacks the patch.

The other 23 updates are Dependabot's app-npm group (#135), deduplicated
so @lezer/common has 1 version; 2 copies of it failed the typecheck.
@types/node stays on 24 (24.19.2), the Node major the app runs on, and
Dependabot now skips its majors.

happy-dom 21 fires selectionchange at once, inside the call that moves
the selection, and again for a new range at the same points. Fired at
once it reaches CodeMirror inside an update, which CodeMirror refuses
(5 editor tests failed). The test setup queues the event, as a browser
does, and fires it only when the selection moved. Biome 2.6 removes 2
unused imports and asks for an optional chain.

packaging/flatpak/node-sources.json is regenerated (make flatpak-sources).
…s guard

happy-dom's dispatch calls dispatchEvent again on each target of the
event's path. The guard in src/testing/setup.ts wrapped
document.dispatchEvent, so that second call queued the event again and
no listener ever got a selectionchange: the editor tests passed without
the editor reading a single selection change. The event being delivered
now passes straight through.

src/testing/setup.test.ts checks the guard: the event comes after the
call that moved the selection, not inside it; once for a new range at
the same points; for a move, a reversed selection and a cleared one;
and other events are dispatched at once.
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Cross-review: Ready after 1 re-review, blocking: none.

  • Reviewer: openai/gpt-6.1-sol. Coders: github-copilot/mai-code-2-flash (versions, lockfile, Biome fixes, heightmap-patch.test.ts, dependabot.yml) and Irulan on Claude Opus (the patch, the setup.ts guard, setup.test.ts).
  • Base 5909f09133d353be41aaabc16510e08b03fb9d7e. First pass at d3b62dcb210c2e81e21ee1b2e1e4dc072049593c; re-review of d3b62dc..214ddc8fb105671397cd8e16d9c4290a8e0dd8af.
  • First pass: the patch matches the old change exactly and applies to unpatched 6.43.15 with exact context; the patch test reads the package the app imports; 1 @lezer/common (1.5.5); the patch hash key matches the file; the dependabot.yml ignore is valid; KaTeX 0.19's strict change only warns with the app's options. 1 low finding: nothing tested that the selectionchange guard delivers events.
  • That finding hid a real defect: happy-dom's dispatch calls dispatchEvent again on each target of the path, so the guard swallowed every selectionchange. 214ddc8 passes the event it is delivering straight through and adds src/testing/setup.test.ts, plus 1 .memory/corrections.jsonl line. The re-review found no new findings.
  • Excluded from line review: app/pnpm-lock.yaml, packaging/flatpak/node-sources.json (generated; checked as above, and CI's Flatpak sources job regenerates and compares the node sources).
  • All checks pass at 214ddc8. Revert tests: in the PR body.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 7, 2026
@bketelsen
bketelsen merged commit 190c8ef into main Nov 7, 2026
11 checks passed
@bketelsen
bketelsen deleted the irulan/app-npm-updates branch November 7, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants