From b41e5b74df0a979da65bf7d42533e2724068f671 Mon Sep 17 00:00:00 2001 From: Michael Ramos Date: Tue, 15 Sep 2026 08:43:42 -0700 Subject: [PATCH] fix(editor): default the plan diff view to Classic The block-level stacked view is the default again; the word-level Rendered view stays available as an option beside Raw. --- AGENTS.md | 5 +++-- packages/editor/App.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 688cc9eb7..3b2d1654f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -830,8 +830,9 @@ When a user denies a plan and Claude resubmits, the UI shows what changed betwee **Diff engine** (`packages/ui/utils/planDiffEngine.ts`): Uses the `diff` npm package (`diffLines()`) to compute line-level diffs. Groups consecutive remove+add into "modified" blocks. Returns `PlanDiffBlock[]` and `PlanDiffStats`. -**Two view modes** (toggle via `PlanDiffModeSwitcher`): -- **Rendered** (`PlanCleanDiffView`): Color-coded left borders — green (added), red (removed/strikethrough), yellow (modified) +**Three view modes** (toggle via `PlanDiffModeSwitcher`; `planDiffMode` in `packages/editor/App.tsx` defaults to `classic`): +- **Classic** (`PlanCleanDiffView`, block-level, old above new): Color-coded left borders — green (added), red (removed/strikethrough), yellow (modified). The default. +- **Rendered** (`PlanCleanDiffView` with `wordLevel`, experimental): the same view with word-level inline highlighting. - **Raw** (`PlanRawDiffView`): Monospace `+/-` lines, git-style **State** (`packages/ui/hooks/usePlanDiff.ts`): Manages base version selection, diff computation, and version fetching. The server sends `previousPlan` with the initial `/api/plan` response; the hook auto-diffs against it. Users can select any prior version from the sidebar Version Browser. diff --git a/packages/editor/App.tsx b/packages/editor/App.tsx index e20b90f2a..cbaefa155 100644 --- a/packages/editor/App.tsx +++ b/packages/editor/App.tsx @@ -670,7 +670,7 @@ const App: React.FC = () => { const [initialExportTab, setInitialExportTab] = useState<'share' | 'annotations' | 'notes'>(); const [isPlanDiffActive, setIsPlanDiffActive] = useState(false); - const [planDiffMode, setPlanDiffMode] = useState('clean'); + const [planDiffMode, setPlanDiffMode] = useState('classic'); const [previousPlan, setPreviousPlan] = useState(null); const [versionInfo, setVersionInfo] = useState(null); const [aiSessionEnabled, setAISessionEnabled] = useState(false);