refactor(launcher): standardize helper names and apply batch formatting
- Renamed internal 'preventDefault' to 'prevent_default' in launcher files. - Fixed native 'event.preventDefault()' call in launcher_file_cont.svelte. - Applied batch formatting (printWidth: 80) across the (launcher) module.
This commit is contained in:
@@ -43,8 +43,11 @@
|
||||
*/
|
||||
function handle_section_expand(current_key: string) {
|
||||
const launcher = $events_loc.launcher;
|
||||
Object.keys(launcher).forEach(key => {
|
||||
if (key.startsWith('section_state__') && key !== `section_state__${current_key}`) {
|
||||
Object.keys(launcher).forEach((key) => {
|
||||
if (
|
||||
key.startsWith('section_state__') &&
|
||||
key !== `section_state__${current_key}`
|
||||
) {
|
||||
if (launcher[key] === 'auto') {
|
||||
launcher[key] = 'collapsed';
|
||||
}
|
||||
@@ -60,13 +63,18 @@
|
||||
flex flex-col gap-4 items-center justify-start
|
||||
"
|
||||
>
|
||||
<div class="w-full flex flex-row items-center justify-between border-b border-surface-500/20 pb-2">
|
||||
<h2 class="text-center text-lg font-bold text-gray-700 dark:text-gray-200">
|
||||
<div
|
||||
class="w-full flex flex-row items-center justify-between border-b border-surface-500/20 pb-2"
|
||||
>
|
||||
<h2
|
||||
class="text-center text-lg font-bold text-gray-700 dark:text-gray-200"
|
||||
>
|
||||
<span class="fas fa-cog mr-2 opacity-50"></span>
|
||||
Launcher Configuration
|
||||
</h2>
|
||||
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => ($events_loc.launcher.hide_drawer__cfg = true)}
|
||||
class="btn btn-icon dark:text-white hover:bg-surface-500/10 transition-colors"
|
||||
>
|
||||
@@ -77,24 +85,27 @@
|
||||
|
||||
<!-- Category Tabs -->
|
||||
<div class="w-full grid grid-cols-3 gap-1 bg-surface-500/10 p-1 rounded-lg">
|
||||
<button type="button"
|
||||
onclick={() => active_tab = 'system'}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (active_tab = 'system')}
|
||||
class="btn btn-sm text-[10px] uppercase font-bold transition-all"
|
||||
class:preset-filled-primary-500={active_tab === 'system'}
|
||||
class:opacity-50={active_tab !== 'system'}
|
||||
>
|
||||
<span class="fas fa-microchip mr-1"></span> System
|
||||
</button>
|
||||
<button type="button"
|
||||
onclick={() => active_tab = 'sync'}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (active_tab = 'sync')}
|
||||
class="btn btn-sm text-[10px] uppercase font-bold transition-all"
|
||||
class:preset-filled-primary-500={active_tab === 'sync'}
|
||||
class:opacity-50={active_tab !== 'sync'}
|
||||
>
|
||||
<span class="fas fa-sync mr-1"></span> Sync
|
||||
</button>
|
||||
<button type="button"
|
||||
onclick={() => active_tab = 'general'}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (active_tab = 'general')}
|
||||
class="btn btn-sm text-[10px] uppercase font-bold transition-all"
|
||||
class:preset-filled-primary-500={active_tab === 'general'}
|
||||
class:opacity-50={active_tab !== 'general'}
|
||||
@@ -105,16 +116,22 @@
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="w-full flex flex-col gap-2 min-h-[400px]">
|
||||
|
||||
{#if active_tab === 'system'}
|
||||
<div class="animate-in fade-in slide-in-from-left-2 duration-300">
|
||||
{#if $ae_loc.is_native}
|
||||
<Launcher_Cfg_Health on_expand={() => handle_section_expand('health')} />
|
||||
<Launcher_Cfg_Native_OS on_expand={() => handle_section_expand('native_os')} />
|
||||
<Launcher_Cfg_Updates on_expand={() => handle_section_expand('updates')} />
|
||||
<Launcher_Cfg_Health
|
||||
on_expand={() => handle_section_expand('health')}
|
||||
/>
|
||||
<Launcher_Cfg_Native_OS
|
||||
on_expand={() => handle_section_expand('native_os')}
|
||||
/>
|
||||
<Launcher_Cfg_Updates
|
||||
on_expand={() => handle_section_expand('updates')}
|
||||
/>
|
||||
{:else}
|
||||
<div class="card p-8 text-center opacity-50 italic text-sm">
|
||||
Native OS features are only available when running in the Aether Desktop app.
|
||||
Native OS features are only available when running in
|
||||
the Aether Desktop app.
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -122,33 +139,47 @@
|
||||
|
||||
{#if active_tab === 'sync'}
|
||||
<div class="animate-in fade-in slide-in-from-bottom-2 duration-300">
|
||||
<Launcher_Cfg_Sync_Timers on_expand={() => handle_section_expand('sync_timers')} />
|
||||
<Launcher_Cfg_Sync_Timers
|
||||
on_expand={() => handle_section_expand('sync_timers')}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if active_tab === 'general'}
|
||||
<div class="animate-in fade-in slide-in-from-right-2 duration-300">
|
||||
<Launcher_Cfg_Controller on_expand={() => handle_section_expand('controller')} />
|
||||
<Launcher_Cfg_App_Modes on_expand={() => handle_section_expand('app_modes')} />
|
||||
<Launcher_Cfg_Screen_Saver on_expand={() => handle_section_expand('screen_saver')} />
|
||||
<Launcher_Cfg_Local_Actions on_expand={() => handle_section_expand('local_actions')} />
|
||||
<Launcher_Cfg_Controller
|
||||
on_expand={() => handle_section_expand('controller')}
|
||||
/>
|
||||
<Launcher_Cfg_App_Modes
|
||||
on_expand={() => handle_section_expand('app_modes')}
|
||||
/>
|
||||
<Launcher_Cfg_Screen_Saver
|
||||
on_expand={() => handle_section_expand('screen_saver')}
|
||||
/>
|
||||
<Launcher_Cfg_Local_Actions
|
||||
on_expand={() => handle_section_expand('local_actions')}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Global Actions Footer -->
|
||||
<div class="w-full flex flex-col gap-2 border-t border-surface-500/20 pt-4 mt-auto">
|
||||
<div
|
||||
class="w-full flex flex-col gap-2 border-t border-surface-500/20 pt-4 mt-auto"
|
||||
>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<button type="button"
|
||||
onclick={() => ($events_loc.launcher.hide_drawer__debug = false)}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() =>
|
||||
($events_loc.launcher.hide_drawer__debug = false)}
|
||||
class="btn btn-sm preset-tonal-error hover:preset-filled-error-500 transition-all"
|
||||
>
|
||||
<span class="fas fa-bug mr-2"></span>
|
||||
Open Debug
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => location.reload()}
|
||||
class="btn btn-sm preset-tonal-secondary hover:preset-filled-secondary-500 transition-all"
|
||||
>
|
||||
@@ -156,9 +187,11 @@
|
||||
Reload Page
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="text-[9px] text-center opacity-40 uppercase font-bold tracking-widest mt-2">
|
||||
|
||||
<p
|
||||
class="text-[9px] text-center opacity-40 uppercase font-bold tracking-widest mt-2"
|
||||
>
|
||||
Aether Platform • Events Launcher v3.0
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user