refac
This commit is contained in:
1 parent
d3fd860c13
commit
8f07c0c8ee
5 files changed
+19
-18
No files matched your search
@@ -49,7 +49,7 @@
|
|||||||
role="option"
|
role="option"
|
||||||
aria-selected={value === item.value}
|
aria-selected={value === item.value}
|
||||||
aria-label={$i18n.t('Select {{modelName}} model', { modelName: item.label })}
|
aria-label={$i18n.t('Select {{modelName}} model', { modelName: item.label })}
|
||||||
class="flex group/item w-full text-left font-medium line-clamp-1 select-none items-center rounded-button py-2 pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-xl cursor-pointer data-highlighted:bg-muted {index ===
|
class="flex group/item w-full text-left font-medium line-clamp-1 select-none items-center rounded-button py-[7px] pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-xl cursor-pointer data-highlighted:bg-muted {index ===
|
||||||
selectedModelIdx
|
selectedModelIdx
|
||||||
? 'bg-gray-100 dark:bg-gray-800 group-hover:bg-transparent'
|
? 'bg-gray-100 dark:bg-gray-800 group-hover:bg-transparent'
|
||||||
: ''}"
|
: ''}"
|
||||||
|
|||||||
@@ -474,7 +474,7 @@
|
|||||||
deleteModelTarget = null;
|
deleteModelTarget = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ITEM_HEIGHT = 42;
|
const ITEM_HEIGHT = 39;
|
||||||
const OVERSCAN = 10;
|
const OVERSCAN = 10;
|
||||||
|
|
||||||
let listScrollTop = 0;
|
let listScrollTop = 0;
|
||||||
@@ -558,7 +558,7 @@
|
|||||||
>
|
>
|
||||||
<slot>
|
<slot>
|
||||||
{#if searchEnabled}
|
{#if searchEnabled}
|
||||||
<div class="flex items-center gap-2.5 px-4.5 pt-3.5 mb-1.5">
|
<div class="flex items-center gap-2 px-3.5 pt-3 mb-1.5">
|
||||||
<Search className="size-4" strokeWidth="2.5" />
|
<Search className="size-4" strokeWidth="2.5" />
|
||||||
|
|
||||||
<input
|
<input
|
||||||
@@ -695,7 +695,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-2.5 group relative">
|
<div class="px-2 group relative">
|
||||||
{#if filteredItems.length === 0}
|
{#if filteredItems.length === 0}
|
||||||
{#if items.length === 0 && $user?.role === 'admin'}
|
{#if items.length === 0 && $user?.role === 'admin'}
|
||||||
<div class="flex flex-col items-start justify-center py-6 px-4 text-start">
|
<div class="flex flex-col items-start justify-center py-6 px-4 text-start">
|
||||||
@@ -765,7 +765,7 @@
|
|||||||
placement="top-start"
|
placement="top-start"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="flex w-full font-medium line-clamp-1 select-none items-center rounded-button py-2 pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-xl cursor-pointer data-highlighted:bg-muted"
|
class="flex w-full font-medium line-clamp-1 select-none items-center rounded-button py-[7px] pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-xl cursor-pointer data-highlighted:bg-muted"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
pullModelHandler();
|
pullModelHandler();
|
||||||
}}
|
}}
|
||||||
@@ -781,7 +781,7 @@
|
|||||||
|
|
||||||
{#each selectionOnly ? [] : Object.keys($MODEL_DOWNLOAD_POOL) as model}
|
{#each selectionOnly ? [] : Object.keys($MODEL_DOWNLOAD_POOL) as model}
|
||||||
<div
|
<div
|
||||||
class="flex w-full justify-between font-medium select-none rounded-button py-2 pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 rounded-xl cursor-pointer data-highlighted:bg-muted"
|
class="flex w-full justify-between font-medium select-none rounded-button py-[7px] pl-3 pr-1.5 text-sm text-gray-700 dark:text-gray-100 outline-hidden transition-all duration-75 rounded-xl cursor-pointer data-highlighted:bg-muted"
|
||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="mr-2.5 translate-y-0.5">
|
<div class="mr-2.5 translate-y-0.5">
|
||||||
@@ -842,7 +842,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pb-2.5"></div>
|
<div class="pb-2"></div>
|
||||||
|
|
||||||
<div class="hidden w-[42rem]" />
|
<div class="hidden w-[42rem]" />
|
||||||
<div class="hidden w-[32rem]" />
|
<div class="hidden w-[32rem]" />
|
||||||
|
|||||||
@@ -526,7 +526,7 @@
|
|||||||
isResizing = true;
|
isResizing = true;
|
||||||
|
|
||||||
startClientX = e.clientX;
|
startClientX = e.clientX;
|
||||||
startWidth = $sidebarWidth ?? 240;
|
startWidth = $sidebarWidth ?? 250;
|
||||||
|
|
||||||
document.body.style.userSelect = 'none';
|
document.body.style.userSelect = 'none';
|
||||||
};
|
};
|
||||||
@@ -1047,7 +1047,7 @@
|
|||||||
: 'invisible'}"
|
: 'invisible'}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="sidebar px-1.5 pt-1.5 pb-1 flex justify-between space-x-1 text-gray-600 dark:text-gray-400 sticky top-0 z-10 -mb-2"
|
class="sidebar px-1.5 pt-2 pb-1.5 flex justify-between space-x-1 text-gray-600 dark:text-gray-400 sticky top-0 z-10 -mb-3"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="flex items-center rounded-xl size-8.5 h-full justify-center hover:bg-gray-100/50 dark:hover:bg-gray-850/50 transition no-drag-region"
|
class="flex items-center rounded-xl size-8.5 h-full justify-center hover:bg-gray-100/50 dark:hover:bg-gray-850/50 transition no-drag-region"
|
||||||
@@ -1098,7 +1098,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="relative flex flex-col flex-1 overflow-y-auto scrollbar-hidden pt-2 pb-2"
|
class="relative flex flex-col flex-1 overflow-y-auto scrollbar-hidden pt-3 pb-3"
|
||||||
on:scroll={(e) => {
|
on:scroll={(e) => {
|
||||||
if (e.target.scrollTop === 0) {
|
if (e.target.scrollTop === 0) {
|
||||||
scrollTop = 0;
|
scrollTop = 0;
|
||||||
@@ -1107,11 +1107,11 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="pb-1">
|
<div class="pb-1.5">
|
||||||
<div class="px-1.5 flex justify-center text-gray-800 dark:text-gray-200">
|
<div class="px-1.5 flex justify-center text-gray-800 dark:text-gray-200">
|
||||||
<a
|
<a
|
||||||
id="sidebar-new-chat-button"
|
id="sidebar-new-chat-button"
|
||||||
class="group grow flex items-center space-x-2.5 rounded-xl px-2 py-[7px] hover:bg-gray-100 dark:hover:bg-gray-900 transition outline-none"
|
class="group grow flex items-center space-x-2.5 rounded-xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition outline-none"
|
||||||
href="/"
|
href="/"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
on:click={newChatHandler}
|
on:click={newChatHandler}
|
||||||
@@ -1132,7 +1132,7 @@
|
|||||||
<div class="px-1.5 flex justify-center text-gray-800 dark:text-gray-200">
|
<div class="px-1.5 flex justify-center text-gray-800 dark:text-gray-200">
|
||||||
<button
|
<button
|
||||||
id="sidebar-search-button"
|
id="sidebar-search-button"
|
||||||
class="group grow flex items-center space-x-2.5 rounded-xl px-2 py-[7px] hover:bg-gray-100 dark:hover:bg-gray-900 transition outline-none"
|
class="group grow flex items-center space-x-2.5 rounded-xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition outline-none"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
showSearch.set(true);
|
showSearch.set(true);
|
||||||
}}
|
}}
|
||||||
@@ -1160,7 +1160,7 @@
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
id="sidebar-{itemId}-button"
|
id="sidebar-{itemId}-button"
|
||||||
class="grow flex items-center space-x-2.5 rounded-xl px-2 py-[7px] hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
class="grow flex items-center space-x-2.5 rounded-xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
||||||
href={meta.href}
|
href={meta.href}
|
||||||
on:click={itemClickHandler}
|
on:click={itemClickHandler}
|
||||||
draggable="false"
|
draggable="false"
|
||||||
@@ -1524,7 +1524,7 @@
|
|||||||
class="w-full pl-2.5 text-xs text-gray-500 dark:text-gray-500 font-medium {idx ===
|
class="w-full pl-2.5 text-xs text-gray-500 dark:text-gray-500 font-medium {idx ===
|
||||||
0
|
0
|
||||||
? ''
|
? ''
|
||||||
: 'pt-4'} pb-1"
|
: 'pt-5'} pb-1.5"
|
||||||
>
|
>
|
||||||
{$i18n.t(chat.time_range)}
|
{$i18n.t(chat.time_range)}
|
||||||
<!-- localisation keys for time_range to be recognized from the i18next parser (so they don't get automatically removed):
|
<!-- localisation keys for time_range to be recognized from the i18next parser (so they don't get automatically removed):
|
||||||
@@ -1602,7 +1602,7 @@
|
|||||||
</Folder>
|
</Folder>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-1.5 pt-1 pb-1.5 sticky bottom-0 z-10 -mt-2 sidebar">
|
<div class="px-1.5 pt-1.5 pb-2 sticky bottom-0 z-10 -mt-3 sidebar">
|
||||||
<div
|
<div
|
||||||
class=" sidebar-bg-gradient-to-t bg-linear-to-t from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mt-6"
|
class=" sidebar-bg-gradient-to-t bg-linear-to-t from-gray-50 dark:from-gray-950 to-transparent from-50% pointer-events-none absolute inset-0 -z-10 -mt-6"
|
||||||
></div>
|
></div>
|
||||||
@@ -1621,7 +1621,7 @@
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class=" flex items-center rounded-xl py-1.5 px-1.5 w-full hover:bg-gray-100/50 dark:hover:bg-gray-900/50 transition"
|
class=" flex items-center rounded-xl py-2 px-1.5 w-full hover:bg-gray-100/50 dark:hover:bg-gray-900/50 transition"
|
||||||
aria-label={$i18n.t('User menu')}
|
aria-label={$i18n.t('User menu')}
|
||||||
>
|
>
|
||||||
<div class=" self-center mr-3 relative flex-shrink-0">
|
<div class=" self-center mr-3 relative flex-shrink-0">
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export const chatRequestQueues: Writable<
|
|||||||
Record<string, { id: string; prompt: string; files: any[] }[]>
|
Record<string, { id: string; prompt: string; files: any[] }[]>
|
||||||
> = writable({});
|
> = writable({});
|
||||||
|
|
||||||
export const sidebarWidth = writable(240);
|
export const sidebarWidth = writable(250);
|
||||||
|
|
||||||
export const showSidebar = writable(false);
|
export const showSidebar = writable(false);
|
||||||
export const showSearch = writable(false);
|
export const showSearch = writable(false);
|
||||||
|
|||||||
Reference in new issue
Block a user