Skip to content

feat(changes): review a branch against a chosen base - #1857

Merged
devswha merged 10 commits into
mainfrom
feat/branch-review-base
Oct 24, 2026
Merged

devswha merged 10 commits into
mainfrom
feat/branch-review-base

Conversation

@devswha

@devswha devswha commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

What it does

Files → Changes gains a Branch scope, following the Codex app's review pane: pick a base (local or remote branch, or type a branch/commit) and press Compare to see what this branch changed since its merge base with that base. The working tree is compared, untracked files included, so what the base went on to change stays out.

  • GET /api/workspace/diff/files and /diff/file accept scope=branch with a base. The list pins a comparison identity (repository root, HEAD, base and merge base). Each patch read carries that identity back and is read from the pinned merge base. A HEAD that moved answers 409 comparison_changed.
  • New GET /api/workspace/diff/refs lists local and remote branches for the picker, at most 200, from the refs on disk (nothing is fetched). It sits behind the same pane, machine, cross-site and watch-only gates and is forwarded to other PCs.
  • An unborn HEAD, an unknown or malformed base, and unrelated histories are each refused by name (unborn_head, revision_not_found / invalid_revision, no_common_ancestor), with nothing compared in their place. Nothing fetches, checks out or writes.
  • Strings are in src/lib/i18n/files.{ko,ja,zh}.ts; the PR adds a DESIGN.md entry, the demo transport answers the new route, and a changelog fragment.

Refs #1048

Why

Reviewing a branch before a PR meant leaving the app for git diff main.... The Codex app's review pane shows this view, and users asked for it.

Real review needed

This adds an HTTP contract: the new /api/workspace/diff/refs route, a branch scope, and a comparison field on the list and patch answers. Per AGENTS.md it waits for a real review.

How it was verified

  • The branch was rebased onto current main. While porting: the types moved to shared/repo-diff.ts, the strings moved to src/lib/i18n/files.*.ts, and the tests use main's ovis: storage keys.
  • bun test server/repo-diff.test.ts src/lib/repoDiff.test.ts server/machine-proxy.test.ts cover branch, detached HEAD, unborn and unrelated histories, a pinned base, a moved HEAD, bounded refs, and no fetch, checkout or write.
  • bun run check fast passed.
  • A branch patch read checks the repository and HEAD again after the read: a checkout landing during the read answers 409 comparison_changed. A git stand-in that checks out another branch right before the read covers this, and the test fails without the check.
  • scripts/repo-diff-browser-qa.ts passed against real temporary repositories and the demo build. It covers 1440 and 390 (DPR 3), dark, English and Korean, and every Branch state: picker, compared, pinned patch, refresh required, invalid base, unrelated histories, unborn, watching device, older PC and offline.
  • The omo-native-code-reviewer approved with no HIGH finding. Codex (gpt-6-astra) found no HIGH. Both flagged that the demo's picker offered branches its Compare then refused; that is fixed in this PR.

Known follow-up (Codex, MEDIUM, not fixed here)

  • A file deleted on the branch and recreated as untracked is listed as deleted. git diff <merge-base> reports it the same way.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8fe7da9 and 3b77967.

Files selected for processing: 23
  • DESIGN.md
  • changelog.d/branch-review-base.md
  • scripts/repo-diff-browser-qa.ts
  • server/api.contract.test.ts
  • server/device-access.contract.test.ts
  • server/machine-api.ts
  • server/machine-proxy.test.ts
  • server/repo-diff.test.ts
  • server/repo-diff.ts
  • server/workspace-routes.ts
  • shared/protocol.ts
  • shared/repo-diff.ts
  • site/demo/transport.ts
  • src/components/RepoChanges.css
  • src/components/RepoChanges.tsx
  • src/components/RepoDiffViewer.tsx
  • src/lib/api.ts
  • src/lib/i18n/files.ja.ts
  • src/lib/i18n/files.ko.ts
  • src/lib/i18n/files.zh.ts
  • src/lib/machineContext.tsx
  • src/lib/repoDiff.test.ts
  • src/lib/repoDiff.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added Branch comparison in Files → Changes. Choose a local or remote branch, or enter a branch or commit, then select Compare to view changes since the shared merge base. Untracked files are included; changes made only on the base are excluded.
    • Branch references are loaded locally without fetching. Comparison details are shown, and file patches stay tied to the listed comparison.
  • Bug Fixes
    • Stale comparisons are detected instead of displaying outdated patches. Refresh applies a moved base; a changed HEAD starts a new comparison.
    • Comparisons are refused when required commit history or a shared ancestor is unavailable.

Adds branch comparison to repository Changes. The server lists local and remote refs and compares the working tree against the selected base’s merge base with HEAD. File patches use a pinned comparison identity. The UI adds base selection, stale-result handling, localized messages, and responsive layouts.

Changes: Branch comparison

Layer / File(s) Summary
Branch comparison contracts
shared/repo-diff.ts, shared/protocol.ts, DESIGN.md, changelog.d/branch-review-base.md
Adds the branch scope, comparison identity and refs response types, and documents the branch comparison flow and API behavior.
Server comparison and refs API
server/repo-diff.ts, server/workspace-routes.ts, server/machine-api.ts, server/repo-diff.test.ts, server/api.contract.test.ts, server/device-access.contract.test.ts, server/machine-proxy.test.ts
Lists eligible refs and computes branch file lists from the merge base. Patch requests use the returned comparison identity and reject stale repository or HEAD state. Routes, proxy handling, and contract tests cover refs requests.
Branch selection and pinned patch display
src/components/RepoChanges.tsx, src/components/RepoChanges.css, src/components/RepoDiffViewer.tsx, src/lib/api.ts, src/lib/machineContext.tsx, src/lib/repoDiff.ts, src/lib/repoDiff.test.ts, src/lib/i18n/files.*.ts
Adds ref selection and filtering, explicit Compare submission, target-change resets, identity-aware patch loading, comparison status messages, and localized responsive controls.
Demo and browser coverage
site/demo/transport.ts, scripts/repo-diff-browser-qa.ts
Adds branch comparison behavior to the static demo and browser tests for branch selection, patch identity, moved refs, refusal cases, stale responses, localization, and layouts.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Merge Risk: Minimal · up to 3b779

No actionable merge-blocking risk remains; the branch comparison is ready for normal merge checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 20 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description explains the feature, API behavior, error cases, issue reference, review context, validation results, and HTTP contract-test coverage. It uses different headings from the template, but…
Title check Passed The title clearly and concisely describes the main change: reviewing a branch against a selected base.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the feature, API behavior, error cases, issue reference, review context, validation results, and HTTP contract-test coverage. It uses different headings from the template, but it contains the required Change and Validation information.

Full details: Docstring Coverage

Explanation

Docstring coverage is 71.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 20 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Code-review agent review (stands in while CodeRabbit is rate-limited)

CodeRabbit answered "Review limit reached", so it has not reviewed this PR. Two independent agent reviews ran on the full diff against main (9b0ddf147):

omo-native-code-reviewer: APPROVE. No CRITICAL or HIGH findings.
Codex (gpt-6-astra): No HIGH findings.

Finding Severity Resolution
The demo's base picker offered feat/idempotent-payments and origin/release/2026.10, which its Compare then refused with "No commit by that name" MEDIUM (omo) / LOW (Codex) Fixed in 9b0ddf1: the demo offers only main and origin/main. The browser check asserts this.
A path deleted on the branch and recreated untracked is listed as deleted (server/repo-diff.ts found.has) MEDIUM (Codex) / LOW (omo) Not fixed, noted as a follow-up. git diff <merge-base> itself reports it this way, and the case is rare.
HEAD is checked before a branch patch is read, not after, so a checkout switched mid-read could answer with the old identity MEDIUM (Codex) Not fixed, noted as a follow-up. It needs a checkout to land during a single patch read. Refresh shows the right list.
The demo's error codes differ from the server's for malformed requests the client never sends; useMemo deps; a test that restates its implementation; the rarely reached stale viewer state; the base name in the merge-base line; the base checked twice LOW (omo) Notes only. No user-visible effect.

Argument injection, ref validation, merge-base semantics, the shared contract after the rebase, the proxy and watch-only gates on diff/refs, and the ko/ja/zh strings were each checked and found sound.

This PR adds an HTTP contract (GET /api/workspace/diff/refs, scope=branch, and comparison on the list and patch answers), so it still needs a real review before merging.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Merge pass review-work for 9b0ddf1: REVIEW FAILED on the pinned-comparison promise. This PR adds HTTP routes and CodeRabbit was rate-limited, so this comment records the independent review.

Blocker: a checkout while a patch is being read returns 200 with the old identity and the new branch's patch. The description says "a HEAD that moved answers 409 comparison_changed". server/repo-diff.ts:247 checks HEAD before the read, but :404-411 reads and returns the patch without checking again. The gate reproduced this deterministically against real git. The response kept the old HEAD in its echoed identity but carried +other-branch-content, and the viewer accepted it because that identity still matched. Please recheck HEAD (and the merge base) after the read and answer 409 if it moved, then add a deterministic regression for a checkout during the read. The PR lists this as a known follow-up, but it is part of what the PR promises.

Checked and passing:

  • Tests: 71 unit tests pass and the typecheck passes. The contract tests pass, including a watch device getting 403 read_only from the refs route. repo-diff-browser-qa gives 44 PASS.
  • Injection: --output=…, -c core.pager=…, $(…), newlines and .. all get 400, and refs/heads/--output=… gets 404. Nothing ran and the repo was unchanged. base is validated before use and then passed after --end-of-options, and git runs from an argv array only, never a shell.
  • Comparison identity: the identity is pinned, and a moved base is refused.
  • Named refusals: unborn HEAD, unknown or malformed bases, and unrelated histories are each refused by name.
  • Repository shapes: the gate also exercised annotated tags, a detached HEAD, shallow history, submodules, and 10,000 branches (200 returned, truncation flagged).
  • Gates, locales, precedent: every route has the same gates, every locale is covered, and the Codex review-pane precedent is named.

Non-blocking:

  • On an older bridge, the picker message says "cannot show changes yet" even though Changes works there.
  • RepoChanges.tsx grows to about 300 LOC.
  • One test only checks its own fixture's length.
  • A stale-response assertion is frame-based.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Fixed the blocker in 3b77967: a branch patch is now refused when HEAD moves during its read.

  • repoDiffFile reads the repository and HEAD again once the patch has been read. If either is no longer the pinned comparison's, it answers 409 comparison_changed instead of 200 with the old identity.
  • Regression test in server/repo-diff.test.ts: "refuses a patch when a checkout lands while it is read…". A git stand-in runs git checkout other right before the patch's own git diff. The test fails without the fix ("promise resolved") and passes with it, deterministically, with no timing involved.
  • bun test server/repo-diff.test.ts src/lib/repoDiff.test.ts: 46 pass. bun run check fast: green.
  • The PR description no longer lists this as a follow-up.

The non-blocking notes (older-bridge picker wording, RepoChanges size, the fixture-length test, the frame-based stale assertion) are left as they are.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Merge pass review-work for 3b77967: the wrong-patch race is fixed. A checkout during the read now returns 409 comparison_changed and no patch, and the new test fails against the old code. One path still skips the recheck.

Blocker: a checkout that empties the diff returns 404 not_found instead of 409.

  • The gate reproduced two cases: a checkout to the base just before the patch command, and a checkout before the internal listing. Both answered 404 not_found, and neither rechecked HEAD after the checkout (server/repo-diff.ts:410-420 and :374-376).
  • The 404 says "nothing changed at that path", but what actually happened is that HEAD moved. The PR promises 409 for a moved HEAD.
  • Neither case leaks a patch.
  • Please recheck the identity on the empty and error paths too, including the internal listing, before answering not_found. Add deterministic regressions for both.

Passing: 56 tests pass, the typecheck passes, and the contract tests pass. Only the two declared files changed.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Fixed in e61d529: a moved HEAD is now 409 comparison_changed on the empty and error paths too.

  • The patch's own listing now runs inside the read. Once the read ends, repoDiffFile reads the repository and HEAD again whatever it answered: a patch, an unavailable reason, or a thrown not_found / invalid_path / git_failed. If HEAD or the root moved, it answers 409 instead.
  • The race test in server/repo-diff.test.ts ("refuses a patch when a checkout lands while it is read…") now covers three deterministic cases with a git stand-in:
    • a checkout to another branch just before the patch read;
    • a checkout to the base just before the patch read, which empties the diff;
    • a checkout to the base just before the listing.
  • On 3b7796766 the three cases answer 200 (an earlier commit), then 404 and 404, and the test fails. With this commit all three answer 409 with no patch.
  • The workspace, staged and commit scopes (no pinned comparison) answer exactly as before.
  • bun test server/repo-diff.test.ts src/lib/repoDiff.test.ts: 46 pass. bun run check fast: green (6398 pass).
  • Codex (Sol 6.1, xhigh) reviewed this delta: no findings, approve.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Merge pass: #1849 (find literal text in the loaded patch) is merged (54b4db3). This PR now conflicts with main in src/components/RepoDiffViewer.tsx and scripts/repo-diff-browser-qa.ts. Please rebase and keep both behaviours. The merge pass re-checks the rebased head, looking only at the changed range, and puts it back in the queue.

devswha and others added 10 commits October 24, 2026 23:34
Files > Changes gains a Branch scope, following the Codex app's review
pane: the working tree, untracked files included, is compared against
the merge base of a chosen base and HEAD, so what the base went on to
change stays out.

- server/repo-diff.ts: scope=branch resolves the base and HEAD to full
  commit ids and computes git merge-base with no fallback. A detached
  HEAD works; an unborn HEAD, an unknown or malformed base and unrelated
  histories are refused as unborn_head, revision_not_found /
  invalid_revision and no_common_ancestor. The list pins a comparison
  identity (repository root, HEAD, base, merge base); a patch carries it
  back as a bounded JSON query parameter, is read from the pinned merge
  base, and answers 409 comparison_changed once HEAD or the repository
  moved. Untracked files use the existing bounded ls-files and
  --no-index paths. Nothing fetches, checks out or writes.
- GET /api/workspace/diff/refs lists local and remote branches (full
  refname and oid, remote symbolic HEAD omitted, at most 200, existing
  byte and time limits) behind the same pane, machine, cross-site and
  watch-only gates; it is forwarded to other PCs.
- shared/protocol.ts: the branch scope, RepoBranchComparison,
  RepoDiffRefs and the comparison field on list and patch.
- RepoChanges: a Branch segment with a base combobox (typed or picked,
  refs read on open and fenced per PC/pane/folder, loading, empty,
  no-match, truncated and refused states), Compare only on request, an
  identity line, and a viewer that discards a patch for another
  identity. On a phone the four scopes share the bar.
- Demo transport answers the refs route and a fictional branch
  comparison; ko/ja/zh strings; DESIGN.md entry; changelog fragment.

Checked with bun run check fast; bun test of server/repo-diff.test.ts
and src/lib/repoDiff.test.ts (branch, detached HEAD, unborn and
unrelated histories, pinned base, moved HEAD, bounded refs, no
fetch/checkout/write); the API, device-access and machine-proxy tests
on the isolated herdr; and scripts/repo-diff-browser-qa.ts on real
temporary repositories and the demo build at 1440 and 390 (DPR 3),
light and dark, plus Korean.

Refs #1048
A base list opened while the phone's Files sheet was still sliding in
kept the position it was given mid-animation and could land over
Compare. The list is now placed again when an ancestor's animation or
transition ends.

The branch review browser check also captures every state the visual
review names under its own name: disabled Compare, loading branches,
list and patch, a picked base, Compare pressed, a long branch name,
the cut branch list, invalid ancestry, an older PC and an offline PC.

Checked with bun run check fast and scripts/repo-diff-browser-qa.ts.
- Another PC, pane or folder clears the base, the picked row and the last
  listing, and waits for Compare there; a list still on its way for the
  target left behind, or for a scope that waits for Compare, is dropped.
- The base list sits in the form's flow under the field and Compare at
  every width instead of a popover placed by script, so it never covers
  Compare or the scopes, and closes on a finished click so nothing moves
  under a press.
- Before the first Compare the Branch scope says what it waits for instead
  of showing a loading skeleton; the base field is a full touch target on
  a phone.
- A full branch name the refs route offers (a plus sign, Hangul, a long
  name) is accepted when git's refname rules hold it to a name; ranges,
  reflog and peel suffixes, paths, spaces and options stay refused.
A pinned branch comparison accepted any hex id of 40 through 64 characters,
so a 41-character head_oid answered 409 comparison_changed and base_oid 404
revision_not_found. Full git ids are exactly 40 (SHA-1) or 64 (SHA-256), and
every other length is now 400 invalid_comparison before git is asked.
Branch names, their hashes and the list's notes were caption sizes (11-12px).
They are now --fs-md on desktop and, on a touch screen, --fs-xl for the name
and --fs-lg for the hash and notes. No global token changes.
…uring

The demo ends its opening agent turn on a 4.5 s timer, so the demo captures
raced it behind the Files sheet. The browser check now installs the page
clock and runs it past that timer before the first capture.
main renamed the history entry and settings keys to ovis: (#1648); the
branch scope's history test and browser check still wrote the old ones.
The demo's base picker listed feat/idempotent-payments and
origin/release/2026.10, which its Compare then refused as "No commit by
that name". It now offers main and origin/main, the bases it answers.
A branch patch checked HEAD against the pinned comparison before git read
the working tree, never after, so a checkout landing during the read was
answered 200 with the old identity and the other branch's content, and the
viewer accepted it. The repository and HEAD are now read again once the
patch is, and a change answers 409 comparison_changed. A git stand-in that
checks out another branch right before the read covers it.
A checkout during a branch patch read that left nothing changed at the
path (to the base before the patch, or before its own listing) answered
404 not_found without looking at HEAD again. The listing now runs inside
the read, and HEAD is checked after it whatever it answered, errors
included, so a moved HEAD is always 409 comparison_changed. The race test
covers both empty cases beside the changed-content one.
@devswha
devswha force-pushed the feat/branch-review-base branch from e61d529 to 06270da Compare October 24, 2026 15:48
@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto main after #1849 and pushed 06270da (was e61d529). The conflicts in src/components/RepoDiffViewer.tsx and scripts/repo-diff-browser-qa.ts were resolved keeping both behaviours: #1849's literal find in the loaded patch, and this PR's branch-review base. The branch doesn't touch scripts/ci-browser.test.ts or ci-browser.sh, so #1874 didn't affect it, and it merges into current main cleanly.

  • bun run check fast passed on 06270da.
  • scripts/repo-diff-browser-qa.ts passed: repository diff: browser OK, including the Branch scope at 1440 and 390 px, a remote PC's changes, and the static demo.

Known follow-up, still listed in the description: a deleted then recreated untracked file shows as deleted. This is a rebase only, so it doesn't need another CodeRabbit review.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Merge pass review-work report. Overall: PASSED. This PR adds HTTP routes and CodeRabbit was rate-limited, so per AGENTS.md this comment, together with the two earlier ones, records the independent review.

Lane Verdict Confidence
QA (code-review agent's 14-row matrix + merge-pass reruns; artifacts kept) PASS at e61d529 -
Code review (omo-native-code-reviewer, programming + remove-ai-slops) PASS (WATCH) -
Gate round 1 (9b0ddf1) REJECT: a checkout during a patch read answered 200 under the old identity HIGH
Gate round 2 (3b77967) REJECT: a checkout that emptied the diff answered 404 HIGH
Gate round 3 (e61d529) APPROVE HIGH

What was checked

  • Tests: 46 repo-diff and repoDiff tests pass, and the typecheck passes. The contract tests pass, including a watch device getting 403 from the refs route. repo-diff-browser-qa gives 44 PASS.

  • Injection: --output=…, -c core.pager=…, $(…), newlines and .. are refused with 400; nothing ran and nothing was written. base is validated before use and passed after --end-of-options. git runs from argv only, never through a shell.

  • Pinned comparison: a moved base is refused. A HEAD that moves during or before a patch read, including one that empties the diff or changes the internal listing, now answers 409 comparison_changed. A genuine unchanged-path 404 stays 404. The new regressions fail against the earlier code.

  • Other cases: named refusals for an unborn HEAD, an unknown or malformed base, and unrelated histories. Annotated tags, a detached HEAD, a shallow clone and submodules work. With 10,000 branches the list returns 200 and flags the truncation.

  • Gates, locales, precedent: the routes share the existing gates, every locale is covered, and the design follows the Codex review pane.

  • Rebase after feat(diff): find literal text in the loaded patch #1849 (06270da), a conflict resolution:

Follow-ups (MINOR)

  • On an older bridge, the picker says "cannot show changes yet" even though Changes works there.
  • RepoChanges.tsx has grown to about 300 lines.
  • One test only checks the length of its own fixture.

All required checks are green and no review thread is open.

CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it.

@devswha
devswha merged commit f4f41d2 into main Oct 24, 2026
32 of 36 checks passed
@devswha
devswha deleted the feat/branch-review-base branch October 24, 2026 23:44
devswha added a commit that referenced this pull request Nov 5, 2026
…3028)

## What

Since #3002, `scripts/repo-diff-browser-qa.ts` times out on main (and on
every PR's Integration and browser job) waiting for the **Choose a
branch** button in the step "a branch list still on its way is dropped
when the reader switches PC".

#3002 keyed `RepoChanges` in `FilesDialog` by PC and pane
(`key={`${machineId}:${paneId}`}`). A switch of pane or PC while Files
is open (Next pane, the sidebar) now remounts the changes list, so the
**Branch** scope the reader picked falls back to **Working tree**. That
also happens with the new setting off (the dialog), so it is a product
regression, not a stale locator: #1857 made Changes keep its Branch
scope across a pane, folder or PC switch (it starts the comparison over
with no base) and drop answers for the target left behind by itself, and
its tests assert exactly that (`branchPressed: "true"` after each
switch).

The fix removes only that key. The `DirectoryBrowser` and
`PullRequestPanel` keys from #3002 stay, so the same pane id on another
PC still lists that PC's folder (the PC-switch step in
`scripts/files-panel-demo-regression.ts`).

## Validation

- `bun scripts/repo-diff-browser-qa.ts` on origin/main 6b72c09 (after
`bun install --frozen-lockfile` and `bun run build`): fails with
`TimeoutError: click: Timeout 15000ms exceeded ... waiting for
getByRole('button', { name: 'Choose a branch', exact: true })` right
after the Korean branch review, as in CI.
- Same script with this change: passes (`repository diff: browser OK
...`, exit 0).
- `bun scripts/files-panel-demo-regression.ts` with this change: PASS
1280/390, light/dark (the PC-switch folder step included).
- `bun run check fast`: passed on 6349cd7 (unit 12200 pass, 0 fail;
typecheck, build, generated files).

No new test: the existing browser regression is the failing-first check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant