diff --git a/changelog.json b/changelog.json index 257a996..51f9bc9 100644 --- a/changelog.json +++ b/changelog.json @@ -3,10 +3,12 @@ "version": "0.21.1", "date": "2026-07-24", "en": [ - "Fixed the colour theme sometimes reverting to the default when reopening OpsLog — it's now restored reliably." + "Fixed the colour theme sometimes reverting to the default when reopening OpsLog — it's now restored reliably.", + "ADIF export field picker: the per-group All / None buttons work again." ], "fr": [ - "Correction du thème qui revenait parfois au défaut à la réouverture d'OpsLog — il est maintenant restauré de façon fiable." + "Correction du thème qui revenait parfois au défaut à la réouverture d'OpsLog — il est maintenant restauré de façon fiable.", + "Sélecteur de champs à l'export ADIF : les boutons Tout / Aucun par groupe refonctionnent." ] }, { diff --git a/frontend/src/components/ExportFieldsDialog.tsx b/frontend/src/components/ExportFieldsDialog.tsx index dd50a49..d74a820 100644 --- a/frontend/src/components/ExportFieldsDialog.tsx +++ b/frontend/src/components/ExportFieldsDialog.tsx @@ -12,6 +12,34 @@ import { adif } from '@/../wailsjs/go/models'; type FieldDef = adif.FieldDef; const PREF_KEY = 'opslog.exportFields'; +// One category card with its checkboxes + All/None. Defined at MODULE scope (not +// inside ExportFieldsDialog) so its component identity is stable across renders — +// an inner component is re-created every render, remounting the whole subtree and +// making the All/None buttons and checkboxes feel dead. +function GroupCard({ title, tags, warn, sel, allLabel, noneLabel, onAll, onNone, onToggle }: { + title: string; tags: string[]; warn?: boolean; sel: Set; + allLabel: string; noneLabel: string; + onAll: (tags: string[]) => void; onNone: (tags: string[]) => void; onToggle: (name: string, on: boolean) => void; +}) { + return ( +
+
+ {title} + + + + +
+ {tags.map((name) => ( + + ))} +
+ ); +} + // ExportFieldsDialog lets the operator pick exactly which ADIF fields an export // writes. Two groups: the official ADIF 3.1.7 dictionary (grouped by category) // and the OpsLog / non-standard tags actually present in the log's extras. The @@ -69,23 +97,14 @@ export function ExportFieldsDialog({ open, count, onExport, onClose }: { onExport(fields); }; - const GroupCard = ({ title, tags, warn }: { title: string; tags: string[]; warn?: boolean }) => ( -
-
- {title} - - - - -
- {tags.map((name) => ( - - ))} -
- ); + const allLabel = t('exf.all'); + const noneLabel = t('exf.none'); + const cardProps = { + sel, allLabel, noneLabel, + onAll: (tags: string[]) => setMany(tags, true), + onNone: (tags: string[]) => setMany(tags, false), + onToggle: toggle, + }; return ( { if (!o) onClose(); }}> @@ -104,9 +123,9 @@ export function ExportFieldsDialog({ open, count, onExport, onClose }: {
{/* OpsLog / non-standard group first (most relevant to keep or drop). */} - {extras.length > 0 && } + {extras.length > 0 && } {groups.map(([g, list]) => ( - d.name)} /> + d.name)} {...cardProps} /> ))}