Skip to content

fix(desktop): offer to restore an archived project when re-adding its directory - #4936

Open
faga295 wants to merge 1 commit into
apache:mainfrom
faga295:fix/create_archived_project
Open

fix(desktop): offer to restore an archived project when re-adding its directory#4936
faga295 wants to merge 1 commit into
apache:mainfrom
faga295:fix/create_archived_project

Conversation

@faga295

@faga295 faga295 commented Sep 6, 2026

Copy link
Copy Markdown

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 (app-shell-project-actions.ts)
  • task-entry workspace picker (use-task-entry-controller.ts, new confirm port with toast-confirm default)
  • projects settings page

Also included:

  • new projects.restoreProject preload bridge method
  • error logging in the runtime-host project/skill catalog coordinators so commit_outcome_unknown mutation failures are visible in logs (uses generalizedErrorMessage to avoid leaking paths)
  • localized copy for the restore dialog (en/zh)

Test plan

  • npm run build:test passes
  • node --test on 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

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 6, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this PR at head 9a27002c (17 files, +262/−21) against base 2310035a.

Gate is not ready — two blockers:

  1. Protocol epoch regression on merge. The head's packages/runtime-host/src/protocol/index.ts declares RUNTIME_HOST_COMPATIBILITY_EPOCH = 112, while the live base and current main are at 121 (nine versions newer). The branch forked from epoch-112-era main and 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 behind main. 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 current main (no epoch bump is needed afterwards, since the protocol is untouched) and push the new head for re-review.
  2. CI has not run on this head. Only the label check exists; the test workflow was never scheduled (first-contributor approval gate). The merge gate cannot close until test runs 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 existing projects:restore bridge and projectManagement.restore path.
  • toast.confirm is a pre-existing @maka/ui API, 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 generalizedErrorMessage for the summary; one recorded P3: the raw error object is also passed as the second console.error argument, 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.
@faga295
faga295 force-pushed the fix/create_archived_project branch from 9a27002 to 9669fcc Compare September 7, 2026 02:50
@faga295
faga295 requested a review from Astro-Han September 7, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding a directory that belongs to an archived project fails with no way to restore it

2 participants