diff --git a/web/src/app.css b/web/src/app.css index 1171923..7f9c0de 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -20,6 +20,10 @@ } @layer base { + html, body { + overflow-x: hidden; + max-width: 100vw; + } body { font-family: 'DM Sans', sans-serif; background-color: var(--bg-primary); diff --git a/web/src/lib/api/client.ts b/web/src/lib/api/client.ts index 10c4b3c..056b876 100644 --- a/web/src/lib/api/client.ts +++ b/web/src/lib/api/client.ts @@ -223,7 +223,7 @@ export const push = { request<{ id: number; message: string }>('POST', '/api/push/subscribe', subscription), unsubscribe: (endpoint: string) => request<{ message: string }>('DELETE', '/api/push/subscribe', { endpoint }), - vapidKey: () => request<{ public_key: string }>('GET', '/api/push/vapid-key') + vapidKey: () => request<{ vapid_public_key: string }>('GET', '/api/push/vapid-key') }; // User profile diff --git a/web/src/lib/components/ComposeForm.svelte b/web/src/lib/components/ComposeForm.svelte index 82c7d12..4534554 100644 --- a/web/src/lib/components/ComposeForm.svelte +++ b/web/src/lib/components/ComposeForm.svelte @@ -55,20 +55,29 @@ function autoResize() { if (!textareaEl) return; - textareaEl.style.height = 'auto'; + // Reset to measure true scrollHeight + textareaEl.style.height = '80px'; const maxHeight = 240; // ~12 lines const scrollHeight = textareaEl.scrollHeight; if (scrollHeight > maxHeight) { textareaEl.style.height = maxHeight + 'px'; textareaEl.style.overflowY = 'auto'; + textareaEl.classList.remove('overflow-hidden'); } else { - textareaEl.style.height = scrollHeight + 'px'; + textareaEl.style.height = Math.max(80, scrollHeight) + 'px'; textareaEl.style.overflowY = 'hidden'; + textareaEl.classList.add('overflow-hidden'); } } + function isMobile(): boolean { + return typeof window !== 'undefined' && window.innerWidth < 768; + } + function handleKeydown(e: KeyboardEvent) { - if (e.key === 'Enter' && !e.shiftKey) { + // On mobile, Enter inserts newline (send via button only) + // On desktop, Enter sends, Shift+Enter inserts newline + if (e.key === 'Enter' && !e.shiftKey && !isMobile()) { e.preventDefault(); handleSubmit(); } @@ -161,9 +170,9 @@