Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions desktop/internal/workbench/filetree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,38 @@ func TestProjectTreeBatchSelectionFollowsCore(t *testing.T) {
}
}

// TestProjectTreeShowsUnixNamesWithBackslashes is #2009: on macOS and Linux a backslash is part
// of a file name, as in the folder `D:\logs` that Spring Boot creates for a Windows-style
// `logging.file.path`. Core used to report it as `D:/logs`, two levels deep, so the rows of the
// tree failed with "A project tree node is not in the folder above it" and the tree stayed empty.
func TestProjectTreeShowsUnixNamesWithBackslashes(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("a backslash separates the folders of a path on Windows")
}
root := t.TempDir()
writeTreeFiles(t, root, `D:\logs/spring.log`, `D:\logs\app.log`)
h := newHarness(t, &testKernel{Client: core.NewClient()})
p := h.openTree(t, root)
folder := p.tree.find(`D:\logs`)
if folder == nil {
t.Fatalf("the root lists no folder named D:\\logs; notifications %q", noticeTexts(h.app))
}
h.app.toggleFolder(p, folder)
awaitDocumentState(t, h, func() bool { return folder.listed && p.tree.find(`D:\logs/spring.log`) != nil })
h.settle()

var rows []string
for _, row := range p.tree.rows {
rows = append(rows, row.path)
}
if want := []string{"", `D:\logs`, `D:\logs/spring.log`, `D:\logs\app.log`}; !slices.Equal(rows, want) {
t.Fatalf("rows = %q, want %q", rows, want)
}
if notices := noticeTexts(h.app); len(notices) != 0 {
t.Fatalf("the tree reported %q", notices)
}
}

func TestChangeListRowSelectionFollowsCore(t *testing.T) {
h := newHarness(t, &testKernel{Client: core.NewClient()})
p := &project{}
Expand Down
5 changes: 4 additions & 1 deletion scripts/desktop/build-desktop-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ native_path() {
fi
}

# Lithe-core-rust #62, not merged yet: commit c0dd2a4 of branch fix/2009-unix-backslash-file-names,
# on top of main 6a14126. A backslash or colon in a Unix file name stays part of the name, so a
# folder named D:\logs is one level below the project root and the project tree rows accept it (#2009).
# Lithe-core-rust #61, squash-merged into main as 6a14126: the LSP engine keeps a session's hover
# answers, so resting on a symbol again answers without asking the server (#1995). It is on top of
# #60, squash-merged into main as ca80599: language-server indexing exclusions ask Git once per
Expand Down Expand Up @@ -122,7 +125,7 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git"
# the contract, plugin guides, reference and SDKs live only in shared/plugins; on top of #16 (reported Git queries folded in the console),
# #15 (git.write cherryPick, revert and reset fields), #14 (word-level changed ranges of diff
# rows), #13, #8, #7, #6 and #4.
PINNED_CORE_REVISION="6a1412635557fcd37766faafbf2fccd4a68dc7db"
PINNED_CORE_REVISION="c0dd2a42ff1baf9d6619d511465f52ac768acbd6"
PROFILE="debug"
while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
]
},
"owner": "Workspace",
"verification": "macOS 和 Windows 无头测试覆盖目录选择、展开、键盘、虚拟绘制、长文件名滚动、外部新增删除、空目录变化、超过 128 个目录、隐藏路径过滤、视口锚定、过期读取以及与搜索共享监听的关闭和重试;真实 Core 测试覆盖共享自然排序样例及 Python 隐藏路径。运行 scripts/desktop/desktop-go.sh test -race ./internal/workbench -run 'TestProjectTree|TestProjectSearch|TestEverywhere' -count=3 和 scripts/desktop/desktop-go.sh test -race ./internal/core -run TestWorkspaceDirectory -count=3。完整文件树和原生窗口行为仍待验收。 标题栏按钮:运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestProjectTree(Locate|ExpandsAndCollapses|ExpandAll|Refresh)' -count=1 和 scripts/desktop/desktop-go.sh test ./internal/treelist -count=1;实机打开深层文件后折叠祖先,点击定位确认展开、选中并滚动到中间,键盘焦点在该行;在超过 512 个目录的项目中全部展开出现提示;删除并恢复项目根目录后点击刷新恢复树。",
"verification": "macOS 和 Windows 无头测试覆盖目录选择、展开、键盘、虚拟绘制、长文件名滚动、外部新增删除、空目录变化、超过 128 个目录、隐藏路径过滤、视口锚定、过期读取以及与搜索共享监听的关闭和重试;真实 Core 测试覆盖共享自然排序样例及 Python 隐藏路径。运行 scripts/desktop/desktop-go.sh test -race ./internal/workbench -run 'TestProjectTree|TestProjectSearch|TestEverywhere' -count=3 和 scripts/desktop/desktop-go.sh test -race ./internal/core -run TestWorkspaceDirectory -count=3。完整文件树和原生窗口行为仍待验收。 标题栏按钮:运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestProjectTree(Locate|ExpandsAndCollapses|ExpandAll|Refresh)' -count=1 和 scripts/desktop/desktop-go.sh test ./internal/treelist -count=1;实机打开深层文件后折叠祖先,点击定位确认展开、选中并滚动到中间,键盘焦点在该行;在超过 512 个目录的项目中全部展开出现提示;删除并恢复项目根目录后点击刷新恢复树。 Unix 文件名里的反斜杠(2026-11-16,#2009,Lithe-core-rust #62):macOS 和 Linux 上 \\ 与 : 是文件名的一部分。Spring Boot 按 Windows 写法配置 logging.file.path: D:\\logs 后在项目里建出的 D:\\logs 目录,显示为根目录下的一个文件夹,展开后列出其中的文件,不再报 workspace.projectTree.rows 的“A project tree node is not in the folder above it”而让项目树为空;Windows 上 \\ 仍是分隔符,行为不变。运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run TestProjectTreeShowsUnixNamesWithBackslashes -count=1(Windows 上跳过);原生窗口验收待做。",
"notes": "Viva 接入 Core 按需列目录、单选、方向键及虚拟绘制;项目根节点(包括空项目)可显示和选择,树行尺寸与展开图标参照旧版,批量列目录失败只记录一次宿主错误;新增根节点和失败日志回归仅在 macOS 验证,Windows 待重跑。2026-11-14 起可见行、选择修正、视口顶端行和多选由 Core 计算(workspace.projectTree.rows、workspace.rowSelection.reduce,#1800),树的形状变化时才调用,缩放和重绘不调用;Viva 日志生成与使用门禁跟踪 #1802。macOS 和 Windows 用一个项目级递归监听,供项目树和搜索共用,事件经 Core 过滤,重读保持节点及视口锚点。Linux 暂用最多 128 个按需目录监听,超限提示。多选、批量移动、上下文菜单、完整旧版增量行为与平台差异仍需迁移,macOS 和 Windows 原生窗口、逐像素对照及大项目性能均待验收。 Project 标题栏有定位当前文件、刷新、全部展开、全部折叠四个按钮:定位逐级列出并展开祖先目录后选中、居中并聚焦目标行,路径不可见时放弃并记录 operation_rejected;刷新重读已展开目录,根目录读取失败时重新监听并读取;全部展开按广度优先最多打开 512 个目录,超出时提示;全部折叠保留根目录,被隐藏的选择移到其所在的顶层目录。项目树是 Viva 的 ui.Tree(只声明可见行,RowWidth 使行等宽于最长名称以横向滚动),行尺寸与文字色取自 desktop/internal/treelist,Git Log 改动文件共用。方向键只移动焦点环,选中行跟随点击、Enter 与箭头,待 Viva 提供 TreeState.RowID 后改为跟随焦点。",
"legacy": {
"revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36",
Expand Down
Loading