Repository navigation
Description
Outcome
Reconstruct R4's grouped unified diffs and right-hand file tree inside the split Code Review workspace. Every displayed patch, expanded context and future comment anchor must refer to the selected remote PR revision, never the user's unrelated local working tree.
Parent: #319. Blocked by accepted artifacts: #321's file/patch/context reads and #322's Changes/split host; shared identities and reference fixtures come from #320. Can proceed in parallel with #323. Produces revision/line anchors and bounded evidence for CR-6/7.
Verified starting point / proposed files
Read current AGENTS.md, current main/open PRs and #320's source map. Audit baseline cb33db5df00e235f68d36b5fac556dc30e0851f2 contains apps/desktop/src/renderer/components/ChangesPanel.tsx with exported Diff, FileIcon, FileGroup, folding, wrap/highlight options and LOCAL Discard controls. apps/desktop/src/main/engine/git.ts supplies local filesystem operations. Reuse pure presentation only; do not pass remote paths or PR identifiers into local diff/discard handlers.
Proposed additions when no equivalent exists: apps/desktop/src/renderer/components/code-review/PrChanges.tsx, a focused pure patch model beside it or in the existing shared diff module, apps/desktop/test/code-review-diff.test.ts, and apps/desktop/e2e/code-review-diff.spec.ts. Confirm placement before implementation. No Monaco/editor-library migration unless measured need and an explicit reviewed decision justify it.
Items to do
- Write failing parser/model tests for multiple hunks, added/deleted/renamed files, old/new line numbering, empty files, no-final-newline markers, Unicode/space-containing paths, binary files and omitted/truncated patches. Preserve both old and new paths and diff sides where required.
- Define a revision-bound file identity and line anchor using [CR-1][P1] Establish the Code Review reference contract and deterministic fixtures #320's
PrKey/PrRevision, validated path, side and line/range. Old anchors become outdated when the head changes; never silently reinterpret them on a new revision. - Extract or adapt the smallest pure rendering layer from the existing Changes presentation. Give remote views no Discard/revert/local-open capability. Preserve local Changes behavior with regression tests before and after extraction.
- Render multiple file sections with compact headers, additions/deletions, collapsed unchanged-context rows and a filterable hierarchical file navigator. File selection scrolls to the correct section without losing the user's overall position; support independently scrollable diff and tree, wrapping and collapsed file state.
- Fetch bounded extra context at the exact remote base/head revisions. Render cancellation/retry and stale responses correctly. Never read a same-named local file as a convenient fallback, execute a repo hook, checkout the branch or apply a patch to show it.
- Represent binary, unavailable, oversized and provider-truncated data explicitly. Distinguish total provider counts from the subset currently rendered or loaded. A missing patch is not a zero-line change. Provide a validated Open in GitHub fallback where useful.
- Bound fetching, parsing and mounted content. Begin with lazy per-file loading and measured limits; introduce virtualization only where needed while preserving selection, keyboard access and line anchors. Record behavior on synthetic large-file and many-file fixtures rather than asserting performance from a small screenshot.
- Keep filenames/code inert and path-direction handling understandable. Add keyboard file navigation, visible focus and accessible add/remove/context labels; color alone must not encode the change type.
Acceptance criteria
- AC1: R4's overview-plus-grouped-diff arrangement, file tree, context folds and selected-file behavior work through actual controls and match approved reference geometry.
- AC2: parser and anchor fixtures prove correct old/new line references for additions, deletions, renames and missing final newlines. Expanding context preserves those references.
- AC3: changing PR/account/head during a delayed patch request cannot overwrite the current view. Old review/comment anchors remain explicitly outdated.
- AC4: no remote diff action can call local Discard, read an arbitrary workspace path or execute code. Existing local Changes/discard tests still pass.
- AC5: binary/omitted/oversized/truncated responses remain distinguishable and disclose incomplete coverage; no invented code or false zero counts.
- AC6: keyboard and narrow-window navigation work; measured stress runs establish bounded requests/DOM/memory and record latency on a named environment. Any agreed performance budget is documented and enforced by an appropriate regression test.
Validation / handoff
Run the focused Node patch/anchor tests, local Changes regressions and Electron Playwright tests, then pnpm build && pnpm test and pnpm test:e2e. Use synthetic stress cases such as 1,000 files and a 3 MiB textual patch as test inputs, not claims about GitHub's API limits. Document chosen product limits and the actual endpoint's current limits separately. Record exact SHA, screenshots, timings, coverage limitations and commands in docs/reviews/; update docs/status.md. Do not auto-accept goldens or merge.
Sources: #319, the verified ChangesPanel/git entry points, GitHub PR API, Playwright snapshots.
Long-running goal prompt
Implement CR-5 for #319 in TypeSafeAI/modex after reading #320/#321/#322, current source, open PRs and scoped AGENTS.md. Verify the owned worktree and current main. Start with failing patch/anchor and local Changes regression tests. Reuse the smallest pure part of ChangesPanel to build a read-only, revision-bound remote diff with grouped file sections, a filterable file tree and bounded context expansion. Keep remote PR paths out of local filesystem/discard handlers. Treat binary, omitted and truncated patches honestly, reject stale responses, and preserve old/new side-and-line anchors across rendering. Do not migrate editors, execute PR code, checkout branches, apply patches or call providers. Measure large-data behavior and inspect R4 plus keyboard/narrow layouts. Work in small tested slices; checkpoint full SHA, changed files, commands/results, evidence, limits and one next action. Finish with a signed reviewable PR and criterion-level proof, not visual similarity alone. Do not merge or release.
Follow-up / resume prompt
Resume CR-5 by verifying worktree ownership, live issue/PR state and the actual diff. Rerun patch/anchor and local Changes smoke tests. Confirm the producer contract and selected remote revision before using cached content or previous findings. Continue the smallest missing acceptance item, concentrating on stale responses, incomplete patches and source/line accuracy. Preserve unrelated shell changes and avoid broad refactors. Keep performance numbers tied to a named environment and fresh SHA; update evidence and the next action without automatic golden acceptance or merge.
Independent review prompt
Independently test renamed/deleted files, no-final-newline hunks, omitted/binary patches and head changes while context loads. Try remote filenames that resemble local paths and verify no filesystem mutation or fallback occurs. Check line anchors, keyboard navigation, measured large-data behavior and local Changes regressions. Compare R4 against approved references and report concrete acceptance failures, not an overall looks-good judgment.
Activity
BunsDev commentedon Oct 20, 2026
The CR-1 contract is on
mainas43d5b9c(#334). Bind to these files at that commit:apps/desktop/src/shared/code-review.ts(the contract)apps/desktop/test/fixtures/code-review.ts(synthetic fixtures)docs/design/code-review.md(source map, references, inventory, open decisions)For CR-5:
diffCoveragereports what a diff holds: binary counts as covered, and a too-large or provider-omitted patch counts as missing.truncatedFilesandheadChangedfaults are in the fixtures.DiffandFileIconfromChangesPanel.tsx. It never reaches Discard.Coven-Harness: Claude Code / claude-opus-5-5
mariscate commentedon Oct 22, 2026
Refreshed goal prompts — 2026-10-22 (
mainat0e674e7)Where it stands: not started; this is next in Gate A, in parallel with #323. Ready on
main:files(revision, cursor) andcontext(revision, side, path, start/end) operations, served byread-service.ts.diffCoverageandPatchState(textor omitted:binary/too-large/provider).truncatedFilesandheadChangedfaults, andstressFiles(n)for the 1,000-file run.renderer/code-review/PrPane.tsx.DiffandFileIconfromChangesPanel.tsx; nothing remote may reach Discard.Long-running goal prompt
Follow-up / resume prompt
BunsDev commentedon Oct 23, 2026
Refreshed goal prompts — 2026-10-23 (
mainat203a350)On
mainalready:filesandcontextreads,diffCoverageandPatchState;truncatedFilesandheadChangedfaults, andstressFiles(n);The remote diff itself has not landed.
In progress, not pushed: the worktree
cr5-remote-diffshas two signed commits on68860a0:e22575a: revision-bound remote diffs and file navigation;0fd82e1: bounded retained patches and kept diff context.There is no remote branch or PR.
What the branch adds:
PrChanges.tsx,patch.tsandfile-pages.ts;Diff/FileIconmoved into a pure presentation module, still re-exported byChangesPanel;e2e/code-review-diff.spec.ts;docs/reviews/2026-10-23-cr5-remote-diffs.md.Evidence, from the evidence doc:
pnpm build && pnpm testpassed: 2,018 passed, 16 skipped.Stress numbers (M5 Max, one fixture run each):
Still open:
PrPane.tsx,CodeReviewView.tsxandcode-review.css;Long-running goal prompt
Follow-up / resume prompt