diff --git a/server/src/__tests__/project-archive-restore-guidance.test.ts b/server/src/__tests__/project-archive-restore-guidance.test.ts new file mode 100644 index 00000000000..a060cff52a3 --- /dev/null +++ b/server/src/__tests__/project-archive-restore-guidance.test.ts @@ -0,0 +1,12 @@ +import { expect, it } from "vitest"; +import { searchRunnerApi } from "../services/native-runtime/runner-api-catalog.js"; + +it.each(["archive project update project", "unarchive restore project"])("search %j says where a person restores an archived project", query => { + const operation = searchRunnerApi({ query, limit: 10 }).results.find(row => row.operationId === "PATCH /api/projects/{id}"); + expect(operation, query).toBeDefined(); + const description = operation!.description; + expect(description).toContain("keeps the project, its tasks and their history"); + expect(description).toContain("Restoring sets archivedAt to null"); + expect(description).toContain("//projects//configuration, with the Unarchive button"); + expect(description).toContain("not restored from the company Status page"); +}); diff --git a/server/src/routes/openapi.ts b/server/src/routes/openapi.ts index 643a30d7c1c..559ed9bb23e 100644 --- a/server/src/routes/openapi.ts +++ b/server/src/routes/openapi.ts @@ -5330,7 +5330,9 @@ registry.registerPath({ path: "/api/projects/{id}", tags: ["projects"], summary: "Update project properties and defaults", - description: "Save project properties and defaults. The description holds shared project context and guidance, including checklists; goalIds links the project to its goals. Read the project back to verify the saved fields. Updating description or goalIds does not rewrite existing tasks or the inputs already admitted to active native runs; changing existing work is a separate operation. Environment and executionWorkspacePolicy fields configure separate project settings and are not required to save description or goalIds.", + description: "Save project properties and defaults. The description holds shared project context and guidance, including checklists; goalIds links the project to its goals. Read the project back to verify the saved fields. Updating description or goalIds does not rewrite existing tasks or the inputs already admitted to active native runs; changing existing work is a separate operation. Environment and executionWorkspacePolicy fields configure separate project settings and are not required to save description or goalIds. " + + "Archiving a project (archivedAt set to the current time) hides it from the sidebar and project selectors and keeps the project, its tasks and their history; no data is removed. Restoring sets archivedAt to null. " + + "A person unarchives a project on that project's own Configuration page, //projects//configuration, with the Unarchive button; give them that page as a Markdown link. Archived projects are not restored from the company Status page.", request: { params: z.object({ id: z.string() }), body: jsonBody(updateProjectSchema),