Skip to content

Commit f6343e5

Browse files
committed
fix: use obsidian-style folder suggestions
1 parent 090f82c commit f6343e5

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

src/engine/TemplateEngine.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -254,36 +254,26 @@ export abstract class TemplateEngine extends QuickAddEngine {
254254
displayByNormalized: Map<string, string>,
255255
): void {
256256
el.empty();
257-
el.classList.add("qaFileSuggestionItem");
257+
el.classList.add("mod-complex");
258258
const normalized = this.normalizeFolderPath(item);
259259
const display = displayByNormalized.get(normalized);
260260
const displayPath = item || "/";
261261
const isExisting = existingSet.has(normalized);
262-
let mainText = display ?? displayPath;
263-
let subText = "";
262+
let indicator = "";
264263

265264
if (display === "<current folder>") {
266-
mainText = displayPath;
267-
subText = "Current folder";
268-
} else if (display && display !== displayPath) {
269-
mainText = displayPath;
270-
subText = display;
265+
indicator = "Current folder";
271266
} else if (!isExisting) {
272-
mainText = displayPath;
273-
subText = "Create folder";
267+
indicator = "Create folder";
274268
}
275269

276-
const content = el.createDiv("qa-suggestion-content");
277-
content.createSpan({
278-
cls: "suggestion-main-text",
279-
text: mainText,
280-
});
281-
282-
if (subText) {
283-
el.createSpan({
284-
cls: "suggestion-sub-text",
285-
text: subText,
286-
});
270+
const content = el.createDiv("suggestion-content");
271+
const title = content.createDiv("suggestion-title");
272+
title.createSpan({ text: displayPath });
273+
274+
if (indicator) {
275+
const aux = el.createDiv("suggestion-aux");
276+
aux.createEl("kbd", { cls: "suggestion-hotkey", text: indicator });
287277
}
288278
}
289279

0 commit comments

Comments
 (0)