Files
apes-sidebar/docs
Menghuan1918andAhdong&Shouey 7cf3d609ff feat(changes): AI commit-message suggestion + push/pull in the git lens
Port PR #434's two Git-panel features onto the current dev structure. The
PR's third commit (file-tree context-menu rename) is dropped: dev already
has it (#550, e39ea92) with a different `fs.rename` payload contract
(`name`, not `newName`) and its own i18n keys, so keeping it would break the
route and duplicate dictionary keys (TS1117).

Why this is a rewrite rather than the PR's diff applied:

- The client carrier moved. `src/client/GitView.tsx` was deleted by 24a3813
  (the unified "changes" tab), so the client half lands in
  `src/client/changes/GitLens.tsx` and follows that file's conventions: the
  bar's single `actionError` status line instead of a second `remoteError`
  channel, `runAction` for the git mutations, the kit's `IconButton`, and the
  host's own `IconSparkleRegular` rather than a new react-icons import.
- The host route could not read `Session.events` at all: it was renamed to
  `snapshotEvents()` in DSH 0.1.2-alpha.4, and 0.2.0-rc.1 marks it `new calls
  are prohibited`. `git.suggest-message` resolves its provider/model from the
  incrementally folded `Session.requestHeader()` — the same `request/header`
  record the PR was after, but O(new events) instead of a full reverse scan.
  `SidebarSessionStore` gains that face; `snapshotEvents()` is marked
  deprecated there.
- Message source is the plugin's own producer kind
  (`plugin:dsh-better-sidebar`, the existing `MessageSourceMap` augmentation):
  a bare `plugin` kind is rejected outright in session format v4.
- The commit row stays where dev put it. PR moved it to the top of the panel
  because it was buried between the two file lists; dev's commit bar is
  already a `position: sticky` footer, so that problem is gone — and
  `changes-tab.spec.tsx` pins the bar's status line to the message row.

Beyond the port, the route reads `assembler.finish` so a provider-side failure
is reported with the provider's own reason instead of "the model returned an
empty message", bounds the call with a 30s deadline, and truncates the diff at
12K characters.

Refs #434

Co-authored-by: Ahdong&Shouey <131278957+LiuStar656@users.noreply.github.com>
2026-10-05 02:11:10 +08:00
..