fix: send notification

This commit is contained in:
Timothy Jaeryang Baek
2025-09-16 22:53:54 -05:00
parent c3ea4feca5
commit 1077b2ac8b
5 changed files with 33 additions and 32 deletions

View File

@@ -52,12 +52,12 @@
const item = filteredItems[index];
if (!item) return;
// Add the "U:", "A:" or "C:" prefix to the id
// Add the "U:", "M:" or "C:" prefix to the id
// and also append the label after a pipe |
// so that the mention renderer can show the label
if (item)
command({
id: `${item.type === 'user' ? 'U' : item.type === 'model' ? 'A' : 'C'}:${item.id}|${item.label}`,
id: `${item.type === 'user' ? 'U' : item.type === 'model' ? 'M' : 'C'}:${item.id}|${item.label}`,
label: item.label
});
};

View File

@@ -53,8 +53,8 @@
} else if (triggerChar === '@') {
if (idType === 'U') {
// User
} else if (idType === 'A') {
// Agent/assistant/ai model
} else if (idType === 'M') {
// Model
const model = $models.find((m) => m.id === id);
if (model) {
label = model.name;
@@ -77,9 +77,8 @@
if (idType === 'U') {
// Open user profile
console.log('Clicked user mention', id);
} else if (idType === 'A') {
// Open agent/assistant/ai model profile
console.log('Clicked agent mention', id);
} else if (idType === 'M') {
console.log('Clicked model mention', id);
await goto(`/?model=${id}`);
}
} else if (triggerChar === '#') {
@@ -101,15 +100,15 @@
</span>
</LinkPreview.Trigger>
<LinkPreview.Content
class="w-full max-w-[260px] rounded-2xl border border-gray-100 dark:border-gray-800 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg transition"
side="top"
align="start"
sideOffset={6}
>
{#if triggerChar === '@' && idType === 'U'}
{#if triggerChar === '@' && idType === 'U'}
<LinkPreview.Content
class="w-full max-w-[260px] rounded-2xl border border-gray-100 dark:border-gray-800 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg transition"
side="top"
align="start"
sideOffset={6}
>
<UserStatus {id} />
{/if}
<!-- <div class="flex space-x-4">HI</div> -->
</LinkPreview.Content>
<!-- <div class="flex space-x-4">HI</div> -->
</LinkPreview.Content>
{/if}
</LinkPreview.Root>