diff --git a/docs/superpowers/plans/2026-08-01-navigation-tools-and-history-table.md b/docs/superpowers/plans/2026-08-01-navigation-tools-and-history-table.md new file mode 100644 index 0000000..7d18128 --- /dev/null +++ b/docs/superpowers/plans/2026-08-01-navigation-tools-and-history-table.md @@ -0,0 +1,71 @@ +# Navigation Tools And History Table Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Move shell utilities into the navigation rail and make every shared export-history table compact and filler-free. + +**Architecture:** `MainWindow` owns only header composition and passes the existing settings action into `NavigationRail`. `NavigationRail` owns a visually separated bottom utility box. `ExportHistoryPane` owns one semantic column specification in which only the file column is resizable. + +**Tech Stack:** Java 17, JavaFX 17, JUnit 5, Maven 3.8.6, existing Feather/Ikonli icon layer. + +## Global Constraints + +- Do not use subagents; execute this plan in the current task. +- Do not modify master or its untracked files; work only on `codex/table-layout-optimization`. +- Use TDD: observe the required test fail before changing production code. +- The header must create neither MENU nor SETTINGS buttons. +- Navigation bottom tools are ordered SETTINGS then collapse, with collapse last. +- The history table has exactly six semantic columns and no filler/empty column. +- Fixed widths are action 150px, index 64px, query 140px, count 88px, time 180px; file is the sole resizable column with min width 220px. + +--- + +### Task 1: Move shell utilities into the navigation rail + +**Files:** +- Modify: `src/test/java/com/example/workutils/system/ui/MainWindowArchitectureTest.java` +- Modify: `src/test/java/com/example/workutils/system/ui/shell/NavigationRailTest.java` +- Modify: `src/main/java/com/example/workutils/system/ui/MainWindow.java` +- Modify: `src/main/java/com/example/workutils/system/ui/shell/NavigationRail.java` +- Modify: `src/test/java/com/example/workutils/system/ui/NativeUiVisualAcceptanceFixture.java` + +**Interfaces:** +- `NavigationRail(List, Consumer, Runnable openSettings)` requires the existing settings callback. +- `selectSettings()` selects the utility entry and clears business navigation selection. + +- [ ] Write tests asserting a four-child header (brand, chevron, title, spacer), no `#menu-button`/`#settings-button`, bottom tool ordering, collapsed settings discoverability, settings route, and bottom-only collapse. +- [ ] Run `mvn -q -o -Dtest=MainWindowArchitectureTest,NavigationRailTest test` and confirm failures reference the existing header buttons/missing rail settings entry. +- [ ] Remove both header buttons, add the bottom settings toggle, preserve the existing embedded settings callback, and keep plugin/settings selections mutually exclusive. +- [ ] Update the safe visual fixture constructor call for the explicit settings callback. +- [ ] Re-run the focused tests and commit with message `优化导航底部工具区`. + +### Task 2: Apply semantic widths to the shared history table + +**Files:** +- Create: `src/test/java/com/example/workutils/system/ui/history/ExportHistoryPaneLayoutTest.java` +- Modify: `src/main/java/com/example/workutils/system/ui/history/ExportHistoryPane.java` + +**Interfaces:** +- Existing constructors remain unchanged for API, Scanner, and MyBatis consumers. +- `table()` remains the test/accessibility entry point. + +- [ ] Add JavaFX tests that build a real `ExportHistoryPane`, assert exactly six titled columns, assert all five fixed sizes/resizable flags, and assert only the file column grows when the table widens. +- [ ] Run `mvn -q -o -Dtest=ExportHistoryPaneLayoutTest test` and confirm the old equal-width behavior fails. +- [ ] Apply constrained resize with five non-resizable semantic columns and one resizable file column using the exact global widths. +- [ ] Run `ExportHistoryPaneLayoutTest,SharedPaneAccessibilityTest` and verify all consumers still use the unchanged shared constructor. +- [ ] Commit with message `统一导出历史表格列宽`. + +### Task 3: Visual and cumulative verification + +**Files:** +- Modify if required: `src/test/java/com/example/workutils/system/ui/NativeUiVisualAcceptanceFixture.java` +- Output (ignored): `.superpowers/sdd/2026-08-01-navigation-tools-and-history-table/visual-acceptance/` + +**Interfaces:** +- Reuse the opt-in JavaFX visual fixture; do not add business side effects. + +- [ ] Generate real Scene screenshots at 1440x900 and 1024x768 for expanded/collapsed/selected states including the bottom tools. +- [ ] Put the user screenshot and generated screenshots in the same visual comparison input and check header, bottom tool order, collapsed discoverability, table widths, and filler removal. +- [ ] Run `mvn -q -o test`, `mvn -q -o -DskipTests compile`, and `git diff --check master..HEAD`. +- [ ] Self-review the full branch for API-specific hacks, empty columns, duplicated actions, stale tests, and unrelated changes. +- [ ] Commit any fixture-only adjustment separately as `补充公共表格视觉验收`. diff --git a/docs/superpowers/specs/2026-08-01-navigation-tools-and-history-table-design.md b/docs/superpowers/specs/2026-08-01-navigation-tools-and-history-table-design.md new file mode 100644 index 0000000..db877b0 --- /dev/null +++ b/docs/superpowers/specs/2026-08-01-navigation-tools-and-history-table-design.md @@ -0,0 +1,38 @@ +# 底部工具区与公共历史表格优化设计 + +## 目标 + +根据用户验收截图修复两个公共 UI 问题:消除应用顶部重复操作入口,并让 API、扫描、MyBatis SQL 导出的共享历史表格使用稳定、可读且无 filler 空白的列宽布局。 + +## 应用外壳 + +- 顶部栏只保留 WorkUtils 品牌、插件面包屑/页面标题和弹性留白。 +- 顶部不创建 `MENU` 或 `SETTINGS` 按钮;删除而不是按状态隐藏。 +- `NavigationRail` 底部建立独立工具区,与业务插件列表通过 1px 分隔线分组。 +- 工具区固定顺序为:系统设置、展开/收缩。展开/收缩永远是最底部控件。 +- 展开态设置入口显示 Feather 齿轮和“系统设置”;折叠态只显示齿轮,同时保留 Tooltip 和 accessible text。 +- 设置入口复用现有 `openSettingsEmbedded` 路由和内容区,不创建新窗口、不改变配置格式。 +- 设置入口使用与业务导航一致的 hover、selected、focus 语义;进入插件时取消设置选中态,进入设置时清除业务插件选中态。 + +## 公共历史表格 + +- 修复点只位于共享 `ExportHistoryPane`,不为 API 页面增加专属列或条件分支。 +- 表格维持六个真实语义列:操作、序号、查询/格式、生成文件、数量、时间;不添加空列。 +- 操作列固定 150px,序号列固定 64px,查询/格式列固定 140px,数量列固定 88px,时间列固定 180px。 +- 生成文件列是唯一可调整列,最小 220px,并吸收表格扣除固定列后的全部剩余宽度。 +- 使用 JavaFX constrained resize policy,使表头和数据行铺满可用宽度,不出现右侧 filler。 +- Scanner、MyBatis SQL 导出、API 历史继续通过原有 `ExportHistoryPane` 构造器使用同一策略。 + +## 验收与回归 + +- 架构测试证明顶部没有 MENU/SETTINGS 按钮,底部工具区顺序正确。 +- 行为测试覆盖设置路由、插件返回、折叠 Tooltip/accessibility 和底部唯一折叠入口。 +- 表格测试覆盖列数、列标题、固定列宽、序号紧凑、文件列唯一增长以及宽表格无 filler。 +- 运行聚焦测试、全量测试、编译和 `git diff --check`。 +- 用真实 JavaFX Scene 截图与用户截图同批对照;不伪造 Windows 原生标题栏。 + +## 自审 + +- 范围仅包含已批准的外壳入口调整和共享历史表格布局。 +- 没有 API 专属 hack、空 filler 列、新窗口、配置迁移或业务行为变化。 +- 所有尺寸、顺序和选择语义均已明确,没有待定项。