Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,6 @@ ENV BODY_SIZE_LIMIT=15728640
COPY --from=builder --chown=1000 /app/build /app/build
COPY --from=builder --chown=1000 /app/node_modules /app/node_modules

RUN apt -y update && apt-get install -y curl dnsutils

CMD ["/bin/bash", "-c", "/app/entrypoint.sh"]
17 changes: 16 additions & 1 deletion src/lib/components/chat/ChatInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
toggleServer,
} from "$lib/stores/mcpServers";
import { getMcpServerFaviconUrl } from "$lib/utils/favicon";
import { page } from "$app/state";

interface Props {
files?: File[];
Expand Down Expand Up @@ -76,6 +77,7 @@
let fileInputEl: HTMLInputElement | undefined = $state();
let isUrlModalOpen = $state(false);
let isMcpManagerOpen = $state(false);
let isDropdownOpen = $state(false);

function openPickerWithAccept(accept: string) {
if (!fileInputEl) return;
Expand Down Expand Up @@ -107,6 +109,7 @@
: Promise.resolve();

async function focusTextarea() {
if (page.data.shared && page.data.loginEnabled && !page.data.user) return;
if (!textareaElement || textareaElement.disabled || isVirtualKeyboard()) return;
if (typeof document !== "undefined" && document.activeElement === textareaElement) return;

Expand Down Expand Up @@ -177,6 +180,9 @@
}

function handleFocus() {
if (requireAuthUser()) {
return;
}
if (blurTimeout) {
clearTimeout(blurTimeout);
blurTimeout = null;
Expand Down Expand Up @@ -251,7 +257,16 @@
accept={mimeTypes.join(",")}
/>

<DropdownMenu.Root>
<DropdownMenu.Root
bind:open={isDropdownOpen}
onOpenChange={(open) => {
if (open && requireAuthUser()) {
isDropdownOpen = false;
return;
}
isDropdownOpen = open;
}}
>
<DropdownMenu.Trigger
class="btn size-7 rounded-full border bg-white text-black shadow transition-none enabled:hover:bg-white enabled:hover:shadow-inner dark:border-transparent dark:bg-gray-600/50 dark:text-white dark:hover:enabled:bg-gray-600"
disabled={loading}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/chat/UrlFetchModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
const txt = await res.text();
throw new Error(txt || `Failed to fetch (${res.status})`);
}
const forwardedType =
res.headers.get("x-forwarded-content-type");
const forwardedType = res.headers.get("x-forwarded-content-type");
const blob = await res.blob();
const mimeType = pickSafeMime(forwardedType, blob.type, trimmed);
// Optional client-side mime filter (same wildcard semantics as dropzone)
Expand Down
3 changes: 1 addition & 2 deletions src/lib/utils/loadAttachmentsFromUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export async function loadAttachmentsFromUrls(
return;
}

const forwardedType =
response.headers.get("x-forwarded-content-type");
const forwardedType = response.headers.get("x-forwarded-content-type");
const blob = await response.blob();
const mimeType = pickSafeMime(forwardedType, blob.type, url);
const contentDisposition = response.headers.get("content-disposition");
Expand Down
Loading