Skip to content

Commit

Permalink
fix layout flicker
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrisse committed Oct 2, 2024
1 parent 647b71a commit a93adae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
7 changes: 2 additions & 5 deletions src/leapfrogai_ui/src/lib/components/ChatFileUpload.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@
}}
accept={ACCEPTED_DOC_AND_AUDIO_FILE_TYPES}
disabled={uploadingFiles}
class="remove-btn-style flex rounded-lg p-1.5 hover:bg-inherit dark:hover:bg-inherit "
class="remove-btn-style flex rounded-lg p-1.5 hover:bg-inherit dark:hover:bg-inherit dark:focus:ring-gray-400"
>
<ToolbarButton>
<PaperClipOutline class="dark:text-gray-400 dark:hover:text-gray-300" />
<span class="sr-only">Attach file</span>
</ToolbarButton>
<PaperClipOutline class="dark:text-gray-400 dark:hover:text-gray-300" />
</LFFileUploadBtn>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<Button
color="dark"
class="max-h-[42px] w-48 flex-shrink-0 justify-between border border-gray-600 dark:bg-gray-700 dark:focus-within:ring-1 dark:focus-within:ring-blue-500"
class="max-h-[44px] w-48 flex-shrink-0 justify-between border border-gray-600 dark:bg-gray-700 dark:focus-within:ring-1 dark:focus-within:ring-blue-500"
><span class="truncate">{selectedAssistantName}</span><ChevronDownOutline
class="ms-2 h-6 w-6 text-white dark:text-white"
data-testid="assistants-select-btn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,21 +365,21 @@

<div
class={twMerge(
'flex flex-grow flex-col gap-1 rounded-lg border border-gray-600 bg-gray-50 px-4 py-0 dark:bg-gray-700',
attachedFileMetadata.length > 0 && 'py-4',
'min-w-0'
'flex min-w-0 flex-grow flex-col gap-1 rounded-lg border border-gray-600 bg-gray-50 px-4 py-0 dark:bg-gray-700',
attachedFileMetadata.length > 0 && 'py-4'
)}
>
<LFCarousel
data-testid="uploaded-files-carousel"
hidden={attachedFileMetadata.length === 0}
btnHeight={14}
btnWidth={6}
>
<UploadedFileCards bind:attachedFileMetadata bind:attachedFiles />
</LFCarousel>

<div id="chat-row" class="flex w-full min-w-0 items-center gap-1">
<div class="flex w-full min-w-0 items-center gap-1">
{#if attachedFileMetadata.length > 0}
<LFCarousel
data-testid="uploaded-files-carousel"
hidden={false}
btnHeight={14}
btnWidth={6}
>
<UploadedFileCards bind:attachedFileMetadata bind:attachedFiles />
</LFCarousel>
{/if}
{#if !assistantMode}
<ChatFileUploadForm bind:uploadingFiles bind:attachedFiles bind:attachedFileMetadata />
{/if}
Expand All @@ -394,7 +394,6 @@
maxRows={10}
innerWrappedClass="p-px bg-white dark:bg-gray-700"
/>

{#if !$isLoading && $status !== 'in_progress'}
<ToolbarButton data-testid="send message" type="submit" disabled={sendDisabled}
><ArrowUpOutline class="h-6 w-6 dark:text-gray-400 dark:hover:text-gray-300" />
Expand All @@ -406,15 +405,15 @@
<span class="sr-only">Cancel message</span></ToolbarButton
>
{/if}
<FileChatActions
bind:attachedFileMetadata
threadId={activeThread?.id}
bind:attachedFiles
originalMessages={$chatMessages}
setMessages={setChatMessages}
append={chatAppend}
/>
</div>
<FileChatActions
bind:attachedFileMetadata
threadId={activeThread?.id}
bind:attachedFiles
originalMessages={$chatMessages}
setMessages={setChatMessages}
append={chatAppend}
/>
</div>
</div>
<PoweredByDU />
Expand Down

0 comments on commit a93adae

Please sign in to comment.