Skip to content

Course editor with several editors: D6 undo guard, writes in order, notices kept, writes pinned to the event (review package 24) - #278

Merged
ellmkay merged 8 commits into
claude/project-thread-avzbksfrom
claude/project-thread-57uk6t
Nov 27, 2026
Merged

ellmkay merged 8 commits into
claude/project-thread-avzbksfrom
claude/project-thread-57uk6t

Conversation

@ellmkay

@ellmkay ellmkay commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Requested by Marcus · project thread

Review package 24 of docs/reviews/2026-11-full-review.md: CRS-016, CRS-018, CRS-049, CRS-050, CRS-053, CRS-065, MAP-8, MC-17 (CRS-015). Targets the course elevation branch (#254), which this package was built on.

What changes

  • D6, undo after another editor's change (CRS-016; Marcus accepted the recommended defaults 2026-11-24). Each undo entry stores the rows and tokens its write produced. An undo or redo goes through only while each row is still at that token or one this client's own writes reached from it; otherwise nothing is written, the row's entries are dropped and the notice says who changed it and when ("Lång was changed by Anna at 14:02; undo skipped"). Controls are decided field by field: a move undo still restores the position when only the description changed elsewhere, and keeps their description through later redo/undo steps. Unit = whole course, object, sheet or template; multi-row entries all or nothing.
  • Writes in order: one write per row in flight (EditorWrites.serialRow), structure edits on one queue built on the previous edit's result (CRS-018) and sent on the token they were built from (CRS-049), undo/redo serialised and picked inside a write gate (CRS-050), Layout sheet/template writes serialised and chained (CRS-053), map patch writes serialised and an older patch reply dropped (MAP-8). Positional edits that would hit another row after the structure changed say "Do it again".
  • Notices stay until answered (CRS-065): a success clears only a notice about its own row.
  • One event per editor (MC-17, CRS-015): the editor writes through a client pinned to its event, the route keys the editor on the event, and the Field-mode outbox drain stops when the editor leaves the event.
  • API: control.update also answers the re-mirrored courses' tokens, mapTemplate.applyToCourses the sheets' tokens (additive output fields). No migration.

Spec: docs/course-editor.md §3 (and Pending), docs/course-layout.md §2. Bugfix note docs/bugfixes/editor-concurrent-undo-and-writes.md; decision row 2026-11-27 in decisions/general.md. Left out and edge cases are listed in Pending "D6 edges" and the note's "Left out".

Verification (cloud)

  • Build, tsc, pnpm lint (0 errors, baseline warnings), unit: shared, api 1531, web 2780.
  • Integration: 1353 passed.
  • E2E: course-presence, course-editor, course-editor-placing, course-editor-layout, course-editor-legs, course-editor-tools, map-mode, map-gps-tracks, field-mode, course-editor-status pass. Full suite left to CI.
  • Docker images and stack bring-up: left to CI and the main checkout.
  • Reviews: five rounds of fresh spec and code reviews, final verdict ready.

Generated by Claude Code

…otices kept, writes pinned to the event (review package 24)

CRS-016 / D6: an undo entry stores the rows and tokens its write produced;
undo and redo go through only while each row is still as this client left
it, sent on that token and never rebased; otherwise skipped with a notice
and the row's entries dropped. Controls: the server decides; a move undo
keeps a description changed elsewhere.
CRS-018 / CRS-049: structure edits on one queue, sent on the token of the
structure they were built from.
CRS-050: undo / redo serialised in UndoStack.
CRS-053: Layout sheet and template writes through EditorWrites.writeRow.
CRS-065: a success clears only a notice about its own row.
MAP-8: patch writes serialised; setMapPatch drops older deliveries.
MC-17 / CRS-015: editor writes through trpcClientForEvent, the page keyed
on the event, the outbox drain stops once the editor left the event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
…tokens of other procedures, positional edits

- Undo / redo steps run alone behind a WriteGate; ordinary writes and structure
  edits share it, so the D6 guard sees only the step's writes.
- Control undos decided field by field (an own radio toggle or restore never
  blocks them); an undo deleting a created control is skipped when another
  course visits it.
- control.update answers a kind change's re-mirrored course tokens,
  mapTemplate.applyToCourses the sheets it moved; the editor links them and
  the setter procedures' sheets as its own (adoptOwn).
- Every non-Field entry is guarded; checkControl queues with the control.
- Positional structure edits queued behind a write are refused when the
  structure changed; an edit of a course no longer selected is dropped.
- Layout keeps the newest gesture's snapshot until its own reply.
- Redo-skipped wording, spec and Pending lines, tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
…sture chain, positional edits, undo picks inside the gate

- Map mode's follow-up writes and structure edits run ungated inside a gated write (track conversion undo no longer waits on itself)
- UndoStack picks its entry inside the write gate
- Layout writeRow sends on the own chain from the snapshot's token (a gesture behind a refused one is refused)
- A control undo passed by the field rule links the chain with the bridged fields
- Create variation, move to alternative, routed crossing and placement inserts are positional
- control.update reads re-mirrored course seqs once
- Docs: write gate, controls, Pending, bugfix note, decision row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
…picks after the gesture records, Do it again deletes the placed control

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
…as its course

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
… by root, own edits no exemption), autoDescribe left out with the description, Do it again keeps the control when its delete fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
…do even on an own root token

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DoDZu3PSsVQPwVv4AkjBs
@ellmkay ellmkay self-assigned this Nov 27, 2026
@ellmkay
ellmkay merged commit 7aa7913 into claude/project-thread-avzbks Nov 27, 2026
13 checks passed
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.

2 participants