feat(frontend): implement string-only ID standardization and native data cleaning

Update layout.ts to clean raw data from the native bridge. Initialize events_slct.event_device_id in launcher layout. Resort device_id prioritization in launcher_background_sync.svelte.
This commit is contained in:
Scott Idem
2026-01-30 12:38:13 -05:00
parent 7a8871c51f
commit 5a2eaa8fac
4 changed files with 18 additions and 2 deletions

View File

@@ -25,7 +25,11 @@ This is a list of tasks to be completed before the next event/show/conference.
- [x] **Search Guard Pattern:** Deployed across all major search modules to eliminate infinite loops.
- [x] **Shared Observables:** Refactored lists to accept `liveQuery` props for flicker-free SWR transitions.
- [x] **Store Initialization:** Hardened persisted stores against `undefined` reactivity triggers.
2. **Native Launcher Refinement (Phase 5):**
2. **String-Only ID Standardization:**
- [ ] Audit and resort ID prioritization logic across all `.ts` and `.svelte` files.
- [ ] Preferred Order: `[obj_type]_id` || `id` || `[obj_type]_id_random` || `id_random`.
- [ ] Ensure `+layout.ts` cleans incoming raw data from the native bridge.
3. **Native Launcher Refinement (Phase 5):**
- [x] **Office Automation:** Implemented AppleScript handlers for PowerPoint/Keynote.
- [x] **Telemetry Dashboard:** Built visual CPU/RAM gauges in Launcher Config.
3. **Codebase Consistency:**

View File

@@ -160,6 +160,11 @@ export async function load({ fetch, params, parent, route, url }) {
// Inject native device metadata into the location state with SAFE MERGE
if (native_device_config.native_device) {
const incoming_dev = native_device_config.native_device;
// String-Only ID Vision: Ensure semantic fields use the random string ID
if (incoming_dev.event_device_id_random) incoming_dev.event_device_id = incoming_dev.event_device_id_random;
if (incoming_dev.event_id_random) incoming_dev.event_id = incoming_dev.event_id_random;
if (incoming_dev.id_random) incoming_dev.id = incoming_dev.id_random;
// 1. Recover existing user overrides from localStorage
let existing_dev = {};

View File

@@ -108,6 +108,12 @@
$events_slct.event_location_id = data.params.event_location_id;
$events_slct.event_session_id = data.url.searchParams.get('session_id');
// String-Only ID Vision: Sync the device ID from the native environment
const native_dev = $ae_loc.native_device;
if (native_dev) {
$events_slct.event_device_id = native_dev.event_device_id || native_dev.id || native_dev.event_device_id_random || native_dev.id_random;
}
// console.log(`ae_acct.slct.event_id:`, ae_acct.slct.event_id);
// $events_slct.event_id = ae_acct.slct.event_id;
// $events_slct.event_obj = ae_acct.slct.event_obj;

View File

@@ -163,7 +163,8 @@
*/
async function run_device_heartbeat() {
const dev = $ae_loc.native_device;
const device_id = dev?.event_device_id || dev?.id_random || dev?.event_device_id_random || dev?.id;
// String-Only ID Vision: Prioritize semantic string IDs, then generic, then legacy random strings
const device_id = dev?.event_device_id || dev?.id || dev?.event_device_id_random || dev?.id_random;
if (!device_id) {
if (log_lvl) console.warn('Sync: Heartbeat skipped, no device_id found in $ae_loc.native_device.');