feat: improved commands and interface for globalsearch

This commit is contained in:
SethBurkart123
2025-05-26 17:19:06 +10:00
parent 2749e07a1b
commit 731ce42e74
6 changed files with 18 additions and 5 deletions
@@ -326,7 +326,7 @@
{isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}" {isSelected ? 'bg-zinc-900/5 dark:bg-white/10 text-zinc-900 dark:text-white dark:ring-[1px] dark:shadow' : 'hover:bg-zinc-500/5 dark:hover:bg-white/5 text-zinc-800 dark:text-zinc-200'}"
onclick={() => executeItemAction(staticItem)} onclick={() => executeItemAction(staticItem)}
> >
<div class="flex-none w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white">{staticItem.icon}</div> <div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br {staticItem.category === 'navigation' ? 'from-[#FA5D5D] to-[#DC2F30]' : 'from-[#4FBBFE] to-[#2090F3]'} rounded-md text-white">{staticItem.icon}</div>
<span class="ml-4 text-lg truncate"> <span class="ml-4 text-lg truncate">
<HighlightedText text={staticItem.text} term={searchTerm} matches={result.matches} /> <HighlightedText text={staticItem.text} term={searchTerm} matches={result.matches} />
</span> </span>
@@ -18,7 +18,7 @@
onclick={onclick} onclick={onclick}
> >
<div class="flex items-center w-full"> <div class="flex items-center w-full">
<div class="flex-none w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br from-[#59F675] to-[#1BC636] rounded-md text-white">{item.metadata?.icon || '\uebee'}</div> <div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center bg-gradient-to-br from-[#59F675] to-[#1BC636] rounded-md text-white">{item.metadata?.icon || '\uebee'}</div>
<span class="ml-4 text-lg truncate"> <span class="ml-4 text-lg truncate">
<HighlightedText text={item.text} term={searchTerm} matches={matches} /> <HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span> </span>
@@ -18,7 +18,7 @@
onclick={onclick} onclick={onclick}
> >
<div class="flex items-center w-full"> <div class="flex items-center w-full">
<div class="flex-none w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white bg-gradient-to-br from-[#59aaf6] to-[#1b62c6] rounded-md">{item.metadata?.icon || '\uebe7'}</div> <div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white bg-gradient-to-br from-[#59aaf6] to-[#1b62c6] rounded-md">{item.metadata?.icon || '\uebe7'}</div>
<span class="ml-4 text-lg truncate"> <span class="ml-4 text-lg truncate">
<HighlightedText text={item.text} term={searchTerm} matches={matches} /> <HighlightedText text={item.text} term={searchTerm} matches={matches} />
</span> </span>
@@ -18,7 +18,7 @@ import type { IndexItem } from '../../indexing/types';
onclick={onclick} onclick={onclick}
> >
<div class="flex items-center w-full"> <div class="flex items-center w-full">
<div class="flex-none w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-gradient-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-gradient-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}"> <div class="flex-none scale-90 w-8 h-8 text-xl font-IconFamily flex items-center justify-center text-white {item.metadata?.type === 'assessments' ? 'bg-gradient-to-br from-[#fa915d] to-[#dc6c2f] rounded-md' : 'bg-gradient-to-br from-[#4FBBFE] to-[#2090F3] rounded-md'} {item.metadata.isActive ? 'opacity-100' : 'opacity-80'}">
{item.metadata?.type === 'assessments' ? '\ueac3' : '\ueb4d'} {item.metadata?.type === 'assessments' ? '\ueac3' : '\ueb4d'}
</div> </div>
<span class="ml-4 text-lg truncate {item.metadata.isActive ? 'opacity-100' : 'opacity-70'}"> <span class="ml-4 text-lg truncate {item.metadata.isActive ? 'opacity-100' : 'opacity-70'}">
@@ -48,6 +48,18 @@ const staticCommands: StaticCommandItem[] = [
}, },
priority: 4, priority: 4,
}, },
{
id: "assessments",
icon: "\ueac3",
category: "navigation",
text: "Assessments",
keybind: ["alt+a"],
keybindLabel: ["Alt", "A"],
action: () => {
window.location.hash = "?page=/assessments/upcoming";
},
priority: 4,
},
{ {
id: "dashboard", id: "dashboard",
icon: "\ueb87", icon: "\ueb87",
@@ -81,6 +93,7 @@ const staticCommands: StaticCommandItem[] = [
altKey: true altKey: true
}, "*"); }, "*");
}, },
keywords: ["compose", "message", "dm", "direct message", "new message"],
priority: 4, priority: 4,
}, },
]; ];
@@ -104,7 +104,7 @@ export const subjectsJob: Job = {
const courseItem = { const courseItem = {
id: `${id}-course`, id: `${id}-course`,
text: `${subject.title} Course`, text: `${subject.title}`,
category: "subjects", category: "subjects",
content: `View course content for ${subject.title} (${semester.description})`, content: `View course content for ${subject.title} (${semester.description})`,
dateAdded: Date.now(), dateAdded: Date.now(),