Skip to content

feat(desktop): separate Git review empty and error states - #5967

Draft
Colafornia wants to merge 1 commit into
apache:mainfrom
Colafornia:feat/5940-git-review-empty-error
Draft

Colafornia wants to merge 1 commit into
apache:mainfrom
Colafornia:feat/5940-git-review-empty-error

Conversation

@Colafornia

@Colafornia Colafornia commented Oct 4, 2026 •

Copy link
Copy Markdown
Member
English

Summary

A valid non-Git task directory used to render the same red error Banner with Retry as a genuine read failure, even though retrying can never turn a directory into a repository. The Changes panel now classifies GitReviewReadResult failures: not_git_repository, workspace_unavailable, unborn_repository and remote_workspace are capability states that get neutral guidance naming the task's recorded workspace, while git_failed keeps an error Banner with the underlying detail and a working Retry. A clean repository with no differences still takes the separate "no changes" empty state.

The capability guidance offers "Change task folder", which reuses the existing Task Entry session workspace recovery picker (#5551), reached through a small application/contracts publish/subscribe seam rather than a shell-drilled prop so AppShell's debt metrics stay flat, so relocation preserves task identity instead of offering a new-task or default-directory action. A catalog-level subscribeSessionChanges subscription re-reads the Session's actual workspace after relocation, so the panel refreshes without a manual retry.

Fixes #5940

Verification

  • npm run lint, npm run format:check, npm run build, npm run typecheck, npx knip --workspace apps/desktop, npx knip --workspace packages/ui: all pass.
  • npm --workspace @maka/core run test:dist: 915/915 pass.
  • npm --workspace @maka/desktop run test:dist: 3261/3261 pass, including new coverage: non-Git guidance with the task directory and no Retry, unavailable-workspace guidance with Retry plus the recovery action, unborn-repository guidance, git_failed detail preserved through redaction with a working Retry, a remote host-owned workspace showing guidance with neither Retry nor recovery, and a session catalog change re-reading the relocated workspace. Four new IPC tests assert the recorded workspace is attached for non-Git and missing directories, and that an unknown Session is rejected.
  • npm --workspace @maka/desktop run build-storybook + npm --workspace @maka/desktop run smoke:storybook: all 455 stories render; ChangesSourceNotGit, ChangesWorkspaceUnavailable, ChangesUnbornRepository, ChangesRemoteWorkspace and ChangesGitReadFailed cover the new states.
  • Manual, dev build: non-Git guidance shows the task path with no Retry; moving a task's folder away produces the unavailable guidance; relocating through the recovery action refreshes the panel to the new workspace.

Not run: the full Electron E2E suite (npm run e2e).

Screenshots (storybook capture):

State Light Dark
Not a Git repository changes-source-not-git light changes-source-not-git dark
Workspace unavailable changes-workspace-unavailable light changes-workspace-unavailable dark
Workspace managed by a remote Runtime Host changes-remote-workspace light changes-remote-workspace dark
Git read failed changes-git-read-failed light changes-git-read-failed dark
Unborn repository changes-unborn-repository light changes-unborn-repository dark
No changes (empty) changes-empty light changes-empty dark

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Devin (Cognition) implemented the change end to end — result contract fields, main-process read and IPC, panel rendering and copy, recovery plumbing, tests and stories. Generated-by trailers are on the commits.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
中文

Summary

此前,一个合法但非 Git 的任务目录会渲染与真实读取失败相同的红色错误 Banner 和"重试"按钮,尽管重试不可能把目录变成仓库。现在变更面板按 GitReviewReadResult 的失败原因分类:not_git_repository、workspace_unavailable、unborn_repository 和 remote_workspace 属于能力态,展示中性引导并标注任务记录的工作区路径;git_failed 保持错误 Banner,附带底层错误 detail 和有效的"重试"。干净的仓库仍走独立的"无变更"空态。

能力态引导提供"更改任务目录"动作,复用 Task Entry 既有的会话工作区恢复选择器(#5551),该命令经 application/contracts 发布/订阅 seam 获取、不经 shell prop 下钻,AppShell 债务指标保持不变;迁移保留任务身份,而不是提供新任务或默认目录动作。新增的 catalog 级 subscribeSessionChanges 订阅在迁移完成后重新读取 Session 的实际工作区,面板无需手动重试即刷新。

Fixes #5940

Verification

  • npm run lint、npm run format:check、npm run build、npm run typecheck、npx knip --workspace apps/desktop、npx knip --workspace packages/ui:全部通过。
  • npm --workspace @maka/core run test:dist:915/915 通过。
  • npm --workspace @maka/desktop run test:dist:3261/3261 通过,含新增覆盖:非 Git 引导显示任务目录且无重试;目录不可用引导含重试与恢复动作;零提交仓库引导;git_failed 经脱敏保留 detail 且重试有效;远程 Runtime Host 管理的工作区只显示引导、无重试与恢复动作;会话 catalog 变更触发对迁移后工作区的重读。另有 4 个新 IPC 测试断言非 Git 与缺失目录附带记录的工作区路径,以及未知 Session 被拒绝。
  • npm --workspace @maka/desktop run build-storybook + npm --workspace @maka/desktop run smoke:storybook:455 个 story 全部渲染;ChangesSourceNotGit、ChangesWorkspaceUnavailable、ChangesUnbornRepository、ChangesRemoteWorkspace、ChangesGitReadFailed 覆盖新状态。
  • 手工(dev 构建):非 Git 引导显示任务路径且无重试;移走任务目录后显示不可用引导;经恢复动作迁移后面板自动刷新到新工作区。

未运行:完整 Electron E2E(npm run e2e)。

截图(storybook capture):

状态 浅色 深色
非 Git 目录 changes-source-not-git light changes-source-not-git dark
目录不可用 changes-workspace-unavailable light changes-workspace-unavailable dark
远程 Runtime Host 管理的工作区 changes-remote-workspace light changes-remote-workspace dark
Git 读取失败 changes-git-read-failed light changes-git-read-failed dark
零提交仓库 changes-unborn-repository light changes-unborn-repository dark
无变更 changes-empty light changes-empty dark

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:Devin(Cognition)端到端实现了本次改动 —— 结果契约字段、主进程读取与 IPC、面板渲染与文案、恢复链路、测试与 story。提交含 Generated-by trailer。

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Oct 4, 2026
@Colafornia
Colafornia force-pushed the feat/5940-git-review-empty-error branch 2 times, most recently from c0a8ca7 to 6922a5a Compare October 4, 2026 18:42
A valid non-Git task directory previously rendered the same red error
Banner with Retry as a genuine read failure, even though retrying cannot
turn a directory into a repository. The Changes panel now classifies
GitReviewReadResult failures: not_git_repository, workspace_unavailable
and unborn_repository are capability states with neutral guidance naming
the task's recorded workspace, while git_failed keeps an error Banner
with the underlying detail and a working Retry.

The guidance offers a "Change task folder" action that reuses the
existing Task Entry session workspace recovery picker (apache#5551),
preserving task identity. A catalog-level session change subscription
re-reads the Session's actual workspace after relocation.

Refs apache#5940

Generated-by: Devin

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@Colafornia
Colafornia force-pushed the feat/5940-git-review-empty-error branch from 6922a5a to 61551fc Compare October 4, 2026 18:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): separate Git review empty and error states

1 participant