feat(product-suite): persist context and confirm actions

This commit is contained in:
chengma
2026-07-16 19:12:21 +08:00
parent 717ed2e35f
commit c9afaad24b
8 changed files with 459 additions and 36 deletions
+6 -1
View File
@@ -470,6 +470,8 @@ def list_recoverable_draft_projects(path=None, conn=None):
WHERE p.deleted_at IS NULL
AND p.binding_state = ?
AND (
TRIM(COALESCE(p.draft_prompt, '')) <> ''
OR
EXISTS (
SELECT 1 FROM image_studio_assets AS a
WHERE a.project_id = p.id
@@ -493,9 +495,12 @@ def project_has_content(project_id, path=None, conn=None) -> bool:
SELECT 1 FROM image_studio_assets WHERE project_id = ?
) OR EXISTS(
SELECT 1 FROM image_studio_jobs WHERE project_id = ?
) OR EXISTS(
SELECT 1 FROM image_studio_projects
WHERE id = ? AND TRIM(COALESCE(draft_prompt, '')) <> ''
) AS has_content
""",
(int(project_id), int(project_id)),
(int(project_id), int(project_id), int(project_id)),
).fetchone()
return bool(row["has_content"] if row is not None else False)