add toggle to select all options in file transfer

This commit is contained in:
marlon-erler
2026-10-01 07:46:03 +02:00
parent 573e7e1bfa
commit 23a1ed3ce5
3 changed files with 25 additions and 1 deletions
+18 -1
View File
@@ -53,6 +53,9 @@ function OptionEntry(
fileTransferViewModel.selectedPaths.remove(fileOption.path);
}
});
fileTransferViewModel.allOptionsSelected.subscribe(allSelected => {
isSelected.value = allSelected;
})
function toggle() {
isSelected.value = !isSelected.value;
}
@@ -249,7 +252,14 @@ function FileSelectionModal(
fileTransferViewModel.chatFileOptions,
OptionConverter,
]}
></div>
></div>
<hr></hr>
<label class="inline">
<input type="checkbox" bind:checked={fileTransferViewModel.allOptionsSelected}></input>
{coreViewModel.translations.general.selectAllLabel}
</label>
</main>
<div class="flex-row width-100">
<button
@@ -705,6 +715,13 @@ function ExportFileSelectionModal(
OptionConverter,
]}
></div>
<hr></hr>
<label class="inline">
<input type="checkbox" bind:checked={fileTransferViewModel.allOptionsSelected}></input>
{coreViewModel.translations.general.selectAllLabel}
</label>
</main>
<div class="flex-row width-100">
<button
+6
View File
@@ -22,6 +22,8 @@ const englishTranslations = {
saveButton: "Save",
setButton: "Set",
selectAllLabel: "Select all",
filterOrCreateLabel: (type: string) => `Search or create ${type}`,
createLabel: (query: string) => `Create "${query}"`,
@@ -402,6 +404,8 @@ export const allTranslations: {
saveButton: "Speichern",
setButton: "OK",
selectAllLabel: "Alle auswählen",
filterOrCreateLabel: (type: string) =>
`${type} suchen oder erstellen`,
createLabel: (query: string) => `"${query}" erstellen`,
@@ -747,6 +751,8 @@ export const allTranslations: {
saveButton: "Guardar",
setButton: "OK",
selectAllLabel: "Seleccionar todos",
filterOrCreateLabel: (type: string) => `Buscar o crear ${type}`,
createLabel: (query: string) => `Crear "${query}"`,
@@ -21,6 +21,7 @@ export default class FileTransferViewModel extends Context {
chatFileOptions: React.ListState<FileTransferOption> =
new React.ListState();
selectedPaths: React.ListState<string[]> = new React.ListState();
allOptionsSelected: React.State<boolean> = new React.State(false);
transferChannel: React.State<string> = new React.State("");
transferKey: React.State<string> = new React.State("");