Files
deepseek-harness/scripts
LegGasai f535813467 feat(forge): stage, unstage, and restore files in the local changes view (#9166)
* feat(client-ui-forge): stage, unstage, and restore files in the local changes view

The Unstaged scope of the local changes view stages and restores whole
files, and the Staged scope unstages them, each from an icon button on
the file header, the file menu, or a header button for every shown file.

A new forgePanel.localWrite Remote runs Git under the Session's sandbox
policy. Staging and restoring refuse a file whose change is not the one
the reader saw. Staging and unstaging return the index as a tree, which
the notice's Undo returns the index entries to. Restoring asks first.

The viewed mark draws as a ring, and a pane at most 380px wide shows a
file's writes under the pointer or once the keyboard reaches them.

Refs #9162

* test(client-ui-forge): give the older local diff fixtures the writable field

* docs(forge): document local writes on the subsystem page and refresh the catalogs

* test(client-ui-forge): run the local write specs on Windows

Refusals come from the recording sandbox instead of a POSIX stand-in Git,
the pathspec-magic file name is used only where the file system takes a
colon, and the batching case uses short names under the Windows path limit.

* feat(client-ui-forge): run local writes on the reader's authorization, outside the Session sandbox

A press in the changes view is the reader's own action, as archiving is for
the worktree service's removal of a checkout, so staging, unstaging, and
restoring no longer run under the Session's sandbox policy. They work in a
read-only Session and from a Session directory below the checkout's root.

ForgeLocalDiff.writable, the forgePanel/local-write-denied error, and its
notice are removed with the confinement they described. A restore passes
--no-recurse-submodules.

Refs #9162

* fix(client-ui-forge): refuse writes that reach past the chosen file

Three review findings on the local writes of the changes view:

- A deleted file whose path holds a directory is refused before anything
  is written. Git takes a path for the directory and everything in it, so
  staging the deletion staged those files and restoring the file deleted
  them.
- A submodule is offered no restore. git restore exits with success and
  leaves the commit it has checked out, so the view reported a
  restoration that did not happen. ForgeDiffFile gains `submodule`, read
  from the 160000 mode of the patch header.
- The file menu's rows for the writes cannot be activated while a write
  is in flight or the scope is read again, as the header's buttons.

Refs #9162

* docs(forge): record why local writes carry no filter guard

* test(web): wait for the last file's text before reading its scroll position

The file navigation case read the scroll position two frames after the
last file drew. A drawn file shows a row for the lines after its last
hunk until the Host answers the read of its text; the row then leaves,
the scroll range shrinks by its 26px, and the position falls from 3347
to 3321. When the answer took longer than two frames, the case recorded
the earlier position and failed with "expected 3321 to be 3347".

The case now waits for that row to leave. With the Host's answer delayed
by 600ms the old wait fails with that message and the new wait passes.

Refs #9162
2026-11-25 08:04:39 +00:00
..
2026-09-08 22:31:16 +08:00