diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index a55e7a17..1a0176ac 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/.idea/deno.xml b/.idea/deno.xml index 436c130b..7b6555a3 100644 --- a/.idea/deno.xml +++ b/.idea/deno.xml @@ -1,7 +1,10 @@ - - \ No newline at end of file + diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml index d62a2035..5d0c4432 100644 --- a/.idea/dictionaries/project.xml +++ b/.idea/dictionaries/project.xml @@ -4,4 +4,4 @@ itags - \ No newline at end of file + diff --git a/.idea/modules.xml b/.idea/modules.xml index 8a9f0c28..a5994fc5 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,10 @@ - + - \ No newline at end of file + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddf..dcb6b8c4 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,4 +3,4 @@ - \ No newline at end of file + diff --git a/deno.lock b/deno.lock index 7810a210..936a4e42 100644 --- a/deno.lock +++ b/deno.lock @@ -7,21 +7,16 @@ "jsr:@cliffy/table@1.0.0-rc.7": "1.0.0-rc.7", "jsr:@hono/hono@4.8.0": "4.8.0", "jsr:@luca/esbuild-deno-loader@~0.11.1": "0.11.1", - "jsr:@std/assert@^1.0.1": "1.0.13", - "jsr:@std/async@^1.0.13": "1.0.13", "jsr:@std/bytes@^1.0.2": "1.0.6", "jsr:@std/bytes@^1.0.5": "1.0.6", "jsr:@std/cli@^1.0.1": "1.0.20", - "jsr:@std/data-structures@^1.0.8": "1.0.8", "jsr:@std/encoding@^1.0.5": "1.0.10", "jsr:@std/fmt@~1.0.2": "1.0.8", "jsr:@std/fs@^1.0.18": "1.0.18", - "jsr:@std/internal@^1.0.6": "1.0.8", "jsr:@std/io@~0.225.2": "0.225.2", "jsr:@std/path@^1.0.6": "1.1.0", "jsr:@std/path@^1.0.8": "1.1.0", "jsr:@std/path@^1.1.0": "1.1.0", - "jsr:@std/testing@^1.0.14": "1.0.14", "jsr:@std/text@~1.0.7": "1.0.14", "jsr:@std/yaml@^1.0.8": "1.0.8", "npm:@codemirror/autocomplete@6.18.6": "6.18.6", @@ -99,24 +94,12 @@ "jsr:@std/path@^1.0.6" ] }, - "@std/assert@1.0.13": { - "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29", - "dependencies": [ - "jsr:@std/internal" - ] - }, - "@std/async@1.0.13": { - "integrity": "1d76ca5d324aef249908f7f7fe0d39aaf53198e5420604a59ab5c035adc97c96" - }, "@std/bytes@1.0.6": { "integrity": "f6ac6adbd8ccd99314045f5703e23af0a68d7f7e58364b47d2c7f408aeb5820a" }, "@std/cli@1.0.20": { "integrity": "a8c384a2c98cec6ec6a2055c273a916e2772485eb784af0db004c5ab8ba52333" }, - "@std/data-structures@1.0.8": { - "integrity": "2fb7219247e044c8fcd51341788547575653c82ae2c759ff209e0263ba7d9b66" - }, "@std/encoding@1.0.10": { "integrity": "8783c6384a2d13abd5e9e87a7ae0520a30e9f56aeeaa3bdf910a3eaaf5c811a1" }, @@ -129,9 +112,6 @@ "jsr:@std/path@^1.1.0" ] }, - "@std/internal@1.0.8": { - "integrity": "fc66e846d8d38a47cffd274d80d2ca3f0de71040f855783724bb6b87f60891f5" - }, "@std/io@0.225.2": { "integrity": "3c740cd4ee4c082e6cfc86458f47e2ab7cb353dc6234d5e9b1f91a2de5f4d6c7", "dependencies": [ @@ -141,13 +121,6 @@ "@std/path@1.1.0": { "integrity": "ddc94f8e3c275627281cbc23341df6b8bcc874d70374f75fec2533521e3d6886" }, - "@std/testing@1.0.14": { - "integrity": "144b3737105b9071cb50c957681f58a1b8ec0f3e5b19ad830f401c5fa931e8f0", - "dependencies": [ - "jsr:@std/async", - "jsr:@std/data-structures" - ] - }, "@std/text@1.0.14": { "integrity": "1a810108482414d19112b8b506ad0b7cba826000cd13f74274ffda6dd83d273f" }, @@ -515,11 +488,7 @@ "https://deno.land/x/silverbullet@2.0.0-pre4/lib/plugos/types.ts": "e4decd11d40797161b4fed67cc432f370ceb159b4680c57dde97e6300ea0abfb", "https://deno.land/x/silverbullet@2.0.0-pre4/lib/plugos/worker_runtime.ts": "6f16899c0a3d2525c4bf3f881463bce2d7f2b8b55f072fd74ae0f621ba74fea0", "https://deno.land/x/silverbullet@2.0.0-pre4/lib/proxy_fetch.ts": "831d98cf7f9ada653fc958f52ad367d8511e2634400c29e1fe9d6babd230c0bf", - "https://deno.land/x/silverbullet@2.0.0-pre4/type/datastore.ts": "43ac83561844fc5224bd2d5c6c2a92a2cdda6688d29b798c624e3c90bca7ab9d", - "https://esm.sh/lodash@4.17.21": "c2f90ffd948b7a30f054986888bdc2667824115fa48ad583ca8b3a579ca4a5a8", - "https://esm.sh/lodash@4.17.21/denonext/lodash.mjs": "9d2a44e584d91008f61f974c6d0a32bf9afb1563761e60c366af0a293e8c759b", - "https://esm.sh/moment@2.30.1": "61eef31d73508961f2cf25fc2cb507832f7158cf8638e86d933534c9adfac753", - "https://esm.sh/moment@2.30.1/denonext/moment.mjs": "a4ffd4a02d47c93fb788acda0f2e8306dc25bbd10b28d7f2b036f4a75769d177" + "https://deno.land/x/silverbullet@2.0.0-pre4/type/datastore.ts": "43ac83561844fc5224bd2d5c6c2a92a2cdda6688d29b798c624e3c90bca7ab9d" }, "workspace": { "dependencies": [ diff --git a/lib/spaces/disk_space_primitives.ts b/lib/spaces/disk_space_primitives.ts index fc29bfa3..b364f8da 100644 --- a/lib/spaces/disk_space_primitives.ts +++ b/lib/spaces/disk_space_primitives.ts @@ -144,10 +144,10 @@ export class DiskSpacePrimitives implements SpacePrimitives { this.updateCacheInBackground(); } - private async cleanOrphaned(pathToDeletedFile: string){ + private async cleanOrphaned(pathToDeletedFile: string) { let current = path.dirname(pathToDeletedFile); - while( current.startsWith(this.rootPath) && current != this.rootPath ){ + while (current.startsWith(this.rootPath) && current != this.rootPath) { try { // Attempt to remove the current directory await Deno.remove(current); diff --git a/plugs/index/snippet_extractor.test.ts b/plugs/index/snippet_extractor.test.ts index 0e7e1137..fe78031b 100644 --- a/plugs/index/snippet_extractor.test.ts +++ b/plugs/index/snippet_extractor.test.ts @@ -52,7 +52,10 @@ Line 5`; // Edge case: index beyond text bounds (triggers fallback) const testText5 = "Hello\nWorld\nTest"; const beyondBoundsIndex = testText5.length + 10; - const fallbackResult = extractSnippetAroundIndex(testText5, beyondBoundsIndex); + const fallbackResult = extractSnippetAroundIndex( + testText5, + beyondBoundsIndex, + ); // Fallback should return something, not break assertEquals(typeof fallbackResult, "string"); }); diff --git a/plugs/tasks/task.ts b/plugs/tasks/task.ts index 0f2c0fc9..c592fce1 100644 --- a/plugs/tasks/task.ts +++ b/plugs/tasks/task.ts @@ -180,7 +180,7 @@ export function previewTaskToggle(eventString: string) { async function convertListItemToTask(node: ParseTree) { const listMark = node.children![0]; const originalMark = renderToText(listMark); - + // Determine the task marker based on the original list type let taskMarker: string; if (originalMark.match(/^\d+\./)) { @@ -190,7 +190,7 @@ async function convertListItemToTask(node: ParseTree) { // Bullet list: use standard bullet taskMarker = "* [ ]"; } - + await editor.dispatch({ changes: { from: listMark.from, @@ -223,7 +223,10 @@ async function removeTaskCheckbox(listItemNode: ParseTree) { }); } -async function cycleTaskState(node: ParseTree, removeCheckbox: boolean = false) { +async function cycleTaskState( + node: ParseTree, + removeCheckbox: boolean = false, +) { const stateText = node.children![1].text!; // If removeCheckbox is true and task is complete, remove checkbox entirely diff --git a/web/components/command_palette.tsx b/web/components/command_palette.tsx index e811f339..33728f8f 100644 --- a/web/components/command_palette.tsx +++ b/web/components/command_palette.tsx @@ -28,11 +28,11 @@ export function CommandPalette({ if (def.hide) { continue; } - + // Extract category from command name (e.g., "Block: Toggle" -> "Block") - const colonIndex = name.indexOf(': '); + const colonIndex = name.indexOf(": "); const category = colonIndex > 0 ? name.substring(0, colonIndex) : undefined; - + options.push({ name: name, hint: isMac && def.mac ? def.mac : def.key, diff --git a/web/components/filter.tsx b/web/components/filter.tsx index d212742f..dc0c268a 100644 --- a/web/components/filter.tsx +++ b/web/components/filter.tsx @@ -54,17 +54,31 @@ export function FilterList({ const [selectedOption, setSelectionOption] = useState(0); // Group options by category while preserving Fuse.js order - function groupOptionsByCategory(options: FilterOption[]): Array<{type: 'category', name: string} | {type: 'option', option: FilterOption, originalIndex: number}> { - const grouped: Array<{type: 'category', name: string} | {type: 'option', option: FilterOption, originalIndex: number}> = []; + function groupOptionsByCategory( + options: FilterOption[], + ): Array< + { type: "category"; name: string } | { + type: "option"; + option: FilterOption; + originalIndex: number; + } + > { + const grouped: Array< + { type: "category"; name: string } | { + type: "option"; + option: FilterOption; + originalIndex: number; + } + > = []; const seenCategories = new Set(); let originalIndex = 0; for (const option of options) { if (option.category && !seenCategories.has(option.category)) { seenCategories.add(option.category); - grouped.push({type: 'category', name: option.category}); + grouped.push({ type: "category", name: option.category }); } - grouped.push({type: 'option', option, originalIndex}); + grouped.push({ type: "option", option, originalIndex }); originalIndex++; } @@ -167,17 +181,22 @@ export function FilterList({ e.key === "ArrowDown" || e.ctrlKey && e.key === "n" ) { - setSelectionOption(Math.min(matchingOptions.length - 1, selectedOption + 1)); + setSelectionOption( + Math.min(matchingOptions.length - 1, selectedOption + 1), + ); } else if (e.key === "PageUp") { setSelectionOption(Math.max(0, selectedOption - 5)); } else if (e.key === "PageDown") { - setSelectionOption(Math.min(matchingOptions.length - 1, selectedOption + 5)); + setSelectionOption( + Math.min(matchingOptions.length - 1, selectedOption + 5), + ); } else if (e.key === "Home") { setSelectionOption(0); } else if (e.key === "End") { setSelectionOption(matchingOptions.length - 1); } else if ( - (e.key === " ") && completePrefix && (view.state.sliceDoc() === "") + (e.key === " ") && completePrefix && + (view.state.sliceDoc() === "") ) { setText(completePrefix); } else { @@ -206,9 +225,12 @@ export function FilterList({ let optionIndex = 0; return groupedItems.map((item) => { - if (item.type === 'category') { + if (item.type === "category") { return ( -
+
{item.name}
); @@ -219,7 +241,9 @@ export function FilterList({ return (
{ let displayName = item.option.name; // Remove category prefix for display (e.g., "Block: Close Sidebar" -> "Close Sidebar") - if (item.option.category && displayName.startsWith(item.option.category + ': ')) { - displayName = displayName.substring(item.option.category.length + 2); + if ( + item.option.category && + displayName.startsWith(item.option.category + ": ") + ) { + displayName = displayName.substring( + item.option.category.length + 2, + ); } return displayName; })()} @@ -259,7 +288,9 @@ export function FilterList({ {item.option.hint} )} -
{item.option.description}
+
+ {item.option.description} +
); } diff --git a/web/fuse_search.ts b/web/fuse_search.ts index 5109c766..7f0e91d9 100644 --- a/web/fuse_search.ts +++ b/web/fuse_search.ts @@ -53,19 +53,19 @@ export const fuzzySearchAndSort = ( sortFn: (a, b): number => { const aItem = enrichedArr[a.idx]; const bItem = enrichedArr[b.idx]; - + // Check for exact category matches first const searchLower = searchPhrase.toLowerCase(); const aExactCategoryMatch = aItem.category?.toLowerCase() === searchLower; const bExactCategoryMatch = bItem.category?.toLowerCase() === searchLower; - + if (aExactCategoryMatch && !bExactCategoryMatch) { return -1; // a comes first } if (!aExactCategoryMatch && bExactCategoryMatch) { return 1; // b comes first } - + // If both or neither have exact category matches, use normal scoring if (a.score === b.score) { const aOrder = aItem.orderId || 0; diff --git a/web/styles/theme.scss b/web/styles/theme.scss index 591e6389..bdf56cf1 100644 --- a/web/styles/theme.scss +++ b/web/styles/theme.scss @@ -41,7 +41,7 @@ html { --modal-hint-inactive-background-color: #e1e1e1; --modal-hint-inactive-color: #111; --modal-description-color: #6b6b6b; - --modal-selected-option-description-color: #E6E6E6; + --modal-selected-option-description-color: #e6e6e6; --notifications-background-color: inherit; --notifications-border-color: rgb(41, 41, 41); @@ -187,7 +187,7 @@ html[data-theme="dark"] { --modal-hint-inactive-background-color: #353535; --modal-hint-inactive-color: #ccc; --modal-description-color: #969696; - --modal-selected-option-description-color: #E6E6E6; + --modal-selected-option-description-color: #e6e6e6; --notifications-background-color: #333; --notifications-border-color: rgb(197, 197, 197);