diff --git a/docs/acceptance/workspace-markdown-preview-20261022/README.md b/docs/acceptance/workspace-markdown-preview-20261022/README.md new file mode 100644 index 00000000..8dc19b2b --- /dev/null +++ b/docs/acceptance/workspace-markdown-preview-20261022/README.md @@ -0,0 +1,16 @@ +# Workspace Markdown preview + +Captured in Chrome at 1440 × 1000 using the production renderer and the `workbenchjourney` production API harness, with its offline model provider and a disposable project. The harness was restarted after rebuilding because it loads the UI bundle at startup. + +Both captures open the same 657-byte `preview-notes.md` sample from Workspace files. It contains headings, a list, a table, a fenced code block, an HTTPS link, and a relative file link. Its returned content digest begins with `6d5357a52d91` in both captures. + +- **Before** (`5892e371bea0a20596d9684ecd1778049a143700`, PR #442): the file is available only as numbered Markdown source. +- **After** (this PR): selecting Preview shows formatted content. Source remains the initial view. +- Searching for `PREVIEW_SEARCH_MARKER` while previewing and clicking its result returned to Source, highlighted line 24, and displayed the position notice. +- The preview's HTTPS link retained `target="_blank"` and `rel="noreferrer noopener"`; the relative file link rendered as an inert span. + +These are unmodified browser screenshots. + +![Before: Markdown source only](before-markdown-source.png) + +![After: formatted Markdown preview](after-markdown-preview.png) diff --git a/docs/acceptance/workspace-markdown-preview-20261022/after-markdown-preview.png b/docs/acceptance/workspace-markdown-preview-20261022/after-markdown-preview.png new file mode 100644 index 00000000..07a8c6b7 Binary files /dev/null and b/docs/acceptance/workspace-markdown-preview-20261022/after-markdown-preview.png differ diff --git a/docs/acceptance/workspace-markdown-preview-20261022/before-markdown-source.png b/docs/acceptance/workspace-markdown-preview-20261022/before-markdown-source.png new file mode 100644 index 00000000..dfafbfad Binary files /dev/null and b/docs/acceptance/workspace-markdown-preview-20261022/before-markdown-source.png differ diff --git a/docs/acceptance/workspace-search-line-20261022/README.md b/docs/acceptance/workspace-search-line-20261022/README.md new file mode 100644 index 00000000..247e9d06 --- /dev/null +++ b/docs/acceptance/workspace-search-line-20261022/README.md @@ -0,0 +1,14 @@ +# Workspace search line navigation + +Captured in Chrome at 1440 × 1000 using the production renderer and the `workbenchjourney` production API harness, with its offline model provider and disposable project. + +The temporary project contained a 120-line `search-example.txt`; line 90 contained `SEARCH_HIT_90`. Both captures follow the same interaction: open workspace files, search for the marker, then click its result. + +- **Before** (`fc0935d6fc03ca7abccbd148ce52d26c2bc154f8`): the file opened at the top without a highlighted line; the file scroll position was 0. +- **After** (`0567844fddc33093c61d5093149e8767e39db164`): line 90 was highlighted and visible, with the position notice; the file scroll position was 2702. + +These are unmodified browser screenshots. The harness was restarted after rebuilding because it loads the UI bundle at startup. + +![Before: search result opens at the top](before-open-hit.png) + +![After: search result opens at matching line 90](after-open-hit.png) diff --git a/docs/acceptance/workspace-search-line-20261022/after-open-hit.png b/docs/acceptance/workspace-search-line-20261022/after-open-hit.png new file mode 100644 index 00000000..1ac01c22 Binary files /dev/null and b/docs/acceptance/workspace-search-line-20261022/after-open-hit.png differ diff --git a/docs/acceptance/workspace-search-line-20261022/before-open-hit.png b/docs/acceptance/workspace-search-line-20261022/before-open-hit.png new file mode 100644 index 00000000..6ac46fa3 Binary files /dev/null and b/docs/acceptance/workspace-search-line-20261022/before-open-hit.png differ diff --git a/docs/acceptance/workspace-search-retry-20261022/README.md b/docs/acceptance/workspace-search-retry-20261022/README.md new file mode 100644 index 00000000..ec4b6c85 --- /dev/null +++ b/docs/acceptance/workspace-search-retry-20261022/README.md @@ -0,0 +1,12 @@ +# Workspace search retry + +Baseline: `b6e89e8c481bb38293d584a9204b36916528c834` (#448). + +Both PNGs are unmodified 1440 × 1000 Chrome captures of the production renderer and API served by `cmd/workbenchjourney`. The harness uses a disposable workspace and an offline model; `retry-notes.md` is a temporary document containing `SEARCH_RECOVERY_PROOF`. + +For each capture, only the browser's workspace-search requests were temporarily aborted. After the error appeared, the interruption was removed and a direct request confirmed that the real API returned HTTP 200 with the expected file. No API response was replaced. + +- `before-retry-stuck.png`: clicking Search again with the unchanged keyword sends no request and leaves the error visible. +- `after-retry-recovers.png`: the same action sends a request, receives HTTP 200, and displays the result without editing the keyword. + +The button and Enter regression cases both fail against the baseline and pass with the fix. The Explorer and Markdown preview suites pass together (21 tests); TypeScript and the production build pass. OCR completed the changed production component with zero findings; its default path rules exclude test files. diff --git a/docs/acceptance/workspace-search-retry-20261022/after-retry-recovers.png b/docs/acceptance/workspace-search-retry-20261022/after-retry-recovers.png new file mode 100644 index 00000000..fdccf402 Binary files /dev/null and b/docs/acceptance/workspace-search-retry-20261022/after-retry-recovers.png differ diff --git a/docs/acceptance/workspace-search-retry-20261022/before-retry-stuck.png b/docs/acceptance/workspace-search-retry-20261022/before-retry-stuck.png new file mode 100644 index 00000000..dc6cb2f7 Binary files /dev/null and b/docs/acceptance/workspace-search-retry-20261022/before-retry-stuck.png differ diff --git a/web/src/components/workspace-explorer-preview.test.tsx b/web/src/components/workspace-explorer-preview.test.tsx new file mode 100644 index 00000000..3ccd25b2 --- /dev/null +++ b/web/src/components/workspace-explorer-preview.test.tsx @@ -0,0 +1,152 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen, waitFor, within } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import type { APIClient } from "../api/client"; +import type { WorkspaceExplorerView } from "../api/types"; +import { V2RecoveryProvider } from "../v2/recovery-storage"; +import { FileEditDraftProvider } from "./file-edit-drafts"; +import { WorkspaceExplorer } from "./workspace-explorer"; + +vi.mock("@monaco-editor/react", () => ({ + default: ({ value, onChange }: { value: string; onChange: (value: string) => void }) => +