fix(desktop): offer to restore an archived project when re-adding its directory - #4936
fix(desktop): offer to restore an archived project when re-adding its directory#4936faga295 wants to merge 2 commits into
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this PR at head 9a27002c (17 files, +262/−21) against base 2310035a.
Gate is not ready — two blockers:
- Protocol epoch regression on merge. The head's
packages/runtime-host/src/protocol/index.tsdeclaresRUNTIME_HOST_COMPATIBILITY_EPOCH = 112, while the live base and currentmainare at 121 (nine versions newer). The branch forked from epoch-112-eramainand has never been rebased: the merge-base (cbeb1a93c) is at 112, the head's first parent is that same old commit, and the branch is 62 commits behindmain. The PR makes no protocol change, so there is no epoch bump in the diff — but merging this head would regress the protocol epoch from 121 to 112. Please rebase onto the currentmain(no epoch bump is needed afterwards, since the protocol is untouched) and push the new head for re-review. - CI has not run on this head. Only the
labelcheck exists; thetestworkflow was never scheduled (first-contributor approval gate). The merge gate cannot close untiltestruns green on the exact head.
Code review (the feature itself):
- The Add-project flow now detects an archived project after catalog registration and returns
{ ok: false, reason: 'archived', projectId }instead of failing opaquely; all three entry points (app-shell project actions, task-entry workspace picker, projects settings page) present a confirm dialog and restore through the existingprojects:restorebridge andprojectManagement.restorepath. toast.confirmis a pre-existing@maka/uiAPI, and the type wiring is sound; copy covers en/zh-CN/zh-TW for the dialog keys.- Tests cover the archived detection, the confirm → restore → select flow, and restore-failure retry (pending state released).
- The added runtime-host error logging uses
generalizedErrorMessagefor the summary; one recorded P3: the rawerrorobject is also passed as the secondconsole.errorargument, which may still carry paths in the main-process log (not a user-facing surface, acceptable).
No P0–P2 code findings. This is a bugfix for #4935 and the direction is right, but the current head must not be merged: rebase onto current main and get CI approved/run first.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
… directory Adding a directory that belongs to an archived project previously just failed with no way forward. The add flow now returns an `archived` reason with the project id, and the app shell, task-entry workspace picker, and projects settings page offer a confirm dialog to restore the archived project in place. Also adds a `restoreProject` bridge method and error logging to the runtime-host project/skill catalog coordinators so commit_outcome_unknown failures are visible in logs.
9a27002 to
9669fcc
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for reusing the existing restore operation. Two normal entry paths still fail the intended restore-and-use contract: AppShell does not commit the selected project, and Settings waits for confirmation inside an Astryx async transition. Details inline. Please keep the repair at the existing selection and interaction boundaries rather than adding another restore coordinator.
中文
复用已有restore操作的方向正确,但AppShell没有提交项目选择,Settings则在Astryx异步transition内等待确认,两个入口都未完成预期操作。建议修在已有选择/交互接缝,不新增恢复协调器。
AI-assisted review at 9669fcce8. The coordinating Codex agent independently reproduced the Button/ToastProvider behavior in a browser through DOM-dispatched actions and checked the AppShell/Host selection calls; this was a component integration probe, not full-app acceptance.
Summary
Fixes #4935
When the Add project flow picks a directory that belongs to an archived project, it now returns an
{ ok: false, reason: 'archived', projectId }result instead of failing opaquely. All three entry points then show a confirm dialog offering to restore the archived project in place, after which the add/selection succeeds:app-shell-project-actions.ts)use-task-entry-controller.ts, newconfirmport with toast-confirm default)Also included:
projects.restoreProjectpreload bridge methodcommit_outcome_unknownmutation failures are visible in logs (usesgeneralizedErrorMessageto avoid leaking paths)Test plan
npm run build:testpassesnode --teston the touched suites (app-shell-project-actions,project-management-service,task-entry-controller,use-project-context): 28/28 pass, including new cases covering the archived → restore → select flow