fix: label the search filter panel's button search instead of done

This commit is contained in:
Linus Rath
2026-10-31 01:31:04 +01:00
parent 8b29254a61
commit 99aff47d6e
31 changed files with 5 additions and 34 deletions
@@ -79,12 +79,12 @@ describe('SearchFilterPanel', () => {
expect(screen.queryByRole('button', { name: /clear_all/ })).toBeNull();
});
it('clears everything and closes on Done or Enter', () => {
it('clears everything and closes on Search or Enter', () => {
const { onClearAll, onDone } = renderPanel({ subject: 'invoice' });
fireEvent.click(screen.getByRole('button', { name: /clear_all/ }));
expect(onClearAll).toHaveBeenCalledTimes(1);
fireEvent.submit(screen.getByLabelText('subject').closest('form')!);
fireEvent.click(screen.getByRole('button', { name: 'done' }));
fireEvent.click(screen.getByRole('button', { name: 'search' }));
expect(onDone).toHaveBeenCalledTimes(2);
});
});
+3 -3
View File
@@ -15,7 +15,7 @@ interface SearchFilterPanelProps {
filters: SearchFilters;
onChange: (patch: Partial<SearchFilters>, mode: FilterChangeMode) => void;
onClearAll: () => void;
/** Runs any pending search and closes the panel (Done, or Enter in a field). */
/** Runs any pending search and closes the panel (Search, or Enter in a field). */
onDone: () => void;
/** The folder picker, shared with Mountain View's form. */
folderSelect?: ReactNode;
@@ -62,7 +62,7 @@ function sizePresetOf(filters: SearchFilters): string {
* Every criterion is in view at once, labelled on the left; the yes/no ones
* are on/off chips, the date and size offer the usual ranges with a custom
* one behind them. Changes run the search as they are made, so the list
* behind already shows the result when Done closes the panel.
* behind already shows the result when Search closes the panel.
*/
export function SearchFilterPanel({ filters, onChange, onClearAll, onDone, folderSelect }: SearchFilterPanelProps) {
const t = useTranslations("advanced_search");
@@ -247,7 +247,7 @@ export function SearchFilterPanel({ filters, onChange, onClearAll, onDone, folde
</Button>
)}
<Button type="submit" size="sm" className="h-8 px-4 text-xs">
{t("done")}
{t("search")}
</Button>
</div>
</form>
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "أي حجم",
"larger_than_mb": "أكبر من {size} ميغابايت",
"custom_size": "حجم مخصص",
"done": "تم",
"name_or_address": "الاسم أو العنوان"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Qualsevol mida",
"larger_than_mb": "Més de {size} MB",
"custom_size": "Mida personalitzada",
"done": "Fet",
"name_or_address": "Nom o adreça"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Libovolná velikost",
"larger_than_mb": "Větší než {size} MB",
"custom_size": "Vlastní velikost",
"done": "Hotovo",
"name_or_address": "Jméno nebo adresa"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Alle størrelser",
"larger_than_mb": "Større end {size} MB",
"custom_size": "Tilpasset størrelse",
"done": "Færdig",
"name_or_address": "Navn eller adresse"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Beliebig",
"larger_than_mb": "Größer als {size} MB",
"custom_size": "Eigene Größe",
"done": "Fertig",
"name_or_address": "Name oder Adresse"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Any size",
"larger_than_mb": "Larger than {size} MB",
"custom_size": "Custom size",
"done": "Done",
"name_or_address": "Name or address"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Cualquier tamaño",
"larger_than_mb": "Más de {size} MB",
"custom_size": "Tamaño personalizado",
"done": "Listo",
"name_or_address": "Nombre o dirección"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Iga suurus",
"larger_than_mb": "Suurem kui {size} MB",
"custom_size": "Kohandatud suurus",
"done": "Valmis",
"name_or_address": "Nimi või aadress"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "هر اندازه",
"larger_than_mb": "بزرگ‌تر از {size} مگابایت",
"custom_size": "اندازه دلخواه",
"done": "انجام شد",
"name_or_address": "نام یا نشانی"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Toutes tailles",
"larger_than_mb": "Plus de {size} Mo",
"custom_size": "Taille personnalisée",
"done": "Terminé",
"name_or_address": "Nom ou adresse"
},
"welcome": {
-1
View File
@@ -4789,7 +4789,6 @@
"any_size": "כל גודל",
"larger_than_mb": "גדול מ-{size} MB",
"custom_size": "גודל מותאם",
"done": "סיום",
"name_or_address": "שם או כתובת"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Bármilyen méret",
"larger_than_mb": "Nagyobb mint {size} MB",
"custom_size": "Egyéni méret",
"done": "Kész",
"name_or_address": "Név vagy cím"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Qualsiasi dimensione",
"larger_than_mb": "Più di {size} MB",
"custom_size": "Dimensione personalizzata",
"done": "Fatto",
"name_or_address": "Nome o indirizzo"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "サイズ指定なし",
"larger_than_mb": "{size} MB より大きい",
"custom_size": "サイズを指定",
"done": "完了",
"name_or_address": "名前またはアドレス"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "모든 크기",
"larger_than_mb": "{size}MB 초과",
"custom_size": "크기 직접 지정",
"done": "완료",
"name_or_address": "이름 또는 주소"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Jebkurš izmērs",
"larger_than_mb": "Lielāks par {size} MB",
"custom_size": "Pielāgots izmērs",
"done": "Gatavs",
"name_or_address": "Vārds vai adrese"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Ямар ч хэмжээ",
"larger_than_mb": "{size} MB-аас их",
"custom_size": "Өөрийн хэмжээ",
"done": "Болсон",
"name_or_address": "Нэр эсвэл хаяг"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Alle størrelser",
"larger_than_mb": "Større enn {size} MB",
"custom_size": "Egendefinert størrelse",
"done": "Ferdig",
"name_or_address": "Navn eller adresse"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Elke grootte",
"larger_than_mb": "Groter dan {size} MB",
"custom_size": "Aangepaste grootte",
"done": "Klaar",
"name_or_address": "Naam of adres"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Dowolny rozmiar",
"larger_than_mb": "Większe niż {size} MB",
"custom_size": "Własny rozmiar",
"done": "Gotowe",
"name_or_address": "Imię lub adres"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Qualquer tamanho",
"larger_than_mb": "Maior que {size} MB",
"custom_size": "Tamanho personalizado",
"done": "Concluído",
"name_or_address": "Nome ou endereço"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Orice dimensiune",
"larger_than_mb": "Mai mare de {size} MB",
"custom_size": "Dimensiune personalizată",
"done": "Gata",
"name_or_address": "Nume sau adresă"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Любой размер",
"larger_than_mb": "Больше {size} МБ",
"custom_size": "Свой размер",
"done": "Готово",
"name_or_address": "Имя или адрес"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Ľubovoľná veľkosť",
"larger_than_mb": "Väčšie ako {size} MB",
"custom_size": "Vlastná veľkosť",
"done": "Hotovo",
"name_or_address": "Meno alebo adresa"
},
"welcome": {
-1
View File
@@ -1036,7 +1036,6 @@
"any_size": "ทุกขนาด",
"larger_than_mb": "ใหญ่กว่า {size} MB",
"custom_size": "กำหนดขนาดเอง",
"done": "เสร็จสิ้น",
"name_or_address": "ชื่อหรือที่อยู่"
},
"global_search": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "Herhangi bir boyut",
"larger_than_mb": "{size} MB'tan büyük",
"custom_size": "Özel boyut",
"done": "Bitti",
"name_or_address": "Ad veya adres"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "Будь-який розмір",
"larger_than_mb": "Більше {size} МБ",
"custom_size": "Власний розмір",
"done": "Готово",
"name_or_address": "Ім'я або адреса"
},
"welcome": {
-1
View File
@@ -5001,7 +5001,6 @@
"any_size": "任意大小",
"larger_than_mb": "大於 {size} MB",
"custom_size": "自訂大小",
"done": "完成",
"name_or_address": "姓名或地址"
},
"welcome": {
-1
View File
@@ -4871,7 +4871,6 @@
"any_size": "任意大小",
"larger_than_mb": "大于 {size} MB",
"custom_size": "自定义大小",
"done": "完成",
"name_or_address": "姓名或地址"
},
"welcome": {