feat(web): global asset library page + sound library (#56)#115
Merged
Conversation
跨项目全局素材库前端页(独立于项目内 MediaPanel,数据走 #55 的 library_* 命令): - LibraryView.tsx:分类树(全部/视频/音频/音效/图片/特效 + 自建分类)、网格、 搜索/排序、星标(取消收藏)、改分类、导入当前项目;收藏跨子库视图聚合可见。 - libraryStore.ts:库 store + 纯派生函数(selectEntries/deriveCustomCategories), 音效(category==='sound')与音频分流;importToProject 导入后 refreshMedia。 - libraryApi.ts:#55 命令的 Tauri 封装,非 Tauri 安全降级。 - libraryStore.test.ts:9 个单测覆盖聚合/分流/过滤/搜索/排序。 - 共享文件极小接入:uiStore AppView+"library"、App 路由、Home/TitleBar 入口、 dict library.* 键块(zh+en)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
appergb
approved these changes
Jun 23, 2026
appergb
left a comment
Owner
There was a problem hiding this comment.
审核通过 ✅(自动审核流程 · 主控亲审)
- #37-C 全局库前端:独立 LibraryView 全屏视图 + 独立 libraryStore(不复用/不碰 mediaStore,与 #91 重写区零冲突,仅 import 既有 refreshMedia)。Home 侧栏 + TitleBar 入口。
- 已核实前端↔后端运行时契约一致:libraryApi 的 7 个 invoke 命令名、参数名(favorite 用 source/kind/category/thumb)、DTO 字段(kind→type rename、favoritedAt camelCase)与 main 上 #106 的 src-tauri/src/library.rs 逐一匹配——tsc/CI 验不了 Rust invoke 契约,故我对照后端确认无误。
- 分类树(视频/音频/音效/图片/特效/自建)+ 网格 + 搜索 + 排序 + 跨视图聚合(all)+ 音效/音频按 category==='sound' 分流;9 个纯派生函数单测;i18n 中英对称;非 Tauri 安全降级。CI 双绿。
- 本 PR 合并即收口 #37 全局库 epic(后端 #104/#106 + 前端 #115)。
follow-up(非阻塞):① 库→时间线拖拽未做,现用「导入当前项目」按钮替代(#56 验收意图达成);② 媒体面板「星标→library_favorite」接线属另一半(空态文案已引导),待接;③ 本 PR 改了 HomeView.tsx,在飞 #78 rebase 时需合并此处改动。
H-Chris233
pushed a commit
to H-Chris233/OpenTake
that referenced
this pull request
Jun 24, 2026
…+ caption-sync appergb#113 merged
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.
概述
跨项目全局素材库前端页(独立于项目内 MediaPanel,数据走 #55 的
library_*Tauri 命令)。本 PR 是 #109 因其 base 分支feat-55-library-commands随 #106 合并被删而被 GitHub 连带自动关闭后,基于最新main(已含 #54/#55)重开的等价 PR——代码本身未被 review 否决。改动(9 文件,+1064/-4)
全新文件实现,不碰任何在飞前端 PR 的改动区:
web/src/components/media/LibraryView.tsx(新):分类树(全部/视频/音频/音效/图片/特效 + 自建分类)、网格、搜索/排序、星标取消收藏、改分类、导入当前项目;收藏跨子库视图聚合可见。web/src/store/libraryStore.ts(新):库 store + 纯派生函数(selectEntries/deriveCustomCategories),音效(category==='sound')与音频分流;importToProject导入后refreshMedia。web/src/lib/libraryApi.ts(新):[#37-B] 全局库 Tauri 命令层(list/favorite/categorize/rename/delete/import_to_project) #55 命令的 Tauri 封装,非 Tauri 环境安全降级。web/src/store/libraryStore.test.ts(新):9 个单测覆盖聚合/分流/过滤/搜索/排序。共享文件极小接入点(rebase 到 main 后无冲突自动合入):
uiStore.ts:AppView联合追加"library"App.tsx:view === "library"路由HomeView.tsx/TitleBar.tsx:库入口i18n/dict.ts:末尾library.*键块(zh + en)#56 验收对照
library_*命令验证
rebase 到最新
main(领先原 base 10 提交,含 #54/#55/#110/#111/#112),零冲突。tsc -b:通过(无类型错误)vite build:通过(1648 modules,built in 1.66s)vitest run:52/52 通过(含本 PR 9 个 libraryStore 测试)不碰在飞 PR(#113/#108/#105/#79/#78/#77)的改动区。
Closes #56