Slowly updating things to Data Store v3. Also doing some safe code clean up. Mainly removing commented out code.

This commit is contained in:
Scott Idem
2026-01-29 12:21:47 -05:00
parent 917c8f3e37
commit 9bf2373a82
10 changed files with 19 additions and 119 deletions

View File

@@ -13,7 +13,7 @@
// *** Import Aether specific variables and functions
import type { key_val } from '$lib/stores/ae_stores';
import { ae_loc, ae_sess, ae_api, slct } from '$lib/stores/ae_stores';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import {
events_loc,
events_sess,
@@ -223,7 +223,10 @@
<abbr title="Aether - Events Module"> Æ Events </abbr>
</span>
{#if !$ae_sess?.disable_sys_header}
<Element_data_store ds_code="hub__site__appshell_header" ds_type="html" />
<Element_data_store
ds_code="hub__site__appshell_header"
ds_type="html"
/>
{/if}
<a
href="/"

View File

@@ -7,12 +7,10 @@
let { data }: Props = $props();
let log_lvl: number = $state(0);
// console.log(`ae_events_pres_mgmt location [slug] +page.svelte data:`, data);
// Imports
// import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
// let ae_promises: key_val = {};
// let ae_tmp: key_val = {};
@@ -53,21 +51,14 @@
}
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
// $slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
// console.log(`ae_acct = `, ae_acct);
$ae_loc.url_origin = data.url.origin;
$events_slct.event_id = ae_acct.slct.event_id;
// $events_slct.event_obj = ae_acct.slct.event_obj;
$events_slct.event_location_id = ae_acct.slct.event_location_id;
// $events_slct.event_location_obj = ae_acct.slct.event_location_obj;
$events_slct.event_session_id = null;
// $events_slct.event_session_obj = null;
$events_slct.event_session_obj_li = ae_acct.slct.event_session_obj_li;
// $events_slct.event_file_obj_li = ae_acct.slct.event_file_obj_li;
if (!$events_loc.pres_mgmt) {
$events_loc.pres_mgmt = {};

View File

@@ -29,7 +29,7 @@
import { events_func } from '$lib/ae_events_functions';
import Element_ae_crud from '$lib/elements/element_ae_crud.svelte';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import Comp__events_menu_nav from '../../../../ae_comp__events_menu_nav.svelte';
let ae_tmp: key_val = $state({});

View File

@@ -14,7 +14,7 @@
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
let ae_promises: key_val = {};
let ae_tmp: key_val = {};

View File

@@ -6,7 +6,6 @@
// import { browser } from '$app/environment';
// *** Import other supporting libraries
// import * as icons from '@lucide/svelte';
import { Brain, House, Library, RefreshCw, Satellite } from '@lucide/svelte';
// *** Import Aether specific variables and functions
@@ -21,8 +20,7 @@
slct,
slct_trigger
} from '$lib/stores/ae_stores';
// import { core_func } from '$lib/ae_core/ae_core_functions';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
// import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
interface Props {
/** @type {import('./$types').LayoutData} */

View File

@@ -41,8 +41,6 @@
import Archive_obj_id_edit from './ae_idaa_comp__archive_obj_id_edit.svelte';
import Archive_view from './ae_idaa_comp__archive_obj_id_view.svelte';
// import Archive_page_menu from './session_page_menu.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
import Archive_content_obj_li from './ae_idaa_comp__archive_content_obj_li.svelte';
import Archive_content_obj_id_edit from './ae_idaa_comp__archive_content_obj_id_edit.svelte';
@@ -54,17 +52,6 @@
// let ae_tmp: key_val = {};
// let ae_triggers: key_val = {};
// Variables
// let archive_content_id = page.url.searchParams.get('archive_content_id') ?? null;
// if (!archive_content_id) {
// $idaa_slct.archive_content_id = null;
// } else {
// console.log(`ae Archives - [archive_content_id] +page.ts: archive_content_id = `, archive_content_id);
// $idaa_slct.archive_content_id = archive_content_id;
// $idaa_trig.archive_content_id = archive_content_id;
// }
// *** Quickly pull out data from parent(s)
let ae_acct = data[$slct.account_id];
if (log_lvl) {

View File

@@ -26,14 +26,14 @@
} from '$lib/stores/ae_stores';
import { events_func } from '$lib/ae_events_functions';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import Comp__event_obj_qry from './ae_idaa_comp__event_obj_qry.svelte';
import Comp__event_obj_li_wrapper from './ae_idaa_comp__event_obj_li_wrapper.svelte';
if (browser) {
$idaa_slct.event_id = null;
window.parent.postMessage({ event_id: null }, '*');
// Use versioning instead of boolean to avoid loops
if ($idaa_loc.recovery_meetings.search_version === undefined) {
$idaa_loc.recovery_meetings.search_version = 0;
@@ -79,16 +79,16 @@
const current_search_id = ++last_search_id;
const account_id = $ae_loc.account_id;
const remote_first = $idaa_loc.recovery_meetings.qry__remote_first;
if (log_lvl) console.log(`[Search #${current_search_id}] Refreshing recovery meetings (remote_first=${remote_first}) for account: ${account_id}...`);
$idaa_sess.recovery_meetings.qry__status = 'loading';
// If remote first, clear immediately to show fresh state
if (remote_first) {
event_id_random_li = [];
}
// Snapshot current params to ensure Fast Path matches revalidation
const qry_str = ($idaa_loc.recovery_meetings.qry__fulltext_str ?? '').toLowerCase().trim();
const qry_physical = $idaa_loc.recovery_meetings.qry__physical;
@@ -141,7 +141,7 @@
if (current_search_id === last_search_id) {
if (log_lvl) console.log(`[Search #${current_search_id}] Fast Path complete. Found ${local_ids.length} items locally.`);
event_id_random_li = local_ids;
// If we found results locally, we can mark as done to stop spinning,
// If we found results locally, we can mark as done to stop spinning,
// revalidation will still finish in background
if (local_ids.length > 0) {
$idaa_sess.recovery_meetings.qry__status = 'done';
@@ -174,7 +174,7 @@
if (current_search_id === last_search_id) {
const api_results = results || [];
const api_ids = api_results.map((e: any) => e.id || e.event_id_random).filter(Boolean);
// If API returns 0 but local search found broad results, protect the UI
if (api_ids.length === 0 && local_ids.length > 0 && !remote_first && !qry_str) {
if (log_lvl) console.warn(`[Search #${current_search_id}] Revalidation returned 0. Preserving cache.`);

View File

@@ -20,14 +20,7 @@
} from '$lib/stores/ae_stores';
import { core_func } from '$lib/ae_core/ae_core_functions';
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/stores/ae_idaa_stores';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
// const modalRegistry: Record<string, ModalComponent> = {
// // Set a unique modal ID, then pass the component reference
// // modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj },
// // modalComponentTwo: { ref: ModalComponentTwo },
// // ...
// };
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
interface Props {
/** @type {import('./$types').LayoutData} */
@@ -37,13 +30,6 @@
let { data, children }: Props = $props();
// if (browser) {
// add_activity_log({
// action: 'idaa_root_layout',
// action_with: 'browser'
// });
// }
function add_activity_log({
action = 'idaa_root_layout',
action_with = 'none'
@@ -179,15 +165,6 @@
// });
});
// if (browser) {
// $idaa_loc.novi_uuid = data.params.uuid;
// $idaa_loc.novi_email = decodeURIComponent(data.params.email);
// $idaa_loc.novi_full_name = decodeURIComponent(data.params.full_name);
// // $idaa_loc.novi_admin_li = novi_admin_li;
// // $idaa_loc.novi_trusted_li = novi_trusted_li;
// console.log(`$idaa_loc.novi_uuid:`, $idaa_loc.novi_uuid);
// }
let iframe = data.url.searchParams.get('iframe');
if (browser && iframe == 'true') {
console.log('Use iframe layout!');

View File

@@ -16,7 +16,7 @@
journals_slct,
journals_trig
} from '$lib/ae_journals/ae_journals_stores';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import Help_tech from '$lib/app_components/e_app_help_tech.svelte';
// *** Setup Svelte properties

View File

@@ -30,12 +30,9 @@
journals_prom,
journals_trig
} from '$lib/ae_journals/ae_journals_stores';
// import { journals_func } from '$lib/ae_journals/ae_journals_functions';
// import Journal_entry_obj_id_edit from './ae_journals_comp__journal_entry_obj_id_edit.svelte';
import Journal_entry_view from './../../../ae_comp__journal_entry_obj_id_view.svelte';
// import Journal_page_menu from './session_page_menu.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
// import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import AeCompModalJournalExport from '../../../ae_comp__modal_journal_export.svelte';
interface Props {
@@ -183,59 +180,6 @@
}
});
// $effect(() => {
// if (browser && $lq__journal_entry_obj?.journal_entry_id) {
// // $journals_loc.entry_view_history_li = [...new Set($journals_loc.entry_view_history_li)]
// let tmp_history_li = [
// ...new Set($journals_loc?.entry_view_history_li ?? [])
// ];
// // Limit to last 15 entries
// if (tmp_history_li.length > 15) {
// tmp_history_li = tmp_history_li.slice(tmp_history_li.length - 15);
// }
// // let chk_history_li = tmp_history_li?.filter(item => item.id === $lq__journal_entry_obj?.journal_entry_id);
// // if (chk_history_li?.length) {
// // // Already in history, do not add again
// // console.log(`Entry ID = ${$lq__journal_entry_obj?.journal_entry_id} already in history, not adding again.`, tmp_history_li);
// // // if (tmp_history_li !== $journals_loc.entry_view_history_li) {
// // if (JSON.stringify(tmp_history_li) !== JSON.stringify($journals_loc.entry_view_history_li)) {
// // $journals_loc.entry_view_history_li = tmp_history_li;
// // console.log(`$journals_loc.entry_view_history_li = `, $journals_loc.entry_view_history_li);
// // }
// // return;
// // }
// tmp_history_li.push({
// id: $lq__journal_entry_obj?.journal_entry_id ?? 'NONE',
// name: $lq__journal_entry_obj?.name ?? ae_util.iso_datetime_formatter($lq__journal_entry_obj?.created_on, 'datetime_iso_12_no_seconds'),
// url: `/journals/${$lq__journal_entry_obj?.journal_id ?? 'NONE'}/entry/${$lq__journal_entry_obj?.journal_entry_id ?? 'NONE'}`,
// });
// // Remove duplicates and keep most recent
// tmp_history_li = [...new Set(tmp_history_li.map(item => JSON.stringify(item)))].map(item => JSON.parse(item));
// // Limit to last 15 entries
// if (tmp_history_li.length > 15) {
// tmp_history_li = tmp_history_li.slice(tmp_history_li.length - 15);
// }
// if (JSON.stringify(tmp_history_li) !== JSON.stringify($journals_loc?.entry_view_history_li)) {
// $journals_loc.entry_view_history_li = tmp_history_li;
// console.log(`$journals_loc.entry_view_history_li = `, $journals_loc?.entry_view_history_li);
// }
// console.log(`$journals_loc.entry_view_history_li = `, $journals_loc?.entry_view_history_li);
// }
// });
$effect(() => {
if (browser && $lq__journal_entry_obj?.journal_entry_id) {