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

Quick open shows weird truncation when highlighting matches #42501

Closed
Gruntfuggly opened this issue Jan 30, 2018 · 13 comments
Closed

Quick open shows weird truncation when highlighting matches #42501

Gruntfuggly opened this issue Jan 30, 2018 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug quick-pick Quick-pick widget issues verified Verification succeeded
Milestone

Comments

@Gruntfuggly
Copy link

Using the open recent dialog, it seems to pointelessly truncate the last two characters of each folder name (most of these end in 'gui'):

screenshot from 2018-01-30 15-39-25

@bpasero
Copy link
Member

bpasero commented Jan 30, 2018

I have seen this before in another issue but was never able to reproduce. Does it reproduce if you disable icons?

@bpasero bpasero added info-needed Issue requires more information from poster quick-pick Quick-pick widget issues labels Jan 30, 2018
@Gruntfuggly
Copy link
Author

Yes, turning off icons doesn't change it.

It seems to be something to do with the '-' character. For instance, if I type 'asl-e' it happens, but typing 'asl-g' it does not?

Could be a regex issue...

@bpasero
Copy link
Member

bpasero commented Jan 30, 2018

@Gruntfuggly are you able to share the sources with me to try to reproduce?

@Gruntfuggly
Copy link
Author

Unfortunately the codebase is commercial. However I could provide you with the storage.json from my config files which I think contains the history?

@Gruntfuggly
Copy link
Author

storage.json.gz

@bpasero
Copy link
Member

bpasero commented Jan 30, 2018

@Gruntfuggly no, the history is somewhere else. Can you configure "workbench.quickOpen.closeOnFocusLost": false and then use dev tools to inspect the element that is cropped? I wonder if the entry already contains the "..." or if something else adds it.

image
image

@bpasero
Copy link
Member

bpasero commented Jan 30, 2018

@Gruntfuggly also when you scroll down that list, is there an entry which is so large that it maybe pushes the rest?

@Gruntfuggly
Copy link
Author

Gruntfuggly commented Jan 31, 2018

It looks like text-overflow: ellipsis is comming from the monaco-icon-label class.

screenshot from 2018-01-31 08-48-47

screenshot from 2018-01-31 08-55-46

There are larger entries in the list further down which are wider that the dropdown, but these are present even when the text is not truncated.

@bpasero
Copy link
Member

bpasero commented Jan 31, 2018

@Gruntfuggly that does not explain why the "..." shows in such a weird spot, e.g. I would expect to first fill the full available space and then show "...". See what I get, the "..." shows up in the end as expected:

image

This could be a Chrome layouting issue after all. Can you check if the element is expanded to the full width?

@Gruntfuggly
Copy link
Author

The quick-open-row div is full width.
The monaco-icon-label div is truncated
The quick-open-entry-description span which fillows the monaco-icon-label div then takes up the remaining width.

This is the same for when there is truncation and when there isn't. The onlty thing that would appear to be different in our cases is that my description is shorter than the available width?

When using the inspector, I can't see anything obviously different from when it is truncated and when it isn't.

Some further clues maybe though - it only happens to certain file types:

screenshot from 2018-01-31 10-07-57

It is definitely not the icon though - it happens with no icon theme selected.

It only happens when I've typed a dash. I've tried lots of other combinations, but it's only with dash and certain other letters.

@Gruntfuggly
Copy link
Author

One last clue - I think it is related to the showing the search term within the results. Below you can see that the entries highlighted with '-d' are truncated, but the one with '-D' is not.

screenshot from 2018-01-31 10-13-16

I think it must be something to do with a pixel rounding error or something.

@bpasero bpasero added this to the January 2018 milestone Jan 31, 2018
@bpasero bpasero changed the title Wierd truncation Quick open shows weird truncation when highlighting matches Jan 31, 2018
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jan 31, 2018
@bpasero bpasero removed this from the January 2018 milestone Jan 31, 2018
@bpasero
Copy link
Member

bpasero commented Jan 31, 2018

I can reproduce on Linux when I have a file called asl-emcs-ddu-profile-editor-g.js and search for -g and I think it has to do with the fact that the highlight causes some characters to become slightly larger (because they show up in bold) and as such the entire label gets a "..." at the end because it now overflows.

/cc @joaomoreno if you have any idea how to fix this

@bpasero bpasero added this to the February 2018 milestone Jan 31, 2018
@bpasero
Copy link
Member

bpasero commented Jan 31, 2018

Some ideas:

  • Fix flex in items (wrap a div around label and description in quick open with flex: 1 for description
  • Remove weird display: flex for parent of file label that is not needed anymore?

@bpasero bpasero closed this as completed in 73e6193 Feb 5, 2018
@RMacfarlane RMacfarlane added the verified Verification succeeded label Mar 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug quick-pick Quick-pick widget issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants