mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
3.6 KiB
3.6 KiB
Electron Desktop E2E Record: Diff Review and Commit
Date: 2026-04-25
Slice
Slice 12 basic diff review and commit.
User-Visible Scenario
- Launch the desktop app with a temporary HOME/QWEN_RUNTIME_DIR and fake ACP.
- Open a temporary Git workspace with an initial commit.
- Modify a tracked file and create an untracked file.
- Verify the right Review panel lists changed files and textual diff content.
- Stage all changes from the Review panel.
- Enter a commit message and commit.
- Verify the Review panel returns to a clean state.
Assertions
GET /api/projects/:id/git/diffreturns modified and untracked files.- The Review panel shows changed file count and diff text.
POST /api/projects/:id/git/stageupdates Git status from modified/untracked to staged.POST /api/projects/:id/git/commitcreates a commit and returns a clean status.POST /api/projects/:id/git/revertcleans tracked and untracked changes when explicitly invoked.- Commit and Git errors are displayed in the review area.
Diagnostics on Failure
- Save renderer screenshot.
- Save renderer console errors and failed network requests.
- Save Electron main stdout/stderr.
- Save
git -C <workspace> status --porcelain=v1 --branch. - Save
git -C <workspace> diffandgit -C <workspace> diff --cached. - Save DesktopServer responses for diff/stage/revert/commit routes.
Automated Coverage Added This Iteration
Iteration 10 extended the server and Electron E2E coverage:
- opens a registered project and reads
/git/diff; - verifies modified and untracked files are returned with diff text;
- verifies changed files include typed hunk metadata;
- stages all changes and verifies status counts;
- stages one hunk from a multi-hunk tracked file and verifies only that hunk is accepted into the index;
- reverts a remaining unstaged hunk and verifies the file content is restored while the accepted hunk remains staged;
- commits staged changes and verifies a clean status;
- reverts all changes and verifies the workspace returns to the initial file content.
- launches Electron through
npm run e2e:cdp --workspace=packages/desktop, opens a temporary Git workspace, clicks Accept Hunk, verifies the accepted state, adds an inline review note, and continues through the existing permission/settings/terminal smoke. - iteration 12 extends the same Electron CDP harness to click Accept All, enter a commit message, click Commit, wait for the Review panel to return to a clean state, and verify the latest Git commit subject plus a clean working tree from the temporary workspace.
Execution Results
npm run test --workspace=packages/desktoppassed: 9 files, 54 tests.npm run typecheck --workspace=packages/desktoppassed.npm run lint --workspace=packages/desktoppassed.npm run build --workspace=packages/desktoppassed.npm run e2e:cdp --workspace=packages/desktoppassed with artifacts under.qwen/e2e-tests/electron-desktop/artifacts/2026-04-25T03-08-06-087Z/.- Iteration 12 initial commit-path run failed because the harness clicked
Commit before stage-all state had settled. Diagnostics:
.qwen/e2e-tests/electron-desktop/artifacts/2026-04-25T04-50-16-704Z/. - Iteration 12 final run passed:
npm run e2e:cdp --workspace=packages/desktop. Success artifacts:.qwen/e2e-tests/electron-desktop/artifacts/2026-04-25T04-52-52-305Z/.
Remaining Risk
The P0 commit path now has real Electron renderer coverage. Remaining review risk is around complex Git states such as renames, binary files, conflicting stale hunks, and persisting review comments beyond the local renderer session.