refactor: harden type safety and modernize core forms for Svelte 5

- Standardize 'ae_BaseObj' and event types in 'ae_types.ts' to handle nullable fields from V3 API/Dexie.
- Modernize Person, Address, and Contact forms with Svelte 5 Runes and reactive synchronization.
- Refactor Event Settings and its sub-components to use the 'onsave' callback pattern, removing deprecated dispatchers.
- Hardened 'element_data_store_v2' with safe initialization and localStorage caching logic.
- Clean up unused 'element_data_store.svelte' (V1) and suppress Electron environment type errors in 'tmp_shell_handlers.ts'.
- Update documentation and workspace settings to reflect Phase 5 reactive patterns.
This commit is contained in:
Scott Idem
2026-01-28 14:40:20 -05:00
parent bc1d74f817
commit 55773a332d
24 changed files with 31006 additions and 1139 deletions

View File

@@ -19,23 +19,42 @@
// Form State (Runes)
let formData = $state({
attention_to: address?.attention_to ?? '',
organization_name: address?.organization_name ?? '',
line_1: address?.line_1 ?? '',
line_2: address?.line_2 ?? '',
line_3: address?.line_3 ?? '',
city: address?.city ?? '',
state_province: address?.state_province ?? '',
postal_code: address?.postal_code ?? '',
country: address?.country ?? '',
// country_name: address?.country_name ?? '', // DO NOT USE - Scott 2026-01-09
timezone: address?.timezone ?? '',
latitude: address?.latitude ?? '',
longitude: address?.longitude ?? '',
notes: address?.notes ?? '',
enable: address?.enable ?? true,
hide: address?.hide ?? false,
priority: address?.priority ?? false
attention_to: '',
organization_name: '',
line_1: '',
line_2: '',
line_3: '',
city: '',
state_province: '',
postal_code: '',
country: '',
timezone: '',
latitude: '',
longitude: '',
notes: '',
enable: true,
hide: false,
priority: false
});
// Reset form when address prop changes
$effect(() => {
formData.attention_to = address?.attention_to ?? '';
formData.organization_name = address?.organization_name ?? '';
formData.line_1 = address?.line_1 ?? '';
formData.line_2 = address?.line_2 ?? '';
formData.line_3 = address?.line_3 ?? '';
formData.city = address?.city ?? '';
formData.state_province = address?.state_province ?? '';
formData.postal_code = address?.postal_code ?? '';
formData.country = address?.country ?? '';
formData.timezone = address?.timezone ?? '';
formData.latitude = address?.latitude ?? '';
formData.longitude = address?.longitude ?? '';
formData.notes = address?.notes ?? '';
formData.enable = address?.enable ?? true;
formData.hide = address?.hide ?? false;
formData.priority = address?.priority ?? false;
});
let is_loading = $state(false);