Repository navigation
feat(app): align review change sources with the TUI - #59608
opencode-agent[bot] wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
The approach is sound: the sources, default and base resolution match the TUI diff viewer, and the server's Git adapter already supports committed and base. I couldn't run it here. Type-checks pass in packages/gui-plugins and packages/app, and the review unit tests pass. Playwright couldn't start Chromium in this sandbox, so I have no e2e results and no screenshots.
Public API: unchanged. Only app storage changes: plugin.review.source is new, and the per-session mode and the old reviewMode import are dropped. The client calls vcs.base / vcs.diff, which already exist.
One concern, inline: All isn't offered until the repository's branch info has loaded, so the panel can briefly show Uncommitted and fetch that diff before switching to All.
| const chosen = source.value?.mode ?? "branch" | ||
|
|
||
| // Until the server and the project answer, what the session offers is unknown. | ||
| if (!view().server.connected || !view().project) return chosen |
There was a problem hiding this comment.
All and Committed are offered only once vcs()?.branch.default is known. Until vcs.info loads for this directory, options() is ["working", "turn"]. So with the new default (All), mode() resolves to working: the header shows Uncommitted and a working diff is requested, then it switches to All once branch info arrives. This already happened for a stored Branch choice before, but now it's the default for everyone. Could mode() (and loaded() / the diff query's enabled) treat the offered sources as unknown while vcs() is undefined for a VCS project, the same way it waits for the server and project?
There was a problem hiding this comment.
The new commit removes the source descriptions and the vs <base> header label, and renames the first source to "All changes". It looks fine. Type-checks pass in packages/gui-plugins and packages/app, and the review unit tests pass. I couldn't run the Playwright tests in this sandbox.
The earlier point about the brief switch to Uncommitted while branch info loads isn't addressed by this commit; its thread stays open.
Public API: unchanged.
Desktop's review panel now offers the same change sources as the TUI diff viewer, with the same names, the same default and the same comparison base.
branchsource. Before, every session started on Git changes, so you had to switch to Branch changes once the agent committed.plugin.review.source) instead of per session, like the TUI'sreviewmemory. It persists across restarts because desktop has nodiffs.sourceconfig. The file selection and open files are still stored per session, and olderreviewModevalues are no longer imported.vcs.base, the ref the branch was created from, and pass it tovcs.diff, as the TUI does. If the server cannot resolve a base, the diff falls back to the default branch. The base is not shown in the header.Not included: the TUI's base picker. The three
ui.sessionReview.title.git|branch|lastTurnkeys inpackages/uiare now unused but are left alone here, so this PR doesn't touch 60 locale files.Visual
Checks
bun run typecheckinpackages/gui-pluginsandpackages/app.typecheck:e2ereports only the 11 errors that already exist ondev.bun run lint:changed, plus prettier on the changed files.regression/review.spec.ts(24 passed),mobile-session.spec.tsandmobile-plugins.spec.ts.mobile-session› "drawer navigation preserve session identity" also fails intermittently onorigin/dev(2 of 5 runs).Requested by: @vimtor (victor via Slack)