-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
modify the feature of quick input, when overflowed the elipsses shows… #145450
base: main
Are you sure you want to change the base?
Conversation
@kipackjeong can you attach a screenshot of the change? Additionally, this isn't finished yet because we should make a new CSS class to do this behavior and then add it to the respective html tags that are created in the JS: Then once you have that working we can talk about adding a setting to vscode that will allow you to set this behavior. |
@TylerLeonhardt |
@kipackjeong no worries and by the way, Draft PRs are totally fine to open. I'm happy to help you along the journey, just be patient with me as I have a few things I am working on at the same time. We wanted the behavior you have introduced to be behind a setting like In order to do this, I suggest making a CSS class (or a few if that's what is needed) that we can programmatically add here: based on if our new setting is set. |
@TylerLeonhardt I made changes respective to your comments, can you review this please. Later now I noticed that proper spelling is "ellipsis",but I will change that. Created new CSS Class: Added on
Added this style on those three elements : .quick-input-list .monaco-icon-label-container.left-ellipses {
display: flex;
align-items: center;
}
.quick-input-list .monaco-icon-name-container.left-ellipses {
display:inline-block;
block-size: 1.5rem;
}
.quick-input-list .monaco-icon-description-container.left-ellipses {
display:inline-block;
block-size: 1.5rem;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
direction: rtl;
text-align: left;
} For dom manipulation, when data.label is created with IconLabel class Instance, created and added new option /* quickInputList.ts */
data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true, supportIcons: true, ellipsesOnLeft: true }); Then added ellipsesOnLeft logic inside of IconLabel contsructor /* iconLabel.ts */
if (options?.ellipsesOnLeft) {
this.labelContainer.classList.add('left-ellipses');
nameContainer.classList.add('left-ellipses');
this.descriptionContainer.element.classList.add('left-ellipses');
} Now works well When When it is true |
Maybe give the setting a less specific name and make it an enum with only two values at the moment, |
@gjsjohnmurray I think that is a good idea. For instance like |
@kipackjeong I'm thinking: |
Once you get Left and Right supported, you can make it a true VS Code setting by adding to the following: vscode/src/vs/workbench/contrib/search/browser/search.contribution.ts Lines 892 to 911 in dafc40b
Then the plumbing fun begins... follow the reference here:
alllllll the way down to the IconLabel. I guess this issue was a bit more complicated than I thought... 😅 |
@TylerLeonhardt Thank you and sorry it has been over ten days of no reply, I was running so busy. 'search.quickOpen.ellipsisLocation': {
type: 'string',
default: 'right',
enum: ['left', 'right'],
enumDescriptions: [
nls.localize('quickInput.ellipsisLocation.right', 'The ellipsis will show on the right side when the file path string overflows'),
nls.localize('quickInput.ellipsisLocation.left', 'The ellipsis will show on the left side when the file path string overflows')
]
}, anythingQuickAccess.ts private get configuration() {
const editorConfig = this.configurationService.getValue<IWorkbenchEditorConfiguration>().workbench?.editor;
const searchConfig = this.configurationService.getValue<IWorkbenchSearchConfiguration>().search;
const quickAccessConfig = this.configurationService.getValue<IWorkbenchQuickAccessConfiguration>().workbench.quickOpen;
return {
openEditorPinned: !editorConfig?.enablePreviewFromQuickOpen || !editorConfig?.enablePreview,
openSideBySideDirection: editorConfig?.openSideBySideDirection,
includeSymbols: searchConfig?.quickOpen.includeSymbols,
includeHistory: searchConfig?.quickOpen.includeHistory,
ellipsisLocation: searchConfig?.quickOpen.ellipsisLocation,
historyFilterSortOrder: searchConfig?.quickOpen.history.filterSortOrder,
shortAutoSaveDelay: this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY,
preserveInput: quickAccessConfig.preserveInput
};
} But couldn't figure out how I can use this in |
@TylerLeonhardt Hello Tyler, any thoughts on it yet? |
Referencing ticket: #156062 The path is truncated from the left, like in macOS Spotlight. Tested this patch with the latest dev version and it works fine. |
Note: in a kind of sick outcome, #156062 got closed as a dup of #58040, and both are closed and locked. Related on Stack Overflow: How do I improve differentiation of long paths when searching for a file when there are others of the same name in VS Code's Quick Open feature? |
aha why no reply then |
Sorry for the delay, if you'd like to still continue, please handle the merge conflicts. I also would like to see a setting for this behavior so it's opt-in. Basically you will need to pass the value all the way down and add a CSS class to the InputBox depending on the setting value. |
… on left
This PR fixes #143956