Skip to content

Commit

Permalink
Fix upload
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrisse committed Oct 2, 2024
1 parent 4179f76 commit ea75d79
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
5 changes: 2 additions & 3 deletions src/leapfrogai_ui/src/lib/components/ChatFileUpload.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import { ERROR_UPLOADING_FILE_MSG } from '$constants/errors';
import { shortenFileName } from '$helpers/stringHelpers';
import { removeFilesUntilUnderLimit, updateFileMetadata } from '$helpers/fileHelpers';
import { ToolbarButton } from 'flowbite-svelte';
export let uploadingFiles;
export let attachedFileMetadata;
Expand Down Expand Up @@ -115,7 +114,6 @@
bind:ref={fileUploadBtnRef}
testId="upload-file-btn"
name="files"
unstyled
outline
multiple
size="sm"
Expand Down Expand Up @@ -147,7 +145,8 @@
}}
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 dark:focus:ring-gray-400"
class="remove-btn-style flex rounded-lg p-1.5 hover:bg-inherit dark:hover:bg-inherit dark:focus:ring-0"
>
<PaperClipOutline class="dark:text-gray-400 dark:hover:text-gray-300" />
<span class="sr-only">Attach file</span>
</LFFileUploadBtn>
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/src/lib/components/PoweredByDU.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import DefenseUnicorns from '$assets/DefenseUnicorns.png';
</script>

<div class="flex items-center justify-center gap-1 py-4 text-white">
<div class="flex items-center justify-center gap-1 py-3 text-white">
<img alt="Doug" src={doug} class="h-6" />
<span class="tracking-custom text-xs leading-4">Powered By</span>
<img alt="Defense Unicorns" src={DefenseUnicorns} class="w-[6.75rem]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,27 +359,25 @@
{/if}
</div>
</div>
<Hr classHr="my-2" />
<Hr classHr="mt-0 mb-3" />
<div id="chat-tools" data-testid="chat-tools" class="flex min-w-0 items-end gap-2 px-8">
<SelectAssistantDropdown />

<div
class={twMerge(
'flex h-[44px] 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',
'flex min-h-[44px] 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'
)}
>
<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}
<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">
{#if !assistantMode}
<ChatFileUploadForm bind:uploadingFiles bind:attachedFiles bind:attachedFileMetadata />
{/if}
Expand All @@ -405,15 +403,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 ea75d79

Please sign in to comment.