Skip to content

Commit 13b8a80

Browse files
pajomaclaude
andcommitted
docs: fold #239 review into plan
Command-layer NoteInput dispatch (no noteLoader callback), plain-data edit structs for IEditor.applyEdit (no vscode.TextEdit leak), and a vscode-excluded src/test/unit env. Per maintainer review on #239. Refs #239. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ebeb215 commit 13b8a80

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/plans/2026-06-02-239-vscode-free-domain.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Five staged steps, each test-green and independently shippable. Edges first (che
1414
### Step 1 — Remove cross-feature edges
1515
- **smart-input → entries:** move `Dialogues` to `shared/` (it is a generic UI service, already used broadly) OR move `ScanEntries` to `shared/`. Prefer moving `Dialogues``shared/dialogues/` since it implements `IDialogues` (a shared interface). Re-point `Container`.
1616
- **navigation → entries:** move `AbstractLoadEntryForDateCommand` to `shared/commands/` (or `features/entries` export consumed only via a shared base). Navigation extends the shared base.
17-
- **entries → notes:** in `loadPageForInput`, replace the direct `new LoadNotes(...)` branch with a note-input handler resolved from the `JournalController` (register a `noteLoader` in the container, or move the `NoteInput` branch up into the command-registration layer). Entries no longer imports `notes`.
17+
- **entries → notes:** push the `NoteInput` branch up into the command layer (`ShowEntryForInputCommand`) — the command is the right place to orchestrate between features by `Input` type. Entries' `loadPageForInput` handles only entry/week/selected inputs; the command dispatches `NoteInput` to `notes`. No generic `noteLoader` callback (maintainer rec, #239 review). Entries no longer imports `notes`.
1818
- Verify: cross-feature grep (the #234 Phase-4 script) returns zero edges; suite green.
1919

2020
### Step 2 — `shared/editor/` adapter
2121
- Add `IEditor` to `shared/model/interfaces.ts`: `open(path)`, `show(doc)`, `save(doc)`, `createAndOpen(path, content)`, `applyEdit(doc, edits)` / `insert(doc, position, text)`.
22+
- `applyEdit` takes **plain-data** edits — `{ range: { start: { line, character }, end: { line, character } }, text }` — never `vscode.TextEdit`/`vscode.Range`/`vscode.Position`, so no editor types leak into the pure domain (maintainer rec, #239 review). The adapter converts plain data → `vscode.WorkspaceEdit` internally. Position computation in Step 4 returns the same `{ line, character }` shape.
2223
- Implement `EditorAdapter` in `shared/editor/`, moving the bodies from `Dialogues.openDocument/showDocument/saveDocument`, `Writer.createSaveLoadTextDocument`, and `Inject.injectString/injectInlineString`.
2324
- Add `editor: IEditor` to `JournalController` + `Container`.
2425
- Verify: suite green (behavior identical; just relocated).
@@ -37,6 +38,7 @@ Five staged steps, each test-green and independently shippable. Edges first (che
3738

3839
### Step 5 — Node-only unit tests
3940
- Add `src/test/unit/` (plain node, not Extension Host) covering: path resolution (`PathResolver`), `buildInlineString`, position computation, `inferType`.
41+
- The `src/test/unit/` env must **exclude `vscode`** (no `vscode` import in unit specs or their imports) so a future accidental re-coupling fails the node run instead of silently pulling the host shim (maintainer rec, #239 review). Add a guard (lint override or a smoke check that `require('vscode')` is never reached).
4042
- Wire into the test pipeline (separate `node --test` or extend compile-tests + a node runner). Document the command in AGENTS.md.
4143
- Verify: node-only tests pass without a display; full Extension-Host suite still green.
4244

0 commit comments

Comments
 (0)