feat(v3): D4 Milestone 4 — import-mode beforeunload guard + docs (v0.17)#86
Merged
Conversation
Final D4 (cross-library import) milestone: polish + documentation. - beforeunload now warns on `dirty || importMode` — an accidental tab close mid-import would lose the uncommitted staging buffer. Tracked separately from `dirty` because entering import mode intentionally does not mark the doc dirty (design §7); only a successful commit does. - CLAUDE.md: new "v3 Experiment Designer — D4 Cross-Library Import" reference section (module split, v3-import.js API, anchor-namespace/plugin-merge rule, commitStaging atomicity + no-pushUndo contract, import-mode UI + locking, test suites, out-of-scope list). Documents the importMode-guard rule for future mutation handlers. - v3-editor-handoff-2.md: mark D4 shipped (M1–M3 merged via #84/#85), refresh header/TL;DR/shipped table/Tier 4, record that the applySequenceEdit reducer refactor was NOT needed (staging stayed self-contained). - Footer v0.16 → v0.17. Completes the D4 Definition of Done (handoff §9). npm test green (arena 10 · v2 137 · v3 576). Browser-verified the beforeunload guard fires in import mode and clears on cancel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What this is
Milestone 4 of D4 (cross-library import) — the final piece: polish + docs.
Completes the D4 Definition of Done (handoff §9). Targets
maindirectly(M1–M3 already merged via #84/#85).
Changes
beforeunloadguard during import mode (experiment_designer_v3.html):warns on
dirty || importMode, so an accidental tab-close mid-import — whenthe staging buffer is built but not yet committed — prompts before losing it.
Tracked separately from
dirtybecause entering import mode intentionally doesnot mark the document dirty (design §7); only a successful commit does.
Browser-verified: fires during import, silent before/after.
Cross-Library Import": module split (
v3-import.js), the staging API, theanchor-namespace / plugin-merge-by-default rule, the
commitStagingatomicity +no-
pushUndocontract, the import-mode UI + locking (incl. the rule that newmutation handlers need an
importModeguard), the test suites, and theout-of-scope list.
v3-editor-handoff-2.md— marked D4 shipped: header/TL;DR/shipped-table/Tier 4 refreshed; records that the
applySequenceEditreducer refactor wasnot needed (the staging buffer stayed self-contained and commits via the
documented node primitives).
Tests
D4 status after this merges
M1 (#84) · M2 (#84) · M3 (#85) · M4 (this) → D4 v1 complete. Future v1.1
candidates (design §12): sequence/block-membership import, multi-doc YAML
streams, pattern-path validation, per-anchor "merge with existing" toggle.
🤖 Generated with Claude Code