fix: keep workspace file controls visible while scrolling

Scroll the file list independently so view selection, refresh, creation actions and directory navigation remain visible. Keep the selected Files entry available in projects without Git.

Add component coverage and 16 Electron layout scenarios for themes, window sizes and scroll retention. Focused tests, typecheck and lint passed; the full test run timed out after 200 seconds.

Release note: Workspace file controls remain visible while scrolling, and projects without Git retain the Files entry.
This commit is contained in:
mesalogo
2026-09-30 17:33:16 +08:00
parent 80edd15438
commit ab85e72f01
7 changed files with 274 additions and 7 deletions
+2 -1
View File
@@ -393,7 +393,7 @@ Renderer 不接收任意系统 PID 控制能力。控制动作引用 Main 签发
当前项目目录的文件浏览与 Git 交互遵循以下规则:
- FR-W1:顶部同一行放置“文件 / Git 工作区”视图切换和右侧刷新;非 Git 目录仍保留刷新。
- FR-W1:顶部同一行放置“文件 / Git 工作区”视图切换和右侧刷新;非 Git 目录仍显示选中的“文件”入口和刷新,仅隐藏“Git 工作区”。
下一行只提供当前视图的工具:文件视图提供新建文件、新建目录,Git 视图提供分支、Fetch 和更改显示方式,
不在 Git 视图重复目录导航或新建文件操作。操作使用带名称和提示的紧凑图标按钮。
文件视图在根目录不显示孤立的文件夹图标或空路径行;进入子目录后提供“项目目录名 / 子目录”
@@ -401,6 +401,7 @@ Renderer 不接收任意系统 PID 控制能力。控制动作引用 Main 签发
长目录名单行省略,完整路径通过提示查看;多级路径在导航内部横向滚动,不撑宽工作栏。
选中目录时在该目录创建,选中文件时在其父目录创建,未选择时在当前浏览目录创建。
无可用目录时隐藏无关操作。
文件列表独立纵向滚动;顶部视图切换、刷新、新建操作和子目录路径导航保持可见,不随列表滚走。
- 使用共享 `SegmentedControl` 切换“文件”和“Git 工作区”,默认显示文件;
选择只在当前面板挂载期间保存在内存中,不持久化。未提交更改包含当前项目的全部
Git 更改,不按 AI、用户或其他工具的修改来源筛选。