refac
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import { getSkillItems } from '$lib/apis/skills';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import Cube from '$lib/components/icons/Cube.svelte';
|
||||
import Sparkles from '$lib/components/icons/Sparkles.svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -38,7 +39,8 @@
|
||||
: []),
|
||||
...(canStatus && 'status'.startsWith(query.toLowerCase())
|
||||
? [{ type: 'command', data: { id: 'status' } }]
|
||||
: [])
|
||||
: []),
|
||||
...('model'.startsWith(query.toLowerCase()) ? [{ type: 'command', data: { id: 'model' } }] : [])
|
||||
];
|
||||
|
||||
$: filteredPrompts = prompts
|
||||
@@ -266,6 +268,32 @@
|
||||
</span>
|
||||
</button>
|
||||
</Tooltip>
|
||||
{:else if item.data.id === 'model'}
|
||||
<Tooltip content="Show or switch the current model." placement="top">
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Model: show or switch the current model."
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
{commandIdx === selectedIdx ? 'app-interactive-active' : ''}"
|
||||
on:mousedown={(e) => e.preventDefault()}
|
||||
on:click={() => {
|
||||
onSelect(item);
|
||||
}}
|
||||
on:mouseenter={() => {
|
||||
selectedIdx = commandIdx;
|
||||
}}
|
||||
on:focus={() => {}}
|
||||
data-selected={commandIdx === selectedIdx}
|
||||
>
|
||||
<span class="app-icon-muted flex items-center justify-center w-4 shrink-0">
|
||||
<Sparkles className="size-3.5" />
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">Model</span>
|
||||
<span class="app-muted text-[0.625rem] truncate shrink-0">/model</span>
|
||||
</span>
|
||||
</button>
|
||||
</Tooltip>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user