refactor(launcher): use launch_profiles only\n\nRemove the temporary launch_scripts compatibility alias and keep the launcher
configuration surface focused on launch_profiles everywhere in the Svelte app and docs.
This commit is contained in:
@@ -316,7 +316,6 @@ per file extension via `event_device.data_json.launch_profiles` (device-level co
|
|||||||
`event.launcher.launch_profiles` (event-level fallback). Templates use `{{path}}` as the
|
`event.launcher.launch_profiles` (event-level fallback). Templates use `{{path}}` as the
|
||||||
file path placeholder; AppleScript or `shell:` prefixed commands are both supported. No
|
file path placeholder; AppleScript or `shell:` prefixed commands are both supported. No
|
||||||
Electron rebuild required to change how files open — edit config in Aether and it applies
|
Electron rebuild required to change how files open — edit config in Aether and it applies
|
||||||
immediately. Legacy `launch_scripts` keys are still accepted by the resolver for older data.
|
|
||||||
See `PROJECT__AE_Events_Launcher_Native_integration.md` Section 8.
|
See `PROJECT__AE_Events_Launcher_Native_integration.md` Section 8.
|
||||||
|
|
||||||
Versioning is handled automatically: when a presenter uploads an updated file, the new
|
Versioning is handled automatically: when a presenter uploads an updated file, the new
|
||||||
|
|||||||
@@ -208,8 +208,6 @@ Launch profiles are resolved in priority order by `get_launch_profile()` in
|
|||||||
Launcher config UI (planned) or direct `localStorage` manipulation.
|
Launcher config UI (planned) or direct `localStorage` manipulation.
|
||||||
|
|
||||||
If neither is set, `script_template` is `null` and Electron uses its built-in hardcoded defaults.
|
If neither is set, `script_template` is `null` and Electron uses its built-in hardcoded defaults.
|
||||||
Legacy `launch_scripts` keys remain accepted as compatibility aliases in the resolver so older
|
|
||||||
device records continue to work while the preferred schema is `launch_profiles`.
|
|
||||||
|
|
||||||
### Key Format
|
### Key Format
|
||||||
|
|
||||||
@@ -217,9 +215,9 @@ Keys are lowercase file extensions without the dot. A `"default"` key catches al
|
|||||||
unrecognised extensions.
|
unrecognised extensions.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// event_device.data_json.launch_scripts example
|
// event_device.data_json.launch_profiles example
|
||||||
{
|
{
|
||||||
"launch_scripts": {
|
"launch_profiles": {
|
||||||
"pptx": "tell application \"Microsoft PowerPoint\"\n activate\n open (POSIX file \"{{path}}\")\n delay 3\nend tell\ntell application \"System Events\"\n keystroke return using command down\nend tell",
|
"pptx": "tell application \"Microsoft PowerPoint\"\n activate\n open (POSIX file \"{{path}}\")\n delay 3\nend tell\ntell application \"System Events\"\n keystroke return using command down\nend tell",
|
||||||
"key": "tell application \"Keynote\"\n activate\n open (POSIX file \"{{path}}\")\n delay 1\n start (front document)\nend tell",
|
"key": "tell application \"Keynote\"\n activate\n open (POSIX file \"{{path}}\")\n delay 1\n start (front document)\nend tell",
|
||||||
"pdf": "shell:open \"{{path}}\"",
|
"pdf": "shell:open \"{{path}}\"",
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ export async function launch_from_cache({
|
|||||||
* - Shell command: prefix with "shell:" → e.g. "shell:open \"{{path}}\""
|
* - Shell command: prefix with "shell:" → e.g. "shell:open \"{{path}}\""
|
||||||
*
|
*
|
||||||
* Configure via event_device.data_json.launch_profiles or $events_loc.launcher.launch_profiles.
|
* Configure via event_device.data_json.launch_profiles or $events_loc.launcher.launch_profiles.
|
||||||
* Legacy launch_scripts keys are still accepted by the Svelte resolver for older records.
|
|
||||||
* If null, Electron falls through to its built-in hardcoded defaults.
|
* If null, Electron falls through to its built-in hardcoded defaults.
|
||||||
*/
|
*/
|
||||||
script_template?: string | null;
|
script_template?: string | null;
|
||||||
|
|||||||
@@ -119,25 +119,17 @@ let screen_saver_exts = ['jpg', 'png', 'PNG', 'webp'];
|
|||||||
* Resolves the LaunchProfile for a given file extension and optional per-file
|
* Resolves the LaunchProfile for a given file extension and optional per-file
|
||||||
* display override. Checked in priority order:
|
* display override. Checked in priority order:
|
||||||
* 1. event_device.data_json.launch_profiles (API-driven, per-device)
|
* 1. event_device.data_json.launch_profiles (API-driven, per-device)
|
||||||
* 2. event_device.data_json.launch_scripts (legacy alias)
|
* 2. $events_loc.launcher.launch_profiles (local persistent override)
|
||||||
* 3. $events_loc.launcher.launch_profiles (local persistent override)
|
* 3. DEFAULT_LAUNCH_PROFILES[ext] (Svelte built-in defaults)
|
||||||
* 4. $events_loc.launcher.launch_scripts (legacy alias)
|
* 4. DEFAULT_LAUNCH_PROFILES['default'] (catch-all)
|
||||||
* 5. DEFAULT_LAUNCH_PROFILES[ext] (Svelte built-in defaults)
|
|
||||||
* 6. DEFAULT_LAUNCH_PROFILES['default'] (catch-all)
|
|
||||||
* Per-file display_override from event_file.cfg_json overrides display_mode only.
|
* Per-file display_override from event_file.cfg_json overrides display_mode only.
|
||||||
*/
|
*/
|
||||||
function get_launch_profile(
|
function get_launch_profile(
|
||||||
extension: string,
|
extension: string,
|
||||||
file_obj?: any
|
file_obj?: any
|
||||||
): LaunchProfile {
|
): LaunchProfile {
|
||||||
const device_profiles =
|
const device_profiles = ($ae_loc as any).native_device?.launch_profiles ?? null;
|
||||||
($ae_loc as any).native_device?.launch_profiles ??
|
const local_profiles = ($events_loc as any).launcher?.launch_profiles ?? null;
|
||||||
($ae_loc as any).native_device?.launch_scripts ??
|
|
||||||
null;
|
|
||||||
const local_profiles =
|
|
||||||
($events_loc as any).launcher?.launch_profiles ??
|
|
||||||
($events_loc as any).launcher?.launch_scripts ??
|
|
||||||
null;
|
|
||||||
const display_override = file_obj?.cfg_json?.display_override ?? null;
|
const display_override = file_obj?.cfg_json?.display_override ?? null;
|
||||||
return resolve_launch_profile(extension, display_override, device_profiles, local_profiles);
|
return resolve_launch_profile(extension, display_override, device_profiles, local_profiles);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user