List only excludes project-data refs, but delete also kept canvas-card
files with the same 'referenced' reason the UI merged into 被项目使用或
无法删除 — every fresh playground output (materialized as a canvas card)
looked undeletable from 素材库 with a wrong explanation.
Backend: split the kept reason into referenced (project data) vs
on_canvas (live canvas card); protections unchanged.
Frontend: per-reason kept summary with counts and an actionable hint,
error toast names failure and stays retryable, readable API error text.
E2E: isolated real-page regression (cancel/single/batch/retry) +
backend tests for the on_canvas reason.
Co-authored-by: multica-agent <github@multica.ai>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
修复内容(HEL-872 素材库无法删除素材)
根因(实证)
GET /api/library/media只排除项目数据引用,而DELETE额外保留"仍在画布卡片上"的文件;每个 playground 生成物都会被前端物化为画布卡片(materializeJobArtifact),因此用户新生成的素材在素材库可见却删不掉。改动
calliope-backend/src/calliope/routers/library.py:删除保留原因拆分为referenced(项目数据)与新增on_canvas(画布卡片);保护逻辑、路径/越界/符号链接检查不变。calliope-web/src/routes/library/+page.svelte:按原因分类汇总保留数(如「保留 1 个:仍在画布中使用 1;画布中的素材请先删除对应卡片」);0 删除时明确报「未能删除 N 个文件」;失败提示改用可读的 detail 并保持弹层可重试;确认弹层文案补画布说明。自测
tests/test_asset_library.py9 项(新增 on_canvas 判定与混合批次 2 项)+ canvas/playground 相关 33 项,共 42 通过;Ruff 对改动文件无新增告警。npm run test通过、build 成功。