Follow-up to #234 (package-by-feature restructure, Phases 1–4 merged via #235–#238).
Goal
Make the per-feature domain/ logic VS Code-free: domain returns data/paths, and a single shared/editor/ adapter performs all vscode.TextDocument open/show/save. This is the highest-testability payoff of the restructure and was always slated as its own issue (per the #234 plan + maintainer review).
Why separate
The change in return types (removing vscode.TextDocument from Reader/Writer/Inject) is a semantic shift that deserves its own focus and verification cycle, not bundled into a file move.
Scope
- Introduce
shared/editor/ — an adapter owning open / show / save of vscode.TextDocument (wraps the bits currently in Dialogues/Writer).
- Change
features/*/ domain code (reader.ts, writer.ts, inject.ts) to return paths/data instead of vscode.TextDocument; commands call the editor adapter.
- Add pure-node unit tests for the domain logic (no Extension Host needed).
Prerequisite — remove remaining cross-feature edges (#234 acceptance #5)
Three edges remain after Phase 4; clean these as part of (or just before) this work:
entries → notes — LoadNotes dispatch inside loadPageForInput.
navigation → entries — prev/next commands extend the shared AbstractLoadEntryForDateCommand (move base command to shared/ or a neutral location).
smart-input → entries — Dialogues uses ScanEntries (move Dialogues/ScanEntries placement so neither feature imports the other).
Acceptance
Also pending from #234
- Docs pass:
AGENTS.md "Architecture" section + docs/PLAN.md still describe the pre-restructure layout. (Tracked separately / may land first.)
Follow-up to #234 (package-by-feature restructure, Phases 1–4 merged via #235–#238).
Goal
Make the per-feature
domain/logic VS Code-free: domain returns data/paths, and a singleshared/editor/adapter performs allvscode.TextDocumentopen/show/save. This is the highest-testability payoff of the restructure and was always slated as its own issue (per the #234 plan + maintainer review).Why separate
The change in return types (removing
vscode.TextDocumentfromReader/Writer/Inject) is a semantic shift that deserves its own focus and verification cycle, not bundled into a file move.Scope
shared/editor/— an adapter owningopen/show/saveofvscode.TextDocument(wraps the bits currently inDialogues/Writer).features/*/domain code (reader.ts,writer.ts,inject.ts) to return paths/data instead ofvscode.TextDocument; commands call the editor adapter.Prerequisite — remove remaining cross-feature edges (#234 acceptance #5)
Three edges remain after Phase 4; clean these as part of (or just before) this work:
entries → notes—LoadNotesdispatch insideloadPageForInput.navigation → entries— prev/next commands extend the sharedAbstractLoadEntryForDateCommand(move base command toshared/or a neutral location).smart-input → entries—DialoguesusesScanEntries(moveDialogues/ScanEntriesplacement so neither feature imports the other).Acceptance
grep -r "vscode" src/features/*/**/domain*(and the reader/writer/inject files) → novscodeimport.vscode.TextDocumenthandling flows throughshared/editor/.Also pending from #234
AGENTS.md"Architecture" section +docs/PLAN.mdstill describe the pre-restructure layout. (Tracked separately / may land first.)