fix(launcher): restore open_in_os win routing, fix cfg_json in IDB, fix display state
open_in_os = 'win': get_launch_profile() now maps pptx→pptxwin, ppt→pptwin, odp→odpwin, pdf→pdfwin when open_in_os is 'win', routing to the Windows-variant launch profiles (Parallels/CrossOver). Was never wired in native mode — feature was silently lost in the MasterKey→Launcher port. cfg_json missing from properties_to_save: the per-file display override was always read as undefined from Dexie because cfg_json was never saved. Added cfg_json to properties_to_save so display_override and any other cfg fields persist correctly. NOTE: IDB_CONTENT_VERSIONS for event_file is not yet wired; existing devices need a manual cache clear to pick up the new field. Display override button: removed $ae_loc.is_native gate — must be configurable from any device ahead of the event, not only on the podium Mac. Display toggle persistence: quick_display_mode now reads from and writes to $events_loc.launcher.display_mode so the last-set state survives page reloads instead of always defaulting to 'extend'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -539,6 +539,7 @@ export const properties_to_save = [
|
|||||||
'filename',
|
'filename',
|
||||||
'extension',
|
'extension',
|
||||||
'open_in_os',
|
'open_in_os',
|
||||||
|
'cfg_json',
|
||||||
'lu_file_purpose_id',
|
'lu_file_purpose_id',
|
||||||
'lu_event_file_purpose_name',
|
'lu_event_file_purpose_name',
|
||||||
'file_purpose',
|
'file_purpose',
|
||||||
|
|||||||
@@ -136,8 +136,22 @@ function get_launch_profile(
|
|||||||
null;
|
null;
|
||||||
const local_profiles = ($events_loc as any).launcher?.launch_profiles ?? null;
|
const local_profiles = ($events_loc as any).launcher?.launch_profiles ?? null;
|
||||||
const display_override = file_obj?.cfg_json?.display_override ?? null;
|
const display_override = file_obj?.cfg_json?.display_override ?? null;
|
||||||
|
|
||||||
|
// open_in_os = 'win' routes to the Windows-variant profile for apps that have one.
|
||||||
|
// These profiles target Windows PowerPoint / LibreOffice / Acrobat running via Parallels or CrossOver.
|
||||||
|
const WIN_EXTENSION_MAP: Record<string, string> = {
|
||||||
|
pptx: 'pptxwin',
|
||||||
|
ppt: 'pptwin',
|
||||||
|
odp: 'odpwin',
|
||||||
|
pdf: 'pdfwin'
|
||||||
|
};
|
||||||
|
const effective_extension =
|
||||||
|
file_obj?.open_in_os === 'win'
|
||||||
|
? (WIN_EXTENSION_MAP[extension] ?? extension)
|
||||||
|
: extension;
|
||||||
|
|
||||||
return resolve_launch_profile(
|
return resolve_launch_profile(
|
||||||
extension,
|
effective_extension,
|
||||||
display_override,
|
display_override,
|
||||||
device_profiles,
|
device_profiles,
|
||||||
local_profiles
|
local_profiles
|
||||||
@@ -714,10 +728,11 @@ function prevent_default<T extends Event>(fn: (event: T) => void) {
|
|||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#if $ae_loc.trusted_access && $ae_loc.is_native}
|
{#if $ae_loc.trusted_access}
|
||||||
<!-- Display override: per-file display_mode override for this file only.
|
<!-- Display override: per-file display_mode override for this file only.
|
||||||
null = use profile default, 'extend' = force extend, 'mirror' = force mirror.
|
null = use profile default, 'extend' = force extend, 'mirror' = force mirror.
|
||||||
Stored in event_file.cfg_json.display_override. Cycles null → extend → mirror → null. -->
|
Stored in event_file.cfg_json.display_override. Cycles null → extend → mirror → null.
|
||||||
|
Settable from any device — takes effect when the file is opened in native mode. -->
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ interface Props {
|
|||||||
|
|
||||||
let { log_lvl = $bindable(0) }: Props = $props();
|
let { log_lvl = $bindable(0) }: Props = $props();
|
||||||
|
|
||||||
let quick_display_mode = $state<'extend' | 'mirror'>('extend');
|
// Persist display mode across reloads — reflects the last-set state, not hardware-queried state.
|
||||||
|
let quick_display_mode = $state<'extend' | 'mirror'>(
|
||||||
|
($events_loc.launcher as any)?.display_mode ?? 'extend'
|
||||||
|
);
|
||||||
|
|
||||||
const is_native_launcher_mode = $derived(
|
const is_native_launcher_mode = $derived(
|
||||||
!!$ae_loc.is_native && $events_loc.launcher.app_mode === 'native'
|
!!$ae_loc.is_native && $events_loc.launcher.app_mode === 'native'
|
||||||
@@ -40,9 +43,13 @@ async function toggle_display_mode() {
|
|||||||
const next = quick_display_mode === 'extend' ? 'mirror' : 'extend';
|
const next = quick_display_mode === 'extend' ? 'mirror' : 'extend';
|
||||||
if (is_native_launcher_mode) {
|
if (is_native_launcher_mode) {
|
||||||
const res = await native.set_display_layout({ mode: next });
|
const res = await native.set_display_layout({ mode: next });
|
||||||
if (res?.success) quick_display_mode = next;
|
if (res?.success) {
|
||||||
|
quick_display_mode = next;
|
||||||
|
($events_loc.launcher as any).display_mode = next;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
quick_display_mode = next;
|
quick_display_mode = next;
|
||||||
|
($events_loc.launcher as any).display_mode = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user