fix(settings): button bar layout never persisted due to slash in AppSettings key (#3358)#3409
Conversation
…ettings key (aethersdr#3358) ButtonBar/Layout, ButtonBar/DrawerOpen, and ButtonBar/Favorites all contain a slash. AppSettings::save() silently drops any key not matching ^[A-Za-z_][A-Za-z0-9_]*$ — the validator was tightened in aethersdr#985 to prevent invalid XML element names. The customisable button bar shipped in aethersdr#3150 after that tightening, so its layout, drawer state, and favourites have never round-tripped to disk for any user. Fix: rename the three keys to ButtonBarLayout, ButtonBarDrawerOpen, ButtonBarFavorites. No migration needed — nothing was ever written to the old keys so there is no on-disk state to convert. Verified locally: confirmed ButtonBarLayout and ButtonBarDrawerOpen are present in AetherSDR.settings after the fix; previously they were absent (silently discarded on every save). Fixes aethersdr#3358
There was a problem hiding this comment.
Thanks for the careful diagnosis and clean fix, @M7HNF-Ian.
Verified
src/core/AppSettings.cpp:209does enforce^[A-Za-z_][A-Za-z0-9_]*$and silently drops non-conforming keys (only aqWarningis emitted, line 212). Your description is exactly right.- Grepped for other slashed
AppSettingskeys — these three are the only offenders, and all five call-sites are covered (AppletPanel.cpp:892,:1372,:1391,:1399,:1420). - The "no migration needed" reasoning is sound: since
save()drops invalid keys before they reach disk, no user can haveButtonBar/Layout(etc.) in their settings file — there is nothing to convert. - Scope is appropriately surgical: single file, behavior-preserving rename.
One small observation (non-blocking)
After this rename, the legacy-favourites migration block at AppletPanel.cpp:1389-1402 (ButtonBarFavorites → ButtonBarLayout) is dead code for the same reason your fix is needed: that key also contained a slash in its previous life, so no user has it on disk either. It's harmless to keep as a defensive no-op, but a follow-up to delete it would tighten the file. Up to you / the maintainers — not worth gating this PR.
LGTM as a clean root-cause fix for #3358.
🤖 aethersdr-agent · cost: $8.0788 · model: claude-opus-4-7
NF0T
left a comment
There was a problem hiding this comment.
Clean root-cause fix, @M7HNF-Ian. Traced the validator at AppSettings.cpp:209 — ^[A-Za-z_][A-Za-z0-9_]*$ confirmed, and your "no migration needed" reasoning is exactly right: since save() silently drops slash-containing keys before they reach disk, no user has ever had ButtonBar/Layout or its siblings written to their settings file. Nothing to convert.
Verified all 6 call sites against the PR commit — zero remaining slash-keys in AppletPanel.cpp. The dead migration block at line 1386 is a harmless pre-existing no-op for the same reason; leaving it is the right call for this PR.
All 5 CI checks green.
73,
Ryan NF0T
…ettings key (aethersdr#3358) (aethersdr#3409) ## Problem \`ButtonBar/Layout\`, \`ButtonBar/DrawerOpen\`, and \`ButtonBar/Favorites\` all contain a \`/\`. \`AppSettings::save()\` silently drops any key not matching \`^[A-Za-z_][A-Za-z0-9_]*$\` — the validator was tightened in aethersdr#985 to prevent invalid XML element names. The customisable button bar shipped in aethersdr#3150 *after* that tightening, so its layout, drawer state, and favourites have **never round-tripped to disk for any user**. ## Fix Rename the three keys to \`ButtonBarLayout\`, \`ButtonBarDrawerOpen\`, \`ButtonBarFavorites\`. No migration needed — nothing was ever written to the old slash-containing keys, so there is no on-disk state to convert. ## Testing Verified locally on macOS (Apple Silicon, dev build off \`main\`): - Before fix: \`ButtonBar/Layout\` and \`ButtonBar/DrawerOpen\` absent from \`AetherSDR.settings\` after every save (silently discarded) - After fix: \`ButtonBarLayout\` and \`ButtonBarDrawerOpen\` present in \`AetherSDR.settings\` with correct JSON values - Button bar order and drawer state survive app restart Fixes aethersdr#3358
Problem
`ButtonBar/Layout`, `ButtonBar/DrawerOpen`, and `ButtonBar/Favorites` all contain a `/`. `AppSettings::save()` silently drops any key not matching `^[A-Za-z_][A-Za-z0-9_]*$` — the validator was tightened in #985 to prevent invalid XML element names. The customisable button bar shipped in #3150 after that tightening, so its layout, drawer state, and favourites have never round-tripped to disk for any user.
Fix
Rename the three keys to `ButtonBarLayout`, `ButtonBarDrawerOpen`, `ButtonBarFavorites`. No migration needed — nothing was ever written to the old slash-containing keys, so there is no on-disk state to convert.
Testing
Verified locally on macOS (Apple Silicon, dev build off `main`):
Fixes #3358