From a644e93604db9dc521c6cec5f1770617f3cd54e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Thu, 15 Oct 2026 14:27:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E4=B8=89=E6=80=81=E5=88=86=E7=A6=BB?= =?UTF-8?q?=E4=B8=8E=E5=8F=8D=E9=A6=88=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - notFound/已归档/加载失败三态分离:单查兜底+归档恢复入口+加载失败重试钮 - 反馈一致性六项:同步守卫与完成提示/首屏并行加载/筛选空态文案/计数改过滤口径/路径勾选 seq 守卫/删除确认危险态 - 文件列表滚动条对齐全局范式(scrollbar-width:thin 致 Chromium 忽略定制样式) - 删除失败不再跳转(store 返布尔)/幽灵勾选清理/折叠阈值与 CSS 对齐 --- src/api/types.ts | 2 + src/components/project/FileExplorer.vue | 43 +----- src/i18n/en/common.ts | 1 + src/i18n/en/projectDetail.ts | 7 + src/i18n/zh-CN/common.ts | 1 + src/i18n/zh-CN/projectDetail.ts | 7 + src/stores/project/projects.ts | 7 +- src/views/ProjectDetail.vue | 170 +++++++++++++++++++----- 8 files changed, 167 insertions(+), 71 deletions(-) diff --git a/src/api/types.ts b/src/api/types.ts index 75099ed..4ccd0c3 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -104,6 +104,8 @@ export interface ProjectRecord { path: string | null /** 技术栈 JSON 数组字符串(如 ["rust","vue"],null=未探测) */ stack: string | null + /** 归档标记(归档功能 P2,V48)。true=归档态,退出主列表仅归档箱可见;详情页据此区分「已归档」与「不存在」 */ + archived?: boolean created_at: string updated_at: string /** diff --git a/src/components/project/FileExplorer.vue b/src/components/project/FileExplorer.vue index 62ec928..258ff6e 100644 --- a/src/components/project/FileExplorer.vue +++ b/src/components/project/FileExplorer.vue @@ -809,7 +809,9 @@ async function onRemoveModule() { overflow-y: auto; overflow-x: hidden; padding: 4px 4px 4px 0; - scrollbar-width: thin; + /* 滚动条样式走全局 ::-webkit-scrollbar(5px + var(--df-scrollbar) 主题色): + 此处不得设 scrollbar-width —— Chromium 121+ 一旦设了标准 scrollbar-* 属性, + 该元素 ::-webkit-scrollbar 定制即失效,文件列表会回退成原生样式滚动条(不随主题) */ } .explorer-changes { @@ -888,43 +890,8 @@ async function onRemoveModule() { min-height: 200px; } -/* 全局滚动条样式(薄) */ -.explorer-sidebar ::-webkit-scrollbar { - width: 5px; - height: 5px; -} - -.explorer-sidebar ::-webkit-scrollbar-thumb { - background: rgba(255, 255, 255, 0.08); - border-radius: var(--df-radius-xs); -} - -.explorer-sidebar ::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.14); -} - -.explorer-sidebar ::-webkit-scrollbar-track { - background: transparent; -} - -/* 文件列表(.explorer-tree)滚动条显式对齐全局,与右侧预览区一致 */ -.explorer-tree ::-webkit-scrollbar { - width: 5px; - height: 5px; -} - -.explorer-tree ::-webkit-scrollbar-thumb { - background: rgba(255, 255, 255, 0.08); - border-radius: var(--df-radius-xs); -} - -.explorer-tree ::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.14); -} - -.explorer-tree ::-webkit-scrollbar-track { - background: transparent; -} +/* 滚动条统一样式(styles/global.css 全局 ::-webkit-scrollbar:5px + var(--df-scrollbar))已覆盖, + 此处不重复声明 —— 原局部副本硬编码白色系 rgba,浅色主题下 thumb 不可见 */ /* 窄窗口自适应 */ @media (max-width: 900px) { diff --git a/src/i18n/en/common.ts b/src/i18n/en/common.ts index 0b81617..baab1cd 100644 --- a/src/i18n/en/common.ts +++ b/src/i18n/en/common.ts @@ -13,6 +13,7 @@ export default { edit: 'Edit', close: 'Close', loading: 'Loading…', + retry: 'Retry', unknownError: 'Unknown error', // Collapse/expand (reusable generic verbs for description/log/future long content) expand: 'Expand', diff --git a/src/i18n/en/projectDetail.ts b/src/i18n/en/projectDetail.ts index f984f54..83e3a87 100644 --- a/src/i18n/en/projectDetail.ts +++ b/src/i18n/en/projectDetail.ts @@ -33,6 +33,13 @@ export default { taskListTitle: '🔀 Tasks', taskCount: '{n} tasks', emptyTasks: 'No tasks yet', + filterEmptyTasks: 'No tasks match the current filter', + // Sync (PD5-9) + syncDone: 'Sync complete', + // PD5-4 tri-state: archived (restore from archive box) + archivedNotice: 'This project is archived and not in the project list', + restoreFromArchive: 'Restore from Archive', + restoreSuccess: 'Restored to the project list', // Workflow log panel workflowLogTitle: '📋 Workflow Log', // A2[PD-P1-3]: event stream has no project_id dimension, cannot filter per project; label "global events" to avoid misreading as this project's logs diff --git a/src/i18n/zh-CN/common.ts b/src/i18n/zh-CN/common.ts index b413f64..4409e05 100644 --- a/src/i18n/zh-CN/common.ts +++ b/src/i18n/zh-CN/common.ts @@ -13,6 +13,7 @@ export default { edit: '编辑', close: '关闭', loading: '加载中…', + retry: '重试', unknownError: '未知错误', // 折叠/展开(可复用通用词,描述折叠/日志折叠/未来长内容) expand: '展开', diff --git a/src/i18n/zh-CN/projectDetail.ts b/src/i18n/zh-CN/projectDetail.ts index f668371..aedc075 100644 --- a/src/i18n/zh-CN/projectDetail.ts +++ b/src/i18n/zh-CN/projectDetail.ts @@ -33,6 +33,13 @@ export default { taskListTitle: '🔀 任务列表', taskCount: '{n} 个任务', emptyTasks: '暂无任务', + filterEmptyTasks: '当前筛选无任务', + // 同步(PD5-9) + syncDone: '同步完成', + // PD5-4 三态:已归档(归档箱恢复) + archivedNotice: '项目已归档,不在项目列表中', + restoreFromArchive: '从归档箱恢复', + restoreSuccess: '已恢复到项目列表', // 工作流日志面板 workflowLogTitle: '📋 工作流日志', // A2[PD-P1-3]:事件流无 project_id 维度,无法按项目过滤,标注「全局事件」避免误读为本项目 diff --git a/src/stores/project/projects.ts b/src/stores/project/projects.ts index fe74c91..707f156 100644 --- a/src/stores/project/projects.ts +++ b/src/stores/project/projects.ts @@ -54,11 +54,14 @@ export function createProjectsStore() { return record } - async function deleteProject(id: string) { - await runWithCatch(state, t('projects.err.deleteFailed'), async () => { + async function deleteProject(id: string): Promise { + // 返成功布尔(失败时 runWithCatch 已置 state.error),详情页删除据此阻断失败后的误跳转 + const ok = await runWithCatch(state, t('projects.err.deleteFailed'), async () => { await projectApi.delete(id) // 软删 → 回收站(可恢复) state.projects = state.projects.filter(p => p.id !== id) + return true }) + return ok === true } async function loadDeletedProjects() { diff --git a/src/views/ProjectDetail.vue b/src/views/ProjectDetail.vue index bb53537..4dd940b 100644 --- a/src/views/ProjectDetail.vue +++ b/src/views/ProjectDetail.vue @@ -2,11 +2,22 @@
{{ $t('common.loading') }}
+ +
+

{{ store.error }}

+ +

{{ $t('projectDetail.notFound') }}

{{ $t('projectDetail.backToList') }}
+ +
+

{{ $t('projectDetail.archivedNotice') }}

+ + {{ $t('projectDetail.backToList') }} +