From eded43c9b8abae13be28255464489a02b41a0a23 Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Tue, 30 Jun 2026 09:23:50 +1000 Subject: [PATCH 01/23] chore(porch): 1107 init pir --- .../status.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codev/projects/1107-vscode-replace-top-of-window-q/status.yaml diff --git a/codev/projects/1107-vscode-replace-top-of-window-q/status.yaml b/codev/projects/1107-vscode-replace-top-of-window-q/status.yaml new file mode 100644 index 000000000..9cbb2ef57 --- /dev/null +++ b/codev/projects/1107-vscode-replace-top-of-window-q/status.yaml @@ -0,0 +1,18 @@ +id: '1107' +title: vscode-replace-top-of-window-q +protocol: pir +phase: plan +plan_phases: [] +current_plan_phase: null +gates: + plan-approval: + status: pending + dev-approval: + status: pending + pr: + status: pending +iteration: 1 +build_complete: false +history: [] +started_at: '2026-06-29T23:23:50.850Z' +updated_at: '2026-06-29T23:23:50.851Z' From 907ed56b883ac09de961ea5c9cb138781a2b09bb Mon Sep 17 00:00:00 2001 From: Amr Elsayed Date: Tue, 30 Jun 2026 09:29:08 +1000 Subject: [PATCH 02/23] [PIR #1107] Plan draft: inline composer for preview-pane review comments --- .../1107-preview-inline-comment-composer.md | 194 ++++++++++++++++++ codev/state/pir-1107_thread.md | 36 ++++ 2 files changed, 230 insertions(+) create mode 100644 codev/plans/1107-preview-inline-comment-composer.md create mode 100644 codev/state/pir-1107_thread.md diff --git a/codev/plans/1107-preview-inline-comment-composer.md b/codev/plans/1107-preview-inline-comment-composer.md new file mode 100644 index 000000000..2eb9ef72b --- /dev/null +++ b/codev/plans/1107-preview-inline-comment-composer.md @@ -0,0 +1,194 @@ +# Plan — #1107: Inline composer for preview-pane review comments + +> PIR plan. The GitHub issue (#1107) is the implicit spec. This document is the +> **plan-approval** artifact: how the change is built, where it lands, the risks, +> and the test plan. Reviewed before any code is written. + +## Understanding + +Adding a review comment from the Codev Markdown Preview +(`codev.openMarkdownPreview`) currently collects the comment body with +`vscode.window.showInputBox` — rendered in VS Code's center-top Quick Pick +chrome, physically far from the block the user clicked `+` on. The cognitive +distance between the block being commented on and the input box is the friction +the issue targets. The issue recommends **Option A**: render an inline composer +in the webview/canvas itself, co-located with the block, so the visual anchor is +preserved end-to-end while typing. + +What the codebase already gives us: + +- `packages/artifact-canvas/src/components/ArtifactCanvas.tsx` is the shared React + canvas. It already renders a React overlay **anchored at the active block's + vertical center** (`overlayTop`, set in `activateFromTarget`). Today that + overlay carries only the `CommentAffordance` (`+`) button, which calls + `onAddComment(line)` — the intent-only seam (spec 945 D6). The host then runs + the text input and write-back. +- The marker-card stack (existing comments) is injected imperatively into the + innerHTML-managed body. The overlay, by contrast, is **React-owned** — which is + exactly where an interactive composer belongs (clean state / focus / Esc, no + "cards flash then vanish" re-render hazard). +- `packages/core/src/review-markers.ts` `serializeReviewMarker` **already + normalizes the body to a single line** (`body.replace(/\s+/g, ' ').trim()`). So + a multi-line composer is purely an input ergonomics improvement; the on-disk + marker form is unchanged. **No marker-format change is in scope** — #1055 owns + the v2 format. Newlines typed in the composer collapse to spaces on write, + matching today's single-line `` convention. + +So the work is: move the text input from the host's Quick Pick into a +React composer in the canvas overlay, and widen the comment-intent seam to carry +the collected text. + +## Proposed change + +### 1. New composer component (artifact-canvas package) + +Add `packages/artifact-canvas/src/overlays/CommentComposer.tsx`: a small +React component — a `