Fix: Restore Native caching business logic and implement 3-mode launcher

- Implemented Default, Onsite, and Native launcher modes in launcher_file_cont.svelte.
- Restored background pre-caching logic with configurable timers in new LauncherBackgroundSync component.
- Fixed standard browser download regression for regular website mode.
- Modernized electron_relay to TypeScript and standardized bridge detection in layout.
- Detailed startup and background sync technical flow in documentation.
This commit is contained in:
Scott Idem
2026-01-23 15:17:50 -05:00
parent 20b41ebaef
commit 683ea0394d
11 changed files with 558 additions and 961 deletions

View File

@@ -22,6 +22,10 @@
events_trigger,
events_trig
} from '$lib/stores/ae_events_stores';
import * as native from '$lib/electron/electron_relay';
let test_cmd_result = $state('');
</script>
<div
@@ -44,6 +48,76 @@
</button>
</div>
<!-- Native OS Handlers Section -->
{#if $ae_loc.is_native}
<section
class:preset-outlined-warning-300-700={$events_loc.launcher.show_section__native_os}
class="native_os w-full preset-outlined-surface-300-700 transition-all mb-2"
>
<h3 class="text-center mb-2 text-sm font-semibold w-full">
<button
onclick={() => {
$events_loc.launcher.show_section__native_os =
!$events_loc.launcher.show_section__native_os;
}}
class="btn btn-sm w-full justify-between"
>
<span>
{#if $events_loc.launcher.show_section__native_os}
<span class="fas fa-chevron-down"></span>
{:else}
<span class="fas fa-chevron-right"></span>
{/if}
Native OS Folders
</span>
<span class="badge variant-filled-success">Active</span>
</button>
</h3>
<div
class="flex flex-col gap-2 p-2 items-center justify-start w-full"
class:hidden={!$events_loc.launcher.show_section__native_os}
>
<div class="grid grid-cols-1 gap-2 w-full">
<button
onclick={() => native.open_folder($ae_loc.local_file_cache_path)}
class="btn btn-sm preset-tonal-primary hover:preset-filled-primary-500 justify-start"
>
<span class="fas fa-folder-open mr-2"></span> Open Local Cache
</button>
<button
onclick={() => native.open_folder($ae_loc.host_file_temp_path)}
class="btn btn-sm preset-tonal-primary hover:preset-filled-primary-500 justify-start"
>
<span class="fas fa-folder-open mr-2"></span> Open Host Temp
</button>
<button
onclick={() => native.open_folder($ae_loc.recording_path)}
class="btn btn-sm preset-tonal-primary hover:preset-filled-primary-500 justify-start"
>
<span class="fas fa-folder-open mr-2"></span> Open Recording Path
</button>
</div>
<div class="w-full border-t border-surface-500/30 pt-2 mt-2">
<button
onclick={async () => {
test_cmd_result = 'Running...';
const res = await native.run_cmd({ cmd: 'whoami && uptime', return_stdout: true });
test_cmd_result = res as string;
}}
class="btn btn-sm variant-soft-secondary w-full"
>
<span class="fas fa-terminal mr-2"></span> Test OS Command
</button>
{#if test_cmd_result}
<pre class="text-[10px] bg-black text-green-500 p-1 mt-1 overflow-x-auto rounded w-full">{test_cmd_result}</pre>
{/if}
</div>
</div>
</section>
{/if}
<!-- <hr class="w-full my-2 border-1 border-gray-200 dark:border-gray-800 " /> -->
<section