diff --git a/src/App.svelte b/src/App.svelte index 121404e..3b1c2f4 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -35,6 +35,20 @@ // Copy toast let copiedModel = ""; + // Search input ref and focus tracking + let searchInput: HTMLInputElement; + let searchFocused = false; + + function handleKeydown(e: KeyboardEvent) { + if ((e.metaKey || e.ctrlKey) && e.key === "k") { + e.preventDefault(); + searchInput?.focus(); + } + if (e.key === "Escape" && document.activeElement === searchInput) { + searchInput?.blur(); + } + } + // Quick start tab state per model let codeTabStates: Record = {}; @@ -295,6 +309,8 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_ } + +
@@ -370,7 +386,10 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_ { searchFocused = true; }} + on:blur={() => { searchFocused = false; }} type="text" autocomplete="off" name="query" @@ -383,6 +402,9 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_ {/if} + {#if !query && !searchFocused} + ⌘K + {/if}
@@ -502,7 +524,7 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_ {/if}
- {getDisplayModelName(name, litellm_provider)} + {getDisplayModelName(name, litellm_provider)} {#if mode} {getModeLabel(mode)} {/if} @@ -925,6 +947,26 @@ curl http://0.0.0.0:4000/v1/chat/completions \ .search-clear:hover { color: var(--text-color); background: var(--bg-tertiary); } + .search-shortcut { + position: absolute; + right: 0.75rem; + top: 50%; + transform: translateY(-50%); + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.125rem 0.4375rem; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; + font-size: 0.6875rem; + font-weight: 500; + color: var(--muted-color); + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 5px; + pointer-events: none; + line-height: 1.4; + } + /* Filters */ .filters-row { display: grid; @@ -1053,6 +1095,9 @@ curl http://0.0.0.0:4000/v1/chat/completions \ background-color: var(--bg-secondary); white-space: nowrap; user-select: none; + position: sticky; + top: 63px; + z-index: 10; } .th-model { padding-left: 1rem; } @@ -1082,7 +1127,10 @@ curl http://0.0.0.0:4000/v1/chat/completions \ cursor: pointer; } - tbody tr.model-row:hover { background-color: var(--hover-bg); } + tbody tr.model-row:hover { + background-color: var(--hover-bg); + box-shadow: inset 3px 0 0 var(--litellm-primary); + } tbody tr.model-row.expanded { background-color: var(--bg-secondary); } tbody tr.model-row:last-child { border-bottom: none; } diff --git a/src/Main.svelte b/src/Main.svelte index a5fb346..1e6cbc1 100644 --- a/src/Main.svelte +++ b/src/Main.svelte @@ -1,5 +1,6 @@