Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigator-decorator: add symlink icon and tooltip to symlinked files in navigator #10439

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

Archie27376
Copy link
Contributor

@Archie27376 Archie27376 commented Nov 19, 2021

What it does

This commit adds a new decorator for the file navigator.
It displays a downward right curved arrow at the tail of a file node if that file contains a symbolic link.
A tooltip is also added displaying "Symbolic Link" when hovering over a symbolic linked file node's tail icon.
Hovering over the file itself will display the file path only.

How to test

  • Have a symbolic linked file within a folder
  • Open either the electron app or browser and select the folder with the symlinked file as a workspace
  • Confirm symlinked file node contains icon on the tail
  • Confirm tooltip displays "Symbolic Link" when hovering over the tail icon

Review checklist

Reminder for reviewers

@Archie27376 Archie27376 force-pushed the gh6048 branch 3 times, most recently from 9e386f0 to 805b569 Compare November 19, 2021 17:35
@vince-fugnitto vince-fugnitto added the navigator issues related to the navigator/explorer label Nov 19, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed that the decorator correctly works for symlinks 👍

image

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

The feature looks good to me and most of the code as well. I have one suggestion to the code though, as we also had recent discussions on constructor vs. field injection during the dev-meetings.

Copy link
Contributor

@alvsan09 alvsan09 left a comment

Choose a reason for hiding this comment

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

I have tested it and compared with vscode as you can see in the '.gif'
Hovering over the symlink entry in theia. the tooltip does not show the suffix text " - Symbolic Link".

A second observation:
The decorator shows it fine for files, but it shows a different one for folders, is this intended ?

sym-link-decorator

@vince-fugnitto
Copy link
Member

@alvsan09

Hovering over the symlink entry in theia. the tooltip does not show the suffix text " - Symbolic Link".

I believe it is currently difficult to do in the framework, the same is true for badges such as scm, or debug:

A second observation: The decorator shows it fine for files, but it shows a different one for folders, is this intended?

The issue is unrelated, due to #8352 we treat all folder nodes where decorations are present to display the generic dot decoration.

@alvsan09
Copy link
Contributor

@Archie27376, as per the clarifications from Vince,
if you could please update the PR description, the test procedure and commit message so we don't expect the "Symbolic Link" suffix upon hovering.

@Archie27376 Archie27376 force-pushed the gh6048 branch 2 times, most recently from fa8617e to 2b9457c Compare December 1, 2021 14:42
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good to me 👍

  • the symlink decoration is added to the navigator
  • the decoration and tooltip work well

@kenneth-marut-work what would be needed in order to apply the same decoration from the navigator to the open-editors, I would assume they should share decoration contributions?

@kenneth-marut-work
Copy link
Contributor

The changes look good to me 👍

  • the symlink decoration is added to the navigator
  • the decoration and tooltip work well

@kenneth-marut-work what would be needed in order to apply the same decoration from the navigator to the open-editors, I would assume they should share decoration contributions?

Should hopefully be as simple as adding bind(OpenEditorsTreeDecorator).toService(NavigatorSymlinkDecorator) in navigator-frontend-module. The ProblemDecorator and ScmNavigatorDecorator follow the same pattern.

Happy to give it a review once that's implemented

@kenneth-marut-work
Copy link
Contributor

Looks like the decorators applied nicely to open editors. I didn't notice any issues with this PR when testing (including deleting symlinked files). Nice work

This commit adds a new decorator for the file navigator. It displays a
downward right curved arrow at the tail of a file node if that file
contains a symbolic link. A tooltip is also added displaying "Symbolic
Link" when hovering over a symbolic linked file node's tail icon, and
will display the file's path only when hovering over the file itself.
Copy link
Contributor

@alvsan09 alvsan09 left a comment

Choose a reason for hiding this comment

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

I have verified that the symlink decorators apply as expected in the explorer view as well as in open editors, the tooltip in the Explorer view clearly indicates it's a symbolic link 👍

The code looks good to me!!

@vince-fugnitto vince-fugnitto merged commit afd980a into eclipse-theia:master Dec 6, 2021
@vince-fugnitto vince-fugnitto added this to the 1.21.0 milestone Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navigator issues related to the navigator/explorer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants