Repository navigation
Conversation
文件在列出或展示之后被移动或删除时,预览与产出页统一显示“加载失败”,用户分不清是文件不见了 还是预览本身出了问题。 现在运行时对这类情况返回 FILE_NOT_FOUND:空间文件服务与产出服务在文件缺失时抛出该错误码, 文件预览和产出页据此显示“文件已被移动或删除”,其他失败仍显示原来的加载失败提示。 补充了中英文文案与对应的单元测试。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
音频和视频文件此前无法预览:图片被整个读成 data URL,超过 1 MiB 的文件只显示文件名。 现在改用原生 video、audio 元素播放,由本地文件按字节范围流式提供。 - 新增 lexora-media 协议:每个请求都通过 spaceFiles.locate 重新校验空间授权, 按字节范围返回 206 或 416。 - SpaceFileService.read 对音频、视频只返回预览类型而不读取内容,并直接在预览视图中打开。 - lexora-artifact 协议同样按字节范围流式提供音频、视频产出,空间之外的产出在产出页 使用同一个播放器。 - CSP 增加 media-src,允许上述两个协议。 新增 mediaProtocol、mediaFiles、DesktopMediaContent 及空间文件、产出服务的单元测试。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景与关联 / Context and related issue
主要改动 / Changes
video、audio元素播放,由本地文件按字节范围流式提供。lexora-media协议:每个请求都通过spaceFiles.locate重新校验空间授权,按字节范围返回 206 或 416。SpaceFileService.read对音频、视频只返回预览类型而不读取内容,并直接在预览视图中打开;useDesktopWorkbench中这类文件不再走可编辑副本,直接作为预览打开。lexora-artifact协议同样按字节范围流式提供音频、视频产出,空间之外的产出在产出页使用同一个播放器。media-src,允许lexora-media:与lexora-artifact:。mediaProtocol、mediaFiles、DesktopMediaContent及空间文件、产出服务的单元测试。验证 / Verification
兼容与风险 / Compatibility and risks
useDesktopWorkbench.ts中打开文件的流程(媒体文件跳过copies.open直接走预览)和DesktopFilePreview.vue、DesktopDocumentContent.vue的属性传递,请重点审查。mediaProtocol.ts、serveMediaFile.ts中的授权校验、范围解析与错误码,以及 CSP 的改动。界面变更 / UI changes
音频、视频文件在文件管理器和产出页中直接显示播放器,而不是只显示文件名;无法播放时显示“无法播放此文件,可能是当前不支持的编码格式”。
🤖 Generated with Claude Code