Repository navigation
Conversation
Add toRootedPath, which respells a path inside the workspace root with the root's own prefix and separator, and use it when revealing the active file in the project tree. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Added tests for the toRootedPath function to ensure it correctly respells paths with the specified root prefix and separator.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sh tree Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
toRootedPath(windows/tauri/src/utils/path-helpers.ts):把工作区根目录内的路径改写成根目录自己的前缀与分隔符写法,根目录之外的路径原样返回。file-explorer-tree.tsx)。file-explorer-reveal.test.tsx覆盖“正斜杠活动路径 + 反斜杠根目录和节点”的真实定位链路,path-helpers.test.ts覆盖toRootedPath。file-explorer.json功能矩阵条目(evidence、verification、notes)。原因
项目树节点沿用工作区根目录的写法(Windows 上为反斜杠),而编辑器的活动文件路径可能是正斜杠(例如经 Ctrl+P 快速打开得到的路径)。
revealPathInTree和getAncestorDirectoryPaths按字符串精确比较,祖先目录一个都匹配不上,于是既不展开也不滚动,也没有任何提示。关联
Refs #1540。没有用 Closes:该 Issue 描述的是间歇性失效,本 PR 只修复其中已确认的“路径写法不一致”这一个原因,Issue 里猜测的其他原因没有验证。
验证
bun test src/utils src/features/file-explorer src/features/sidebar(windows/tauri):134 通过、0 失败。新增的定位测试在改动前失败(目录未被展开),改动后通过。scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD与verify-platform-feature-matrix.sh通过。未验证 / 未覆盖
vp lint对改动文件没有输出,我没有单独确认它是否实际执行了规则。🤖 Generated with Claude Code