This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-14 03:16:20 -04:00
1 parent d475cb9174
commit 7407eeede8
3 files changed
+21 -13

No files matched your search

+2 -2
View File
@@ -2013,13 +2013,13 @@
</div> </div>
<div class="self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]"> <div class="self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]">
<div class="-mr-[0.5px] flex min-w-0 max-w-[10rem] items-center sm:max-w-[13rem]"> <div class="flex min-w-0 max-w-[10rem] items-center sm:max-w-[13rem]">
<ModelSelector <ModelSelector
bind:selectedModels bind:selectedModels
showSetDefault={!history?.currentId} showSetDefault={!history?.currentId}
placement="auto" placement="auto"
align="end" align="end"
triggerClassName="items-center gap-1.5 rounded-lg px-2 py-1 text-[13px] font-normal text-gray-600 transition-colors duration-100 hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-200" triggerClassName="items-center gap-1.5 rounded-lg pl-2 pr-1.5 py-1 text-[13px] font-normal text-gray-600 transition-colors duration-100 hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-800/40 dark:hover:text-gray-200"
/> />
</div> </div>
@@ -20,7 +20,6 @@
user, user,
MODEL_DOWNLOAD_POOL, MODEL_DOWNLOAD_POOL,
models, models,
mobile,
temporaryChatEnabled, temporaryChatEnabled,
settings, settings,
config config
@@ -76,6 +75,7 @@
let triggerElement: HTMLElement | null = null; let triggerElement: HTMLElement | null = null;
let contentElement: HTMLElement | null = null; let contentElement: HTMLElement | null = null;
let dropdownPosition = { top: 0, left: 0, width: 0 }; let dropdownPosition = { top: 0, left: 0, width: 0 };
const fullWidthBreakpoint = 640;
const portal = (node: HTMLElement) => { const portal = (node: HTMLElement) => {
document.body.appendChild(node); document.body.appendChild(node);
@@ -94,6 +94,7 @@
const contentHeight = contentRect?.height ?? 0; const contentHeight = contentRect?.height ?? 0;
const spaceBelow = window.innerHeight - rect.bottom - 8; const spaceBelow = window.innerHeight - rect.bottom - 8;
const spaceAbove = rect.top - 8; const spaceAbove = rect.top - 8;
const fullWidth = window.innerWidth < fullWidthBreakpoint;
const resolvedPlacement = const resolvedPlacement =
placement === 'auto' placement === 'auto'
? contentHeight && spaceBelow < contentHeight && spaceAbove > spaceBelow ? contentHeight && spaceBelow < contentHeight && spaceAbove > spaceBelow
@@ -105,8 +106,8 @@
resolvedPlacement === 'top' && contentHeight resolvedPlacement === 'top' && contentHeight
? rect.top - contentHeight - 2 ? rect.top - contentHeight - 2
: rect.bottom + 2, : rect.bottom + 2,
left: $mobile ? 8 : align === 'end' && contentWidth ? rect.right - contentWidth : rect.left, left: fullWidth ? 8 : align === 'end' && contentWidth ? rect.right - contentWidth : rect.left,
width: $mobile ? window.innerWidth - 16 : 0 width: fullWidth ? window.innerWidth - 16 : 0
}; };
}; };
@@ -641,7 +642,7 @@
}} }}
> >
<span class="min-w-0 flex-1 truncate">{triggerLabel}</span> <span class="min-w-0 flex-1 truncate">{triggerLabel}</span>
<ChevronDown className="ml-1.5 size-2.5 shrink-0 self-center" strokeWidth="2.5" /> <ChevronDown className="ml-1 size-2.5 shrink-0 self-center" strokeWidth="2.5" />
</div> </div>
</button> </button>
@@ -649,12 +650,12 @@
<div <div
use:portal use:portal
bind:this={contentElement} bind:this={contentElement}
style="position: fixed; z-index: 9999; top: {dropdownPosition.top}px; left: {dropdownPosition.left}px;{$mobile style="position: fixed; z-index: 9999; top: {dropdownPosition.top}px; left: {dropdownPosition.left}px;{dropdownPosition.width
? ` width: ${dropdownPosition.width}px;` ? ` width: ${dropdownPosition.width}px;`
: ''}" : ''}"
> >
<div <div
class="z-40 {$mobile class="z-40 {dropdownPosition.width
? `w-full` ? `w-full`
: `${className}`} max-w-[calc(100vw-1rem)] justify-start rounded-xl border border-gray-100 bg-white p-0.5 shadow-lg outline-hidden dark:border-gray-800 dark:bg-gray-850 dark:text-white" : `${className}`} max-w-[calc(100vw-1rem)] justify-start rounded-xl border border-gray-100 bg-white p-0.5 shadow-lg outline-hidden dark:border-gray-800 dark:bg-gray-850 dark:text-white"
transition:flyAndScale transition:flyAndScale
+12 -5
View File
@@ -77,8 +77,12 @@
aria-label="New Chat" aria-label="New Chat"
/> />
<nav class="sticky top-0 z-30 w-full pt-0.5 pb-1 -mb-12 flex flex-col items-center drag-region"> <nav
<div class="flex items-center w-full pl-1.5 pr-1"> class="sticky top-0 z-30 w-full {$mobile
? 'pt-1.5'
: 'pt-0.5'} pb-1 -mb-12 flex flex-col items-center drag-region"
>
<div class="flex items-center w-full {$mobile ? 'px-2.5' : 'pl-1.5 pr-1'}">
<div <div
id="navbar-bg-gradient-to-b" id="navbar-bg-gradient-to-b"
class="{chat?.id class="{chat?.id
@@ -89,16 +93,19 @@
<div class=" flex max-w-full w-full mx-auto bg-transparent"> <div class=" flex max-w-full w-full mx-auto bg-transparent">
<div class="flex items-center w-full max-w-full"> <div class="flex items-center w-full max-w-full">
{#if $mobile && !$showSidebar} {#if $mobile && !$showSidebar}
<div class="-translate-x-0.5 mr-1 mt-1 self-start flex flex-none items-center"> <div class="mr-1 flex flex-none items-center self-center">
<Tooltip content={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')}> <Tooltip content={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')}>
<button <button
class="flex size-6 cursor-pointer items-center justify-center rounded-lg text-gray-500 transition hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/40 dark:hover:text-gray-200" id="sidebar-toggle-button"
class="flex cursor-pointer rounded-lg text-gray-500 transition hover:bg-gray-50/40 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/40 dark:hover:text-gray-200"
on:click={() => { on:click={() => {
showSidebar.set(!$showSidebar); showSidebar.set(!$showSidebar);
}} }}
aria-label={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')} aria-label={$showSidebar ? $i18n.t('Close Sidebar') : $i18n.t('Open Sidebar')}
> >
<Sidebar /> <div class="self-center p-1.5">
<Sidebar />
</div>
</button> </button>
</Tooltip> </Tooltip>
</div> </div>