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

Tree search-box UI change to match VS Code - #8541 #9005

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

balajiv113
Copy link
Contributor

@balajiv113 balajiv113 commented Jan 30, 2021

Signed-off-by: Balaji V [email protected]

What it does

The following issues are fixed as a part of this PR

  • Unexpected keyboard behaviour on search-box input field File explorer search/filter keyboard behavior is unexpected #8541
  • Focus issue when filter, next and previous button is clicked, The following are the steps to reproduce
    • Open a workspace
    • Focus on file explorer
    • Type text to search
    • Click on filter button -> notice the focus is lost from explorer
    • Type new text to search and notice its not being typed / searched

The fix is to make the search-box UI consistent to VSCode UI.

The following are yet to made consistent based on feedback and suggestions,

  • Support for drag & drop search box to left or right
  • Removing move up and down button from UI
  • Support for tooltip with matching results info

How to test

Follow the above steps and notice the issues are fixed

Review checklist

Copy link
Contributor

@kenneth-marut-work kenneth-marut-work left a comment

Choose a reason for hiding this comment

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

Great work so far, this is a very nice improvement and the styling and functionality are very close. I've made a couple comments on the code, but have also noticed some minor functionality issues. Please address them and I'll take another look:

  • Collapsing the tree view when the filter is active does not hide the filter (note it should reappear when the tree reopens)
    collapse

  • The 'space' character should not be allowed in the search query. (In vscode, the spacebar triggers opening a file or collapsing/expanding a node, but in Theia these actions are handled differently). Disabling the spacebar character should be sufficient

  • Pressing ctrl+backspace should perform the same behavior as 'escape' (deleting all characters from filter)

  • Long search queries should be truncated with the ellipsis on the left-side, and never span more than one row:
    VSCode:
    image

This branch:
longquery

@@ -16,22 +16,31 @@

.theia-search-box {
position: absolute;
top: 0px;
right: 0px;
top: 4px;
Copy link
Contributor

Choose a reason for hiding this comment

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

This value seems to be a little bit off, the filter should actually sit below the titlebar:

VSCode:

image

This branch:

image

You can use the variable --theia-view-container-title-height to calculate the proper offset with the 4px padding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding this, we have a scenario that title will be shown only when the explorer have 2 views (Explorer & NPM Script). In the other case it wont be available.

Reference without title
Screenshot 2021-02-03 at 1 15 07 PM

I will make changes to support both the behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To support both (with title and without title) behaviour with 4px, have made the parent container as position:relative, also verified there is no other impact due to that change.
I also tried with --theia-view-container-title-height, but in explorer without titlebar, search box is too down thats looking odd in UI.

packages/core/src/browser/style/search-box.css Outdated Show resolved Hide resolved
packages/core/src/browser/style/search-box.css Outdated Show resolved Hide resolved
packages/core/src/browser/tree/search-box.ts Outdated Show resolved Hide resolved
@balajiv113
Copy link
Contributor Author

@kenneth-marut-work - Addressed all the above mentioned issues.

Copy link
Contributor

@kenneth-marut-work kenneth-marut-work left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the previous comments, I've taken another look and your changes are working nicely. I have added several new observations in the code. Please also address the following below:

  • After typing in the search, then focusing elsewhere and returning back to the searchbox, keyboard strokes are not registered (it seems that typing is not registered when the search box is in focus in general)

packages/core/src/browser/style/search-box.css Outdated Show resolved Hide resolved
packages/core/src/browser/style/search-box.css Outdated Show resolved Hide resolved
packages/core/src/browser/tree/search-box.ts Outdated Show resolved Hide resolved
packages/core/src/browser/tree/search-box.ts Outdated Show resolved Hide resolved
packages/core/src/browser/tree/search-box.ts Outdated Show resolved Hide resolved
@balajiv113 balajiv113 force-pushed the BUG-8541 branch 2 times, most recently from 43eb31a to 026d8f6 Compare February 8, 2021 05:55
@balajiv113
Copy link
Contributor Author

@kenneth-marut-work - Addressed all the above mentioned issues and also fixed the focus issue.
Since you have requested for highlight border when no match found, i have also provided support for tooltip with matching result info data.

@kenneth-marut-work
Copy link
Contributor

Looking good, thanks for addressing the comments and for adding the filter tooltip 👍. Can you please address the mentioned issue above and also update the changelog, and I'll review once more.

@balajiv113
Copy link
Contributor Author

@kenneth-marut-work - Fixed the issue that you mentioned and also updated the changelog.

Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

Sorry for the delay getting back around to this. I got caught by the power outages in Texas last week. With the removal of the title, this looks good to me.

Copy link
Contributor

@kenneth-marut-work kenneth-marut-work left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this, looks good to me. Please rebase with master, it seems there may be some slight (undetected) conflicts in the changelog and I'll move ahead with the merge.

@balajiv113
Copy link
Contributor Author

@kenneth-marut-work - Rebased with master and updated the conflicting changelog

@kenneth-marut-work kenneth-marut-work merged commit 8352f48 into eclipse-theia:master Feb 24, 2021
@balajiv113 balajiv113 deleted the BUG-8541 branch February 24, 2021 18:13
@paul-marechal paul-marechal added this to the 1.11.0 milestone Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants