feat(accounts): add precise service filtering

Add an explicit service selector to the account creation dialog while keeping the text field focused on access types such as API and web login. Preserve the result area dimensions during filtering and allow Enter to choose the first visible account type. Cover filtering, keyboard selection, translations, and stable list geometry with focused regression tests.
This commit is contained in:
Sucukdeluxe
2026-08-15 18:46:18 +02:00
parent a3b4b2323f
commit 5747a50932
7 changed files with 147 additions and 56 deletions
+21
View File
@@ -16,6 +16,27 @@ export function matchesAccountModeFilter(option: AccountModeOption, filter: Acco
return option.modeLabel.startsWith("Web");
}
export function filterAccountDialogOptions<T extends {
serviceLabel: string;
title: string;
modeLabel: string;
pickerDescription: string;
}>(options: readonly T[], query: string, serviceFilter: string): T[] {
const normalizedQuery = query.trim().toLocaleLowerCase("de-DE");
return options.filter((option) => {
if (serviceFilter !== "all" && option.serviceLabel !== serviceFilter) {
return false;
}
if (!normalizedQuery) {
return true;
}
return [option.title, option.modeLabel, option.pickerDescription]
.join(" ")
.toLocaleLowerCase("de-DE")
.includes(normalizedQuery);
});
}
export function buildConfiguredProviderOrder(
currentOrder: readonly DebridProvider[],
configuredProviders: readonly DebridProvider[]