mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 04:14:42 +00:00
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).
This commit is contained in:
1 parent
f6400cd736
commit
f4ca9ad858
3 files changed
+9
-8
No files matched your search
@@ -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}
|
||||
>
|
||||
<div className="flex h-full flex-col">
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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]"
|
||||
>
|
||||
<div className="flex w-full flex-col gap-6">
|
||||
{!ingestor.type && (
|
||||
|
||||
Reference in new issue
Block a user