Repository navigation
Show a link indicator on symbolic links and Finder aliases in the Files pane - #18195
Merged
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Collaborator
|
Looks like the standard here is bottom-left; my main thought was that it feels a tad busy right next to the programming language icon but probably don't need to rock the boat here. |
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
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.
Fixes #9924.
The Files pane gave no indication that an entry was a symbolic link. This adds a small link badge to the lower-left corner of the file-type icon for symbolic links and macOS Finder aliases, keeping the underlying file/folder icon so the file type and directory-ness stay visible. The link target is shown in the icon's tooltip (
name -> target), and the badge carries "Symbolic link"/"Alias" alt text for screen readers.Changes
Backend
FilePath::readSymlinkreports read failures (unlikeresolveSymlink, which swallows them and returns the path unchanged) and returns the target as stored in the link.createFileSystemItememitsis_symlink,symlink_target(read only for actual symlinks), andis_alias(set whenever a Finder alias is detected, so a broken alias is still flagged). Oneis_symlink(lstat-equivalent) call is added per listing entry.Frontend
FileSystemItemgainsisSymlink(),isAlias(),isLink(),getSymlinkTarget(), and a display-onlygetLinkTarget().FileIconis now immutable;withLinkBadge()returns a decorated copy so the sharedFileTypeRegistryicons are never mutated.FileIconRenderercomposites the badge over the icon and leaves output unchanged when there is no badge. The Files pane applies the badge and tooltip to any link entry.Screenshots
Here are two examples of Finder alias links (one to a file, one to a folder) and an actual symbolic link to a file. The tooltip for the
api-aliasicon is shown, which reveals the actual destination.Notes
ls -lstyle; it may be relative, and on Windows path separators are normalized to/)..lnkshortcuts are out of scope; they are not symbolic links.Testing
FilePath::readSymlinkunit tests for relative and absolute targets and the non-symlink error path.FileSystemItemlink-accessor tests (including broken alias, unreadable/relative target, and directory symlink) andFileIcon/FileIconRenderertests (decorated-copy immutability, badge rendering, and null tooltip/description guards). Full GWT suite passes.