feat(notebook): make addCell and deleteCell optimistic#542
Merged
Conversation
Move cell mutations to fire-and-forget: React state updates before invoke(), eliminating user-visible IPC latency. addCell: generate UUID via crypto.randomUUID() on the frontend, construct NotebookCell locally, pass cellId to backend. Backend add_cell command accepts optional cell_id parameter. deleteCell: move last-cell guard to frontend, fire-and-forget the backend sync. Backend delete_cell returns Ok(()) instead of Err when the cell is last or not found. Convergence is maintained by the existing notebook:updated listener which does a full setCells() from the Automerge doc on every sync broadcast.
rgbkrk
added a commit
that referenced
this pull request
Mar 5, 2026
45 tasks
rgbkrk
added a commit
that referenced
this pull request
Mar 6, 2026
11 tasks
rgbkrk
added a commit
that referenced
this pull request
Mar 6, 2026
…e architecture Update 12 files across AGENTS.md, README, contributing/, and docs/ to reflect the local-first Automerge migration (PRs #542-#554): - AGENTS.md: add Notebook Document Architecture section (WASM peers, mutation flow, sync flow), update key files table, add runtimed-wasm build note - README.md: add runtimed-wasm to project structure - contributing/architecture.md: conformance table now fully Conformant - contributing/build-dependencies.md: add runtimed-wasm to all three Mermaid diagrams and key points table - contributing/development.md: add wasm-pack manual build note - contributing/runtimed.md: cross-reference runtimed-wasm shared code - docs/runtimed.md: rewrite Phase 5 for actual local-first architecture, fix stale Known Limitations, update summary table - docs/python-bindings.md + python/runtimed/README.md: add session.save() - docs/logging.md: fix stale log prefixes - useDaemonKernel.ts: fix stale comment (notebook:updated → automerge:from-daemon)
rgbkrk
added a commit
that referenced
this pull request
Mar 6, 2026
…e architecture (#560) Update 12 files across AGENTS.md, README, contributing/, and docs/ to reflect the local-first Automerge migration (PRs #542-#554): - AGENTS.md: add Notebook Document Architecture section (WASM peers, mutation flow, sync flow), update key files table, add runtimed-wasm build note - README.md: add runtimed-wasm to project structure - contributing/architecture.md: conformance table now fully Conformant - contributing/build-dependencies.md: add runtimed-wasm to all three Mermaid diagrams and key points table - contributing/development.md: add wasm-pack manual build note - contributing/runtimed.md: cross-reference runtimed-wasm shared code - docs/runtimed.md: rewrite Phase 5 for actual local-first architecture, fix stale Known Limitations, update summary table - docs/python-bindings.md + python/runtimed/README.md: add session.save() - docs/logging.md: fix stale log prefixes - useDaemonKernel.ts: fix stale comment (notebook:updated → automerge:from-daemon)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 0 of the local-first Automerge migration: eliminate user-visible latency for cell mutations.
addCellanddeleteCellnow update React state immediately and fire-and-forget the backend sync. The existingnotebook:updatedAutomerge broadcast acts as the convergence backstop.Changes
addCell— UUID generated on frontend viacrypto.randomUUID(), cell constructed locally,invokeis fire-and-forget. Backendadd_cellcommand accepts an optionalcell_idparameter.deleteCell— last-cell guard moved to frontend,invokeis fire-and-forget. Backenddelete_cellreturnsOk(())instead ofErrwhen the cell can't be deleted.Testing