Skip to content

fix(buddy): 区分文件被移动或删除与其他预览失败 - #406

Merged
shanyuhai123 merged 3 commits into
useLexora:masterfrom
QAyong:codex/distinguish-missing-file-preview
Oct 22, 2026
Merged

shanyuhai123 merged 3 commits into
useLexora:masterfrom
QAyong:codex/distinguish-missing-file-preview

Conversation

@QAyong

@QAyong QAyong commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

背景与关联 / Context and related issue

  • 问题或目标 / Problem or goal: 文件在被列出或展示之后被移动、删除,文件预览和任务产出页会统一显示“加载失败”,用户分不清是文件不见了,还是预览本身出了问题,也不知道该不该重试。
  • 关联 Issue / Related issue: N/A

主要改动 / Changes

  • 变更 / Change: 空间文件服务和产出服务在文件缺失时抛出稳定的 FILE_NOT_FOUND 错误码(运行时与前端错误解析各增加该码)。文件预览组件和产出页据此显示新增文案“文件已被移动或删除”,其他失败仍显示原来的加载失败提示,重试按钮保留。补充了中英文文案,并为 ArtifactService、SpaceFileService、useResourcePreviews 各增加了单元测试。

验证 / Verification

  • 自动检查 / Automated checks: 未在本分支本地运行,交由 CI 验证;改动自带上述三处单元测试。
  • 手动验证 / Manual verification: 无。
  • 未执行 / Not run: 本地 lint、类型检查、测试套件,以及对“打开文件后在磁盘上删除或移走它”这一场景的手动验证。

兼容与风险 / Compatibility and risks

不适用 / N/A。只是把一类已有的失败细分出更准确的提示,没有改变存储、授权或迁移。

界面变更 / UI changes

文件缺失时,预览区与产出页的提示由“加载失败”变为“文件已被移动或删除”。

🤖 Generated with Claude Code

文件在列出或展示之后被移动或删除时,预览与产出页统一显示“加载失败”,用户分不清是文件不见了
还是预览本身出了问题。

现在运行时对这类情况返回 FILE_NOT_FOUND:空间文件服务与产出服务在文件缺失时抛出该错误码,
文件预览和产出页据此显示“文件已被移动或删除”,其他失败仍显示原来的加载失败提示。
补充了中英文文案与对应的单元测试。

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@shanyuhai123
shanyuhai123 merged commit bbb1bb0 into useLexora:master Oct 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants