Four fixes found while tracing why Manager-saved Config page changes
(QR, POC column, etc.) weren't reliably reaching pres_mgmt_loc:
1. Config page save was a race, not deterministic. The save handler only
called load_ae_obj_id__event() (SWR — returns stale Dexie cache
immediately, refreshes in the background, not awaited) and assumed
that "picked up the new config." It never called
sync_config__event_pres_mgmt() itself. Now calls it directly with the
just-saved draft, so the editing browser updates instantly with no
race. Kept the load_ae_obj_id__event() call (default try_cache: true)
for propagating to other browsers/tabs via Dexie — do not pass
try_cache: false there, that skips the Dexie write entirely.
2. Removed the dead "Lock Config" Sync/Unlink toggle in the sign-in
panel (e_app_access_type.svelte). It wrote to four fields
($ae_loc.lock_config/sync_local_config,
pres_mgmt_loc.current.lock_config/sync_local_config) that are never
read anywhere (confirmed via full-repo grep), and confusingly shared
a name with the real, functional "Lock Config" checkbox on the Pres
Mgmt Config page. Removed the button and the now-orphaned
lock_config/sync_local_config fields from PresMgmtLocState.
3. show__launcher_link was never assigned by sync_config__event_pres_mgmt()
— only its inverse hide__launcher_link was. The toggle button's
`show__launcher_link || trusted_access` visibility gate (in 3 menu
files) always collapsed to trusted-only, ignoring the admin's setting.
Added the missing assignment.
4. AE_PRES_MGMT_LOC_VERSION was bumped to 2 this morning claiming it
"forces a localStorage reset" — it didn't, because _check_and_wipe()
was never wired up for ae_pres_mgmt_loc, and even if it had been, the
store never wrote a __version field to compare. Fixed: the store's
serializer now stamps __version, and store_versions.ts wires the
check. Found and fixed the same bug already live in ae_leads_loc,
except worse there — it was wiping leads users' local prefs on EVERY
page load, not just once.
All logged in PROJECT__AE_Events_PressMgmt_Config_Cleanup.md.
svelte-check: 0 errors, 0 warnings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
runed PersistedState hydrates raw stored JSON without merging defaults, so any
field added after a user's first session is undefined rather than its default value.
Apply a shallow spread (defaults → stored) in the custom serializer for badges,
leads, and pres_mgmt stores so new fields always fall back to defaults for
existing sessions — without disrupting any previously saved preferences.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>