fix(launcher): hidden sessions collapse space, sort by datetime, rename internal-file flag

- menu_session_list: move class:hidden to <li> so fixed-height rows fully collapse
- launcher/+layout.svelte: sort sessions by start_datetime (ascending) instead of name
- Rename hide_content__draft_files → show_content__internal_files (default false);
  remove redundant show_content__draft_files; rename prop hide_draft →
  show_internal_purpose_files in launcher_file_cont; update all 7 call sites and
  the menu_launcher_controls toggle. Now hides admin/draft/outline purpose files
  by default with consistent naming across the flag, prop, and toggle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-20 12:49:39 -04:00
parent 66310adb22
commit c4fdc8efa4
12 changed files with 45 additions and 30 deletions

View File

@@ -26,13 +26,12 @@ export interface LauncherLocState {
hide__ws_form: boolean;
hide__ws_messages: boolean;
hide__ws_commands: boolean;
hide_content__draft_files: boolean;
show_content__disabled_files: boolean;
show_content__hidden_files: boolean;
show_content__hidden_presentations: boolean;
show_content__hidden_presenters: boolean;
show_content__hidden_sessions: boolean;
show_content__draft_files: boolean;
show_content__internal_files: boolean;
show_content__session_code: boolean;
show_content__presentation_code: boolean;
show_content__presenter_code: boolean;
@@ -134,14 +133,12 @@ export const launcher_loc_defaults: LauncherLocState = {
hide__ws_messages: true,
hide__ws_commands: true,
hide_content__draft_files: true,
show_content__disabled_files: false,
show_content__hidden_files: false,
show_content__hidden_presentations: false,
show_content__hidden_presenters: false,
show_content__hidden_sessions: false,
show_content__draft_files: false,
show_content__internal_files: false,
// These should be renamed to match the pres_mgmt section. Use "hide" instead of "show".
show_content__session_code: true,

View File

@@ -16,7 +16,7 @@ let { children }: Props = $props();
// WHY: When running inside Electron (is_native), app_mode must be 'native' for
// the file launch path to work correctly. On a fresh install the persisted store
// has no value set, so we auto-initialise it here. This preserves the three-mode
// has no value set, so we auto-initialize it here. This preserves the three-mode
// design (default / onsite / native) — browser sessions are unaffected because
// is_native is only ever true inside the Electron shell.
$effect(() => {

View File

@@ -298,11 +298,10 @@ let lq__event_session_obj_li = $derived.by(() => {
if (!id) return [];
if (log_lvl > 1)
console.log(`LQ - Event Session list location_id: ${id}`);
// Note: .reverse() before .sortBy() is a no-op — sortBy always re-sorts.
return await db_events.session
.where('event_location_id')
.equals(id)
.sortBy('name');
.sortBy('start_datetime');
});
});

View File

@@ -9,7 +9,7 @@ interface Props {
hide_created_on?: boolean;
hide_os?: boolean;
hide_size?: boolean;
hide_draft?: boolean;
show_internal_purpose_files?: boolean;
show_bak_download?: boolean;
btn_size?: string;
btn_text_align?: string;
@@ -34,7 +34,7 @@ let {
hide_created_on = $bindable(false),
hide_os = $bindable(false),
hide_size = $bindable(false),
hide_draft = $bindable(false),
show_internal_purpose_files = $bindable(false),
show_bak_download = false,
btn_size = $bindable('btn-sm'),
btn_text_align = $bindable('text-left'),
@@ -235,7 +235,7 @@ function prevent_default<T extends Event>(fn: (event: T) => void) {
<div
class:justify-between={!hide_meta}
class:justify-center={hide_meta}
class:hidden={hide_draft &&
class:hidden={!show_internal_purpose_files &&
(event_file_obj.file_purpose == 'outline' ||
event_file_obj.file_purpose == 'draft' ||
event_file_obj.file_purpose == 'admin')}
@@ -386,16 +386,28 @@ function prevent_default<T extends Event>(fn: (event: T) => void) {
});
}}
class="btn btn-sm group transition-all"
class:preset-tonal-success={event_file_obj?.open_in_os == 'win'}
class:preset-tonal-warning={event_file_obj?.open_in_os == 'mac'}
disabled={!$ae_loc.trusted_access}>
{#if event_file_obj?.open_in_os == 'win'}<Monitor
class:preset-tonal-warning={event_file_obj?.open_in_os == 'win'}
class:preset-tonal-success={event_file_obj?.open_in_os == 'mac'}
disabled={!$ae_loc.trusted_access}
title={`Open in OS: ${
event_file_obj?.open_in_os
? event_file_obj.open_in_os.toUpperCase()
: 'None'
}`}
>
{#if event_file_obj?.open_in_os == 'win'}
<!-- <Monitor
size="1em"
class="m-1" />
{:else if event_file_obj?.open_in_os == 'mac'}<Laptop
class="m-1" /> -->
Win
{:else if event_file_obj?.open_in_os == 'mac'}
<!-- <Laptop
size="1em"
class="m-1" />
{:else}<FolderOpen size="1em" class="m-1" />{/if}
class="m-1" /> -->
Mac
{:else}
<FolderOpen size="1em" class="m-1" />
{/if}
</button>
<span

View File

@@ -171,6 +171,7 @@ let ae_promises: key_val = $state({
hide_created_on={true}
hide_os={true}
hide_size={true}
show_internal_purpose_files={$events_loc.launcher.show_content__internal_files}
show_bak_download={$ae_loc.trusted_access &&
$ae_loc.edit_mode}
btn_size={'btn-sm'}
@@ -213,6 +214,7 @@ let ae_promises: key_val = $state({
hide_created_on={true}
hide_os={true}
hide_size={true}
show_internal_purpose_files={$events_loc.launcher.show_content__internal_files}
show_bak_download={$ae_loc.trusted_access &&
$ae_loc.edit_mode}
btn_size={'btn-sm'}

View File

@@ -67,8 +67,8 @@ let lq__event_file_obj_li = $derived(
{event_file_obj}
hide_created_on={false}
hide_meta={session_type == 'poster'}
bind:hide_draft={
$events_loc.launcher.hide_content__draft_files
bind:show_internal_purpose_files={
$events_loc.launcher.show_content__internal_files
}
show_bak_download={$ae_loc.trusted_access}
session_type={session_type || 'oral'}

View File

@@ -96,8 +96,8 @@ let lq__event_file_obj_li = $derived(
event_file_id={event_file_obj.event_file_id}
{event_file_obj}
hide_created_on={false}
bind:hide_draft={
$events_loc.launcher.hide_content__draft_files
bind:show_internal_purpose_files={
$events_loc.launcher.show_content__internal_files
}
show_bak_download={$ae_loc.trusted_access}
session_type={session_type || 'oral'}

View File

@@ -91,6 +91,7 @@ let lq__event_file_obj_li = $derived(
{event_file_obj}
hide_created_on={false}
hide_meta={true}
show_internal_purpose_files={$events_loc.launcher.show_content__internal_files}
show_bak_download={$ae_loc.trusted_access}
session_type="poster"
open_method="modal"

View File

@@ -306,6 +306,8 @@ let ae_promises: key_val = $state({});
event_file_id={event_file_obj.event_file_id}
{event_file_obj}
hide_created_on={true}
show_internal_purpose_files={$events_loc.launcher
.show_content__internal_files}
show_bak_download={$ae_loc.trusted_access &&
$ae_loc.edit_mode}
session_type={type_code || 'oral'}

View File

@@ -149,6 +149,8 @@ let poster_count = $derived($lq__event_presentation_obj_li?.length ?? 0);
event_file_id={event_file_obj.event_file_id}
{event_file_obj}
hide_created_on={true}
show_internal_purpose_files={$events_loc.launcher
.show_content__internal_files}
show_bak_download={$ae_loc.trusted_access &&
$ae_loc.edit_mode}
session_type="poster"

View File

@@ -40,10 +40,10 @@ let { log_lvl = $bindable(0) }: Props = $props();
onclick={() => {
if ($events_loc.launcher.show_content__hidden_files) {
$events_loc.launcher.show_content__hidden_files = false;
$events_loc.launcher.hide_content__draft_files = true;
$events_loc.launcher.show_content__internal_files = false;
} else {
$events_loc.launcher.show_content__hidden_files = true;
$events_loc.launcher.hide_content__draft_files = false;
$events_loc.launcher.show_content__internal_files = true;
}
}}
class="

View File

@@ -252,7 +252,11 @@ function handle_load_ae_obj_id__event_session(event_session_id: any) {
max-w-full p-0
"
class:session-active={slct__event_session_id ===
event_session_obj?.id}>
event_session_obj?.id}
class:hidden={!$events_loc.launcher
.show_content__hidden_sessions &&
(event_session_obj?.hide ||
event_session_obj?.hide_event_launcher)}>
<button
type="button"
onmouseenter={() => {
@@ -302,10 +306,6 @@ function handle_load_ae_obj_id__event_session(event_session_id: any) {
event_session_obj?.id}
class:font-bold={slct__event_session_id ===
event_session_obj?.id}
class:hidden={!$events_loc.launcher
.show_content__hidden_sessions &&
(event_session_obj?.hide ||
event_session_obj?.hide_event_launcher)}
class:opacity-40={event_session_obj?.hide ||
event_session_obj?.hide_event_launcher}
title={`Session: ${event_session_obj?.name}\nID: ${event_session_obj?.id} | ${ae_util.iso_datetime_formatter(event_session_obj?.start_datetime, $events_loc.launcher.time_format)}`}>