Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit ea7cfe3

Browse files
marcogallo566jasonLaster
authored andcommitted
QuickOpen File Search rows can be quite tall (#5729)
* Moved path to the same line of filename, added truncation * Removed unnecessary 'max-width' It's fit better without 'max-width' * More space bewtween filename and path * Removed filename from URL * Forgot yarn lint * Removed first and last slash * Prevent line wrapping for long paths * Remove querystring from result list
1 parent ddcb297 commit ea7cfe3

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/components/QuickOpenModal.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,7 @@ export class QuickOpenModal extends Component<Props, State> {
342342
return results.map(result => {
343343
return {
344344
...result,
345-
title: this.renderHighlight(result.title, basename(newQuery), "title"),
346-
...(result.subtitle != null && !this.isSymbolSearch()
347-
? {
348-
subtitle: this.renderHighlight(
349-
result.subtitle,
350-
newQuery,
351-
"subtitle"
352-
)
353-
}
354-
: null)
345+
title: this.renderHighlight(result.title, basename(newQuery), "title")
355346
};
356347
});
357348
};

src/components/shared/ResultList.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
color: var(--theme-body-color);
2121
padding: 4px 13px;
2222
display: flex;
23-
justify-content: space-between;
2423
}
2524

2625
.result-list.big li {
2726
padding: 10px;
28-
flex-direction: column;
27+
flex-direction: row;
2928
border-bottom: 1px solid var(--theme-splitter-color);
3029
}
3130

@@ -57,6 +56,9 @@
5756
.result-list li .title {
5857
line-height: 1.5em;
5958
word-break: break-all;
59+
text-overflow: ellipsis;
60+
overflow: hidden;
61+
white-space: nowrap;
6062
}
6163

6264
.result-list li.selected .title {
@@ -80,6 +82,10 @@
8082
.result-list.big li .subtitle {
8183
word-break: break-all;
8284
color: var(--theme-body-color-inactive);
85+
margin-left: 15px;
86+
text-overflow: ellipsis;
87+
overflow: hidden;
88+
white-space: nowrap;
8389
}
8490

8591
.result-list.big li .subtitle {

src/utils/quick-open.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,13 @@ export function formatSources(sources: SourcesMap): Array<QuickOpenResult> {
114114
const sourcePath = getSourcePath(source.get("url"));
115115
return {
116116
value: sourcePath,
117-
title: sourcePath.split("/").pop(),
118-
subtitle: endTruncateStr(sourcePath, 100),
117+
title: sourcePath
118+
.split("/")
119+
.pop()
120+
.split("?")[0],
121+
subtitle: endTruncateStr(sourcePath, 100)
122+
.replace(sourcePath.split("/").pop(), "")
123+
.slice(1, -1),
119124
id: source.get("id"),
120125
url: source.get("url")
121126
};

0 commit comments

Comments
 (0)