From fa4a6f379c4033003cb89594cfe4877fc2a555d4 Mon Sep 17 00:00:00 2001 From: Ryan Bantz Date: Sun, 9 Feb 2025 10:34:29 -0600 Subject: [PATCH] Added content to styles.css so Github build doesn't error out Remove duplicate file --- styles.css | 1 + ui/FuzzySelectModal.ts | 49 ------------------------------------------ 2 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 ui/FuzzySelectModal.ts diff --git a/styles.css b/styles.css index e69de29..058c85f 100644 --- a/styles.css +++ b/styles.css @@ -0,0 +1 @@ +/* I didn't actualy need any styles yet */ \ No newline at end of file diff --git a/ui/FuzzySelectModal.ts b/ui/FuzzySelectModal.ts deleted file mode 100644 index 2d1561e..0000000 --- a/ui/FuzzySelectModal.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { App, FuzzySuggestModal } from 'obsidian'; - -/** - * A modal for selecting items with fuzzy search support. - */ -export class FuzzySelectModal extends FuzzySuggestModal<{ name: string; gid: string; isPinned?: boolean }> { - private resolve: (value: { name: string; gid: string } | null) => void; - private items: Array<{ name: string; gid: string; isPinned?: boolean }>; - private title: string; - private selectedItem: { name: string; gid: string } | null = null; - private resolved: boolean = false; // Prevents resolving multiple times - - constructor( - app: App, - title: string, - items: Array<{ name: string; gid: string; isPinned?: boolean }>, - resolve: (value: { name: string; gid: string } | null) => void - ) { - super(app); - this.title = title; - this.items = items; - this.resolve = resolve; - } - - onOpen() { - super.onOpen(); - this.setTitle(this.title); - this.setPlaceholder(this.title); - } - - getItems(): Array<{ name: string; gid: string; isPinned?: boolean }> { - return this.items; - } - - getItemText(item: { name: string; gid: string; isPinned?: boolean }): string { - return item.isPinned ? `📌 ${item.name.replace(/^📌 /, '')}` : item.name; - } - - onChooseItem(item: { name: string; gid: string }, evt: MouseEvent | KeyboardEvent) { - if (!this.resolved) { - console.log(`ITEM CHOSEN - ${item.name} (gid: ${item.gid})`); - this.selectedItem = item; - this.resolved = true; // Prevents multiple selections - this.resolve(item); - } else { - console.warn(`ITEM CHOSEN MULTIPLE TIMES - Ignoring extra selection: ${item.name}`); - } - } -} \ No newline at end of file