From f4ca9ad858cafd3082dba0f5d1bdf5768120fa92 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 21 Jun 2026 09:47:02 +0100 Subject: [PATCH] fix: make retrieval options modal scroll on desktop The upload and edit-config modals dropped their height cap on sm+ screens (sm:max-h-none), so an expanded Retrieval options panel overflowed the viewport with no scroll. Keep the max-h cap at all breakpoints (max-h is a cap, not a fixed height, so short modals still size naturally) and let the existing overflow-y-auto content area scroll. Also fix a tsc error in the RetrievalOptions serialization test (optionsToConfig returns SourceConfig whose retrieval is optional). --- frontend/src/settings/SourceConfigModal.tsx | 3 ++- .../src/settings/components/RetrievalOptions.test.tsx | 10 +++++----- frontend/src/upload/Upload.tsx | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/settings/SourceConfigModal.tsx b/frontend/src/settings/SourceConfigModal.tsx index f6568780..bbfd2cf7 100644 --- a/frontend/src/settings/SourceConfigModal.tsx +++ b/frontend/src/settings/SourceConfigModal.tsx @@ -126,7 +126,8 @@ export default function SourceConfigModal({ title={t('settings.sources.configModal.title')} size="lg" mobileVariant="sheet" - className="max-w-[600px] md:w-[80vw] lg:w-[60vw]" + className="max-h-[90vh] max-w-[600px] md:w-[80vw] lg:w-[60vw]" + contentClassName="max-h-[80vh]" isPerformingTask={saving} >
diff --git a/frontend/src/settings/components/RetrievalOptions.test.tsx b/frontend/src/settings/components/RetrievalOptions.test.tsx index 06e77652..b615c04e 100644 --- a/frontend/src/settings/components/RetrievalOptions.test.tsx +++ b/frontend/src/settings/components/RetrievalOptions.test.tsx @@ -57,9 +57,9 @@ describe('optionsToConfig (write path)', () => { }); it('nests prescreen to null when disabled', () => { - expect(optionsToConfig(DEFAULT_RETRIEVAL_OPTIONS).retrieval.prescreen).toBe( - null, - ); + expect( + optionsToConfig(DEFAULT_RETRIEVAL_OPTIONS).retrieval?.prescreen, + ).toBe(null); }); it('serializes prescreen object when enabled and trims/normalizes model', () => { @@ -71,13 +71,13 @@ describe('optionsToConfig (write path)', () => { batch_size: 7, max_keep: 6, }; - const ps = optionsToConfig(v).retrieval.prescreen; + const ps = optionsToConfig(v).retrieval?.prescreen; expect(ps).not.toBe(null); expect(ps?.model).toBe(null); expect(ps?.candidate_k).toBe(30); v.retrieval.prescreen.model = ' gpt-x '; - expect(optionsToConfig(v).retrieval.prescreen?.model).toBe('gpt-x'); + expect(optionsToConfig(v).retrieval?.prescreen?.model).toBe('gpt-x'); }); }); diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index 9b0c6bd7..8affad28 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -918,8 +918,8 @@ function Upload({ title={t('modals.uploadDoc.label')} size="lg" mobileVariant="sheet" - className="max-h-[90vh] w-11/12 sm:max-h-none sm:w-auto sm:min-w-[600px] md:min-w-[700px]" - contentClassName="max-h-[80vh] sm:max-h-none" + className="max-h-[90vh] w-11/12 sm:w-auto sm:min-w-[600px] md:min-w-[700px]" + contentClassName="max-h-[80vh]" >
{!ingestor.type && (