diff --git a/changelog.go b/changelog.go index f6de5cf..2295431 100644 --- a/changelog.go +++ b/changelog.go @@ -31,6 +31,20 @@ func loadChangelog() []ChangelogEntry { return out } +// GetChangelog returns every changelog entry up to the running version (newest +// first), without touching the "seen" marker — for a "What's new" button that +// reopens the notes on demand. +func (a *App) GetChangelog() []ChangelogEntry { + out := []ChangelogEntry{} + for _, e := range loadChangelog() { + if strings.TrimSpace(e.Version) == "" || versionLess(appVersion, e.Version) { + continue + } + out = append(out, e) + } + return out +} + // GetWhatsNew returns the changelog entries the operator hasn't seen yet — the // notes for every version newer than the last one they ran, up to the current // build — and records the current version as seen so it pops exactly once per diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 213f274..8a98dd1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -13,7 +13,7 @@ import { GetQSO, UpdateQSO, DeleteQSO, DeleteQSOs, DeleteAllQSO, UpdateQSOsFromCty, UpdateQSOsFromQRZ, UpdateQSOsFromClublog, UploadQSOsManual, SendQSORecordingEmail, LookupCallsign, GetStationSettings, GetListsSettings, - GetStartupStatus, CheckForUpdate, DownloadAndApplyUpdate, GetLiveStations, GetWhatsNew, + GetStartupStatus, CheckForUpdate, DownloadAndApplyUpdate, GetLiveStations, GetWhatsNew, GetChangelog, WorkedBefore, SetCompactMode, GetCATState, SetCATFrequency, SetCATMode, SwitchCATRig, FlexApplyBandAntenna, @@ -2801,6 +2801,7 @@ export default function App() { { type: 'item', label: refsDownloading ? 'Downloading reference lists…' : 'Download reference lists (IOTA/POTA/WWFF/SOTA)', action: 'tools.downloadRefs', disabled: refsDownloading }, ]}, { name: 'help', label: t('menu.help'), items: [ + { type: 'item', label: t('whatsnew.title'), action: 'help.whatsnew' }, { type: 'item', label: t('help.about'), action: 'help.about' }, ]}, ], [total, selectedId, selectedIds, ctyRefreshing, refsDownloading, exporting, wkEnabled, dvkEnabled, netEnabled, contestTabEnabled, t]); @@ -2831,6 +2832,7 @@ export default function App() { case 'tools.refreshCty': refreshCtyDat(); break; case 'tools.downloadRefs': downloadRefs(); break; case 'help.about': setShowAbout(true); break; + case 'help.whatsnew': GetChangelog().then((e: any) => { if (Array.isArray(e) && e.length) setWhatsNew(e); else showToast(t('whatsnew.none')); }).catch(() => {}); break; } } diff --git a/frontend/src/lib/i18n.tsx b/frontend/src/lib/i18n.tsx index 46014a6..70af7fd 100644 --- a/frontend/src/lib/i18n.tsx +++ b/frontend/src/lib/i18n.tsx @@ -54,7 +54,7 @@ const en: Dict = { 'btn.logQso': 'Log QSO', 'btn.clear': 'Clear', 'btn.spot': 'Spot', 'btn.saving': '…', // Language chooser 'lang.choose': 'Choose your language', 'lang.chooseHint': 'You can change this later in Settings → General.', - 'lang.english': 'English', 'lang.french': 'Français', 'whatsnew.title': "What's new", 'whatsnew.close': 'Got it', + 'lang.english': 'English', 'lang.french': 'Français', 'whatsnew.title': "What's new", 'whatsnew.close': 'Got it', 'whatsnew.none': 'No changelog available for this version yet.', 'settings.language': 'Language', 'settings.languageHint': 'Interface language.', 'stats.tab': 'Statistics', 'stats.title': 'Logbook statistics', 'stats.loading': 'Crunching the log…', 'stats.noData': 'No data', 'stats.charts': 'Charts', 'stats.table': 'Table', 'stats.refresh': 'Refresh', @@ -368,7 +368,7 @@ const fr: Dict = { 'field.startUtc': 'Début UTC', 'field.endUtc': 'Fin UTC', 'field.snt': 'Env', 'field.rcv': 'Reç', 'btn.logQso': 'Enregistrer', 'btn.clear': 'Effacer', 'btn.spot': 'Spot', 'btn.saving': '…', 'lang.choose': 'Choisissez votre langue', 'lang.chooseHint': 'Modifiable plus tard dans Réglages → Général.', - 'lang.english': 'English', 'lang.french': 'Français', 'whatsnew.title': 'Nouveautés', 'whatsnew.close': 'Compris', + 'lang.english': 'English', 'lang.french': 'Français', 'whatsnew.title': 'Nouveautés', 'whatsnew.close': 'Compris', 'whatsnew.none': 'Aucune nouveauté pour cette version pour le moment.', 'settings.language': 'Langue', 'settings.languageHint': "Langue de l'interface.", 'stats.tab': 'Statistiques', 'stats.title': 'Statistiques du journal', 'stats.loading': 'Analyse du journal…', 'stats.noData': 'Aucune donnée', 'stats.charts': 'Graphiques', 'stats.table': 'Tableau', 'stats.refresh': 'Rafraîchir', diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index 6c62e48..5225b79 100644 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -325,6 +325,8 @@ export function GetCATState():Promise; export function GetCatalogCodes():Promise>; +export function GetChangelog():Promise>; + export function GetChatHistory(arg1:number):Promise>; export function GetClublogCtyInfo():Promise; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 29ebbb1..ed793b9 100644 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -606,6 +606,10 @@ export function GetCatalogCodes() { return window['go']['main']['App']['GetCatalogCodes'](); } +export function GetChangelog() { + return window['go']['main']['App']['GetChangelog'](); +} + export function GetChatHistory(arg1) { return window['go']['main']['App']['GetChatHistory'](arg1); }