diff --git a/CHANGELOG.md b/CHANGELOG.md index e5a6f52..c44b305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,13 @@ > `0.1.12`),由 `scripts/version.py` 从 git **算出来**;开发交付的独立说明写入本文件“开发快照”章节,并打 `snapshot/vX.Y.Z` 注释标签 ⇒ 每次开发交付均可追溯, > 但"发布版本"仍然只能由人定(CI 不会自动升版本、不会打 tag)。 +## 开发快照 snapshot/v0.1.52 - 2026-10-24 + +### Changed + +- 移除系统顶部的已打开页面标签栏及关闭入口,保留左侧功能导航、当前位置、来源路径和表格分页。 +- 左侧导航文字放大至16px、图标放大至20px,图标区域24px、导航项最小高度44px,手机抽屉同步生效。 + ## 开发快照 snapshot/v0.1.51 - 2026-10-24 ### Changed diff --git a/web/src/App.test.tsx b/web/src/App.test.tsx index 05e8079..fdade6a 100644 --- a/web/src/App.test.tsx +++ b/web/src/App.test.tsx @@ -28,7 +28,6 @@ describe('WorkspaceShell', () => {
工作区内容
, @@ -44,36 +43,38 @@ describe('WorkspaceShell', () => { expect(html).not.toContain('P2 本地治理环境') }) - it('renders open tabs and marks the active tab', () => { + it('omits the system open-page tab strip while retaining navigation and the current location', () => { const html = renderToStaticMarkup(
工作区内容
, ) - expect(html).toContain('aria-label="已打开页面"') + expect(html).not.toContain('aria-label="已打开页面"') + expect(html).not.toContain('class="tab-list"') + expect(html).not.toContain('class="workspace-tab') expect(html).toContain('来源与目录') expect(html).toContain('解析监控') expect(html).toContain('发布管理') - expect(html).toContain('aria-current="page"') + expect(html).toContain('aria-label="当前位置"') + expect(html).toContain('解析监控') + expect(html).toContain('class="nav-item active"') }) - it('offers close controls only for unpinned tabs', () => { + it('does not render obsolete module-tab close controls', () => { const html = renderToStaticMarkup(
工作区内容
, ) - expect(html).toContain('aria-label="关闭解析监控标签"') + expect(html).not.toContain('aria-label="关闭解析监控标签"') expect(html).not.toContain('aria-label="关闭来源与目录标签"') }) @@ -82,7 +83,6 @@ describe('WorkspaceShell', () => {
工作区内容
, @@ -94,11 +94,13 @@ describe('WorkspaceShell', () => { }) describe('App', () => { - it('renders the dashboard inside the multi-tab workspace by default', () => { + it('renders the dashboard inside the workspace without the system page tabs', () => { const html = renderToStaticMarkup() expect(html).toContain('aria-label="功能导航"') - expect(html).toContain('aria-label="已打开页面"') + expect(html).not.toContain('aria-label="已打开页面"') + expect(html).not.toContain('class="tab-list"') + expect(html).not.toContain('class="workspace-tab') expect(html).toContain('

来源与目录

') expect(html).not.toContain('最近任务') }) diff --git a/web/src/App.tsx b/web/src/App.tsx index a25fff7..0d213e6 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -52,7 +52,7 @@ import { fetchSourceConnections, fetchSourceScanDetail, fetchSourceScans, trigge import type { SourceConnectionPage, SourceScanDetail, SourceScanPage } from './sourceConnections' import { fetchTestPublications, retryPublication } from './testPublications' import type { ProcessingState, TestPublicationPage } from './testPublications' -import { closeModule, initialWorkspace, openModule, restoreWorkspace } from './workspace' +import { initialWorkspace, openModule, restoreWorkspace } from './workspace' import type { ModuleId, WorkspaceState } from './workspace' const workspaceStorageKey = 'knowledge-governance.workspace.v1' @@ -69,7 +69,6 @@ const modules: ReadonlyArray<{ id: ModuleId; label: string; icon: string }> = [ interface WorkspaceShellProps { workspace: WorkspaceState onOpen: (moduleId: ModuleId) => void - onClose: (moduleId: ModuleId) => void children: React.ReactNode } @@ -141,38 +140,6 @@ export function WorkspaceShell(props: WorkspaceShellProps) { {activeModule?.label ?? '工作台'} -
- {props.workspace.openTabs.map((tabId) => { - const module = modules.find((item) => item.id === tabId) - if (!module) return null - const active = props.workspace.activeTab === tabId - return ( -
- - {tabId !== 'dashboard' ? ( - - ) : null} -
- ) - })} -
@@ -2992,7 +2959,6 @@ export default function App() { setWorkspace((current) => openModule(current, moduleId))} - onClose={(moduleId) => setWorkspace((current) => closeModule(current, moduleId))} > {workspace.activeTab === 'dashboard' ? ( diff --git a/web/src/responsiveStyles.test.ts b/web/src/responsiveStyles.test.ts index f7a222d..afd0ba8 100644 --- a/web/src/responsiveStyles.test.ts +++ b/web/src/responsiveStyles.test.ts @@ -5,8 +5,16 @@ import { readFileSync } from 'node:fs' const styles = readFileSync(new URL('./styles.css', import.meta.url), 'utf8') describe('mobile workspace navigation styles', () => { - it('keeps only the active workspace tab and hamburger navigation on narrow screens', () => { - expect(styles).toMatch(/@media \(max-width: 760px\)[\s\S]*?\.workspace-tab:not\(\.active\)\s*\{\s*display:\s*none;/) + it('keeps the hamburger navigation and collapses only source context on narrow screens', () => { expect(styles).toMatch(/@media \(max-width: 760px\)[\s\S]*?\.workspace-context-tabs\s*\{\s*display:\s*none;/) }) + it('enlarges sidebar labels and icons with comfortable navigation targets', () => { + const item = styles.match(/\.nav-item\s*\{([^}]+)\}/)![1] + const icon = styles.match(/\.nav-icon\s*\{([^}]+)\}/)![1] + expect(item).toMatch(/font-size:\s*16px;/) + expect(item).toMatch(/min-height:\s*44px;/) + expect(icon).toMatch(/font-size:\s*20px;/) + expect(icon).toMatch(/width:\s*24px;/) + expect(icon).toMatch(/height:\s*24px;/) + }) }) diff --git a/web/src/styles.css b/web/src/styles.css index 0abe816..98f4ad9 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -219,12 +219,13 @@ code { gap: 10px; border: 1px solid transparent; border-radius: var(--r-md); - padding: 7px 10px; + padding: 9px 10px; color: #8aa2b3; background: transparent; box-shadow: none; font-weight: 500; - font-size: 12.5px; + font-size: 16px; + min-height: 44px; text-align: left; transition: background 120ms ease, color 120ms ease; } @@ -244,12 +245,12 @@ code { .nav-icon { display: grid; - width: 18px; - height: 18px; + width: 24px; + height: 24px; flex: none; place-items: center; color: var(--side-accent); - font-size: 13px; + font-size: 20px; } .sidebar-footer { @@ -317,15 +318,6 @@ code { font-weight: 600; } -.tab-list { - display: flex; - min-width: 0; - gap: 2px; - overflow-x: auto; - padding: 8px 16px 0; - scrollbar-width: thin; -} - .workspace-context-tabs { display: flex; min-width: 0; @@ -361,25 +353,6 @@ code { font-weight: 600; } -.workspace-tab { - display: flex; - height: 36px; - flex: none; - align-items: center; - border: 1px solid transparent; - border-bottom: 0; - border-radius: var(--r-md) var(--r-md) 0 0; - background: transparent; -} - -.workspace-tab.active { - border-color: var(--border-base); - background: var(--bg-page); - box-shadow: inset 0 2px var(--c-run); -} - -.tab-activate, -.tab-close, .mobile-nav-toggle, .sidebar-backdrop { border-radius: 0; @@ -390,44 +363,6 @@ code { border: 0; } -.tab-activate { - display: flex; - height: 100%; - align-items: center; - gap: 6px; - padding: 0 11px; - color: var(--ink-mute); - font-size: 12px; - font-weight: 500; -} - -.workspace-tab.active .tab-activate { - color: var(--ink-strong); - font-weight: 600; -} - -.tab-activate span { - color: var(--c-cyan); - font-size: 12px; -} - -.tab-close { - display: grid; - width: 20px; - height: 20px; - margin-right: 6px; - place-items: center; - border-radius: var(--r-sm); - color: var(--ink-faint); - font-size: 16px; - line-height: 1; -} - -.tab-close:hover { - color: var(--c-fail); - background: var(--c-fail-bg); -} - .workspace-content { min-width: 0; flex: 1; @@ -1856,15 +1791,6 @@ tbody tr:hover { } .workspace-topbar { align-items: center; } .workspace-context-tabs { display: none; } - .workspace-tab:not(.active) { display: none; } - .workspace-tab.active { min-width: 0; max-width: 100%; } - .workspace-tab.active .tab-activate { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - .workspace-tab.active .tab-close { width: 32px; height: 32px; flex: none; } .mobile-nav-toggle { display: grid; width: 32px; @@ -1878,7 +1804,6 @@ tbody tr:hover { font-size: 16px; border: 1px solid var(--border-base); } - .tab-list { flex: 1; overflow: hidden; padding-left: 6px; } } @media (max-width: 620px) {