Skip to content

fix(sftp): add breadcrumb go-to-root button beside home icon - #3212

Open
netcatty-bot wants to merge 1 commit into
mainfrom
ai/issue-3211-33254121557
Open

fix(sftp): add breadcrumb go-to-root button beside home icon#3212
netcatty-bot wants to merge 1 commit into
mainfrom
ai/issue-3211-33254121557

Conversation

@netcatty-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a dedicated "go to filesystem root" button (a "/" glyph) next to the existing home icon in the SFTP breadcrumb navigation, per the reporter's follow-up request.
  • The home icon keeps its current behavior (jump to the login user's home directory), matching common SFTP-client convention; the new button covers the high-frequency "jump to /" case the reporter described.
  • On POSIX panes the button navigates to /; on Windows-style panes it navigates to the current drive root (e.g. C:\) or the UNC share root (e.g. \\server\share).
  • The button is disabled when the pane is already at the filesystem root to avoid redundant navigation.

Why

Issue #3211 reports that the breadcrumb home icon navigates to the user's home directory (/root for root) rather than the filesystem root. That home-directory behavior is intentional and consistent with other SFTP clients, but the reporter asked for either a configurable home target or a separate "back to root /" button, since switching between / and absolute paths is a frequent ops workflow. This implements the dedicated root button, which works for every pane without adding a settings surface.

Changes

  • application/state/sftp/utils.ts — new pure helper getSftpPathRoot(path, options) deriving the filesystem root (/, drive root, or UNC share root) from the current pane path; returns null when no root can be derived (e.g. relative Windows paths).
  • components/sftp/SftpBreadcrumb.tsx — renders the disabled-aware root button in the pinned breadcrumb chrome next to Home, navigating via the existing onNavigate path.
  • application/i18n/locales/{en,es,ru,zh-CN,zh-TW}/… — new sftp.goRoot tooltip string ("Go to root" / 回到根目录 / etc.).
  • Tests: getSftpPathRoot unit cases (POSIX, drive, UNC, forward-slash-UNC ambiguity) in application/state/sftp/utils.test.ts, and a jsdom interaction test in components/sftp/SftpBreadcrumb.test.ts covering click-to-navigate and the disabled-at-root state.

Testing

  • node --test --import tsx components/sftp/SftpBreadcrumb.test.ts application/state/sftp/utils.test.ts components/sftp/SftpPaneToolbar.test.ts — 47 tests pass.
  • npx eslint on the changed files — clean.
  • npx tsc --noEmit -p tsconfig.json — no errors in touched files (repo has pre-existing unrelated errors elsewhere).
  • Manual check suggestion: connect to a host, open SFTP, enter a subdirectory, click the "/" button in the breadcrumb → pane navigates to /; home icon still goes to the home directory.

Fixes #3211

Automation

  • Automated implement pass
  • Review gate: @codex review (own/bot PRs only)
  • Draft until Codex reports clean findings

@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-loop Own/bot PR waiting on Codex review↔fix loop triage Touched by Cursor automation labels Aug 29, 2026
@binaricat

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T13:26:35.389053Z 3adf86b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 3adf86bcd9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@netcatty-bot
netcatty-bot marked this pull request as ready for review August 29, 2026 13:26
@netcatty-bot netcatty-bot added automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Aug 29, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator Author

Codex reported no major issues. This PR is marked ready for human review/merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3adf86bcd9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +199 to +201
return isWindowsPath(path, pathOptions)
? isWindowsRoot(path, pathOptions)
: /^\/{1,2}$/.test(path);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the root action enabled for bare // paths

When a POSIX pane is at the accepted path //, this regex marks it as already at root and disables the new button, even though rootPath is /. The path utilities deliberately preserve double-slash POSIX paths and getParentPath("//") transitions to /, so users in this state cannot use the new control to reach the actual filesystem root. Only disable it when the current POSIX path resolves to the same path as the root target.

Useful? React with 👍 / 👎.

@netcatty-bot
netcatty-bot marked this pull request as draft August 29, 2026 14:19
@netcatty-bot netcatty-bot removed the automation:codex-clean Last Codex review reported clean label Aug 29, 2026
@netcatty-bot
netcatty-bot marked this pull request as ready for review August 29, 2026 14:25
@netcatty-bot netcatty-bot added the automation:codex-clean Last Codex review reported clean label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean triage Touched by Cursor automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 导航中的主页图标点击后跳转到了 root 目录而非系统根目录

2 participants