diff --git a/src/lib/app_components/e_app_sys_bar.svelte b/src/lib/app_components/e_app_sys_bar.svelte
index 2e27455c..4b960b21 100644
--- a/src/lib/app_components/e_app_sys_bar.svelte
+++ b/src/lib/app_components/e_app_sys_bar.svelte
@@ -593,73 +593,79 @@ const theme_options = [
dark:border-gray-700/60 dark:bg-gray-900/30
"
class:border-primary-400={expand}>
-
-
+ {/if}
+
+
+ {#if !$ae_loc?.iframe}
+
+ {#if $ae_loc?.theme_mode === 'dark'}
+
+ Dark
+ {:else}
+
+ Light
+ {/if}
+
+ {/if}
{#if $ae_loc?.authenticated_access}
diff --git a/src/routes/idaa/+layout.svelte b/src/routes/idaa/+layout.svelte
index 7157a037..a370383e 100644
--- a/src/routes/idaa/+layout.svelte
+++ b/src/routes/idaa/+layout.svelte
@@ -218,13 +218,15 @@ $effect(() => {
// the iframe src to pass show_menu=true, so we watch for trusted_access and unhide it.
$effect(() => {
if (browser && $ae_loc.iframe && $ae_loc.trusted_access) {
- // WHY untrack: writing to $ae_loc inside an effect that reads $ae_loc causes
- // an infinite reactive loop (effect_update_depth_exceeded). The conditions we
- // want to react to ($ae_loc.iframe / trusted_access) are tracked above; the
- // write is a side-effect that must not re-trigger this effect.
- untrack(() => {
+ // WHY the guard: ae_loc is a tracked dep here (reads above). Writing
+ // $ae_loc.sys_menu.hide re-notifies this effect every run — infinite loop.
+ // untrack() does NOT help: it prevents new dep reads but the store still
+ // notifies already-subscribed effects after the write.
+ // The idempotent write guard breaks the cycle: run 2 finds the value
+ // already false, skips the write, no further re-queue.
+ if ($ae_loc.sys_menu.hide !== false) {
$ae_loc.sys_menu.hide = false;
- });
+ }
}
});