-
Notifications
You must be signed in to change notification settings - Fork 6
feat(files): 统一文件夹自定义图标与 connector 图标展示契约 #556
Copy link
Copy link
Open
Labels
CI: RunningA pull request has required CI workflows that have not reached a terminal stateA pull request has required CI workflows that have not reached a terminal stateEnhancementNew feature or requestNew feature or requestPriority: LowLow priority issueLow priority issueScope: FilesCore file and folder product behaviorCore file and folder product behaviorScope: StorageStorage policies, connectors, drivers, provider capabilities, and storage backendsStorage policies, connectors, drivers, provider capabilities, and storage backendsStatus: Needs DecisionA product, evidence, or design decision is required before implementation commitmentA product, evidence, or design decision is required before implementation commitmentTracking: EpicParent or tracking issue whose completion is represented by linked sub-issues or phasesParent or tracking issue whose completion is represented by linked sub-issues or phasesTypeScriptPull requests that update JavaScript codePull requests that update JavaScript code
Milestone
Description
Metadata
Metadata
Labels
CI: RunningA pull request has required CI workflows that have not reached a terminal stateA pull request has required CI workflows that have not reached a terminal stateEnhancementNew feature or requestNew feature or requestPriority: LowLow priority issueLow priority issueScope: FilesCore file and folder product behaviorCore file and folder product behaviorScope: StorageStorage policies, connectors, drivers, provider capabilities, and storage backendsStorage policies, connectors, drivers, provider capabilities, and storage backendsStatus: Needs DecisionA product, evidence, or design decision is required before implementation commitmentA product, evidence, or design decision is required before implementation commitmentTracking: EpicParent or tracking issue whose completion is represented by linked sub-issues or phasesParent or tracking issue whose completion is represented by linked sub-issues or phasesTypeScriptPull requests that update JavaScript codePull requests that update JavaScript code
背景
AsterDrive 当前文件夹展示使用固定的 FolderGlyph / Folder 图标。存储 connector descriptor 已经有 connector-owned 的
icon_src/icon_name,但目前只用于管理员存储策略选择卡片;文件夹列表接口也没有返回目录的策略或展示元数据。后续需要支持:
推荐业务契约
展示优先级
第一期只把“显式绑定在当前文件夹上的 policy”作为 connector 展示来源。用户默认 policy、团队 policy group、祖先目录继承策略不直接伪装成当前文件夹属性;如未来需要展示 effective policy,单独增加
source: explicit | inherited | default的存储信息语义。后端统一返回展示语义
不要让前端拿
policy_id再查询 policy、按driver_type拼图标。由后端在目录服务层解析并返回稳定的展示 DTO,例如:该 DTO 需要复用到
FolderListItem、FolderInfo、FolderAncestorItem,并覆盖个人空间、团队空间、搜索、分享视图和目录树。公共分享默认只暴露自定义图标,不暴露 connector/storage 细节。Connector 图标
现有 descriptor 的图标能力应提升为稳定的 connector-owned asset contract:
文件夹自定义图标
自定义图标属于文件夹展示元数据,不应作为普通用户文件写入当前 storage policy:
建议拆分
子项 A:connector-owned icon contract
StorageConnectorUiDescriptor的图标字段收口为结构化、版本化的图标描述。子项 B:custom folder icon and unified folder presentation
FolderPresentation,由后端一次解析自定义图标、显式 policy connector 和默认图标。FolderGridItem、FolderNameCell、FolderTreeItemContent等入口改为统一图标渲染器。明确不做
driver_type/connector_id白名单矩阵。验收标准
当前调查依据
src/services/files/folder/models.rs:FolderListItem当前没有 policy 或 presentation 字段。src/services/workspace/models.rs:FolderInfo只有显式policy_id。crates/aster_drive_storage/src/connector_descriptor.rs:已有 connector-ownedicon_src/icon_name。src/services/workspace/storage_core/policy.rs:effective policy 还涉及祖先和个人/团队 policy group,不能由前端猜测。frontend-panel/src/components/files/FolderGlyph.tsx、FolderGridItem.tsx、FileTableCells.tsx、FolderTreeItemContent.tsx:当前展示入口分散,需要统一 renderer。这是设计和拆分跟踪 issue;实现前按上述契约补齐子 issue 和最终 API 形态。