refactor(launcher): canonicalize default profiles
This commit is contained in:
@@ -37,7 +37,7 @@ platform is flexible enough to handle the full range.
|
||||
|
||||
### Object Hierarchy
|
||||
|
||||
```
|
||||
```text
|
||||
Event
|
||||
├── Event File (walk-in/out, hold slides for the whole event)
|
||||
├── Location (physical room — assigned to Sessions, not the other way around)
|
||||
@@ -314,11 +314,30 @@ The Electron app zero-configs itself:
|
||||
**Configurable launch behavior:** The file-open behavior is driven by a Launch Profile, not
|
||||
just a command string. Profiles are stored per file extension in
|
||||
`event_device.data_json.launch_profiles` (device-level config) or
|
||||
`event.launcher.launch_profiles` (event-level fallback). A profile can choose the app,
|
||||
display mode, open command, and post-open automation. The resolved native template uses
|
||||
`{{path}}` as the file path placeholder; AppleScript or `shell:` prefixed commands are both
|
||||
supported. No Electron rebuild is required to change how files open — edit config in Aether
|
||||
and it applies immediately. See `PROJECT__AE_Events_Launcher_Native_integration.md` Section 8.
|
||||
`event.launcher.launch_profiles` (event-level fallback). The built-in Svelte defaults are the
|
||||
final fallback and are documented below. A profile can choose the app, display mode, open
|
||||
command, and post-open automation. The resolved native template uses `{{path}}` as the file
|
||||
path placeholder; AppleScript or `shell:` prefixed commands are both supported. No Electron
|
||||
rebuild is required to change how files open — edit config in Aether and it applies
|
||||
immediately. See `PROJECT__AE_Events_Launcher_Native_integration.md` Section 8.
|
||||
|
||||
### Built-In Default Launch Profiles
|
||||
|
||||
These are the initial built-in defaults shipped with the Launcher. They are the Svelte-side
|
||||
fallbacks used when neither device config nor event config defines a profile for the file
|
||||
extension. Each canonical profile can have multiple extension aliases.
|
||||
|
||||
| Profile name | Extension aliases | Default app | Display mode | Notes |
|
||||
|---|---|---|---|---|
|
||||
| `powerpoint_mac_extend` | `pptx`, `ppt` | Microsoft PowerPoint for macOS | `extend` | Open in the presentation app and extend to an external display if one is present. |
|
||||
| `keynote_mac_extend` | `key` | Keynote | `extend` | Keynote slideshow on the external display if available. |
|
||||
| `libreoffice_mac_extend` | `odp` | LibreOffice for macOS | `extend` | LibreOffice Impress for OpenDocument presentations. |
|
||||
| `acrobat_mac_mirror` | `pdf` | Adobe Acrobat for macOS | `mirror` | PDF handout / deck view uses mirrored display. |
|
||||
| `vlc_mirror` | `mp4`, `mkv`, `mp3`, `m4v`, `m4a`, `webm`, `wav`, `aac`, `flac`, `mov`, `mpeg`, `avi`, `flv`, `ogg`, `ogv`, `wmv` | VLC for macOS | `mirror` | Media playback is mirrored so the room sees the same output as the operator. |
|
||||
| `powerpoint_win_extend` | `pptxwin`, `pptwin` | PowerPoint for Windows (Parallels) | `extend` | Windows PowerPoint profile for Parallels-based rooms. |
|
||||
| `libreoffice_win_extend` | `odpwin` | LibreOffice for Windows | `extend` | Windows LibreOffice profile for Parallels-based rooms. |
|
||||
| `acrobat_win_mirror` | `pdfwin` | Adobe Acrobat for Windows (Parallels) | `mirror` | Windows PDF profile for mirrored display rooms. |
|
||||
| `url_web` | `url` | Browser / Event File web presentation | `extend` | Web-based presentations are handled as Event File URLs rather than cached local files. |
|
||||
|
||||
Versioning is handled automatically: when a presenter uploads an updated file, the new
|
||||
hash is cached separately and the old one remains intact.
|
||||
|
||||
@@ -41,7 +41,8 @@ The integration is built on a decoupled three-layer communication model to ensur
|
||||
- **Role:** Provides a clean, typed API for Svelte components.
|
||||
- **Responsibilities:**
|
||||
- Mapping `camelCase` UI triggers to `snake_case` IPC calls.
|
||||
- Resolving a Launch Profile to a single `native_template` string before crossing IPC.
|
||||
- Resolving an extension alias to a canonical Launch Profile, then to a single
|
||||
`native_template` string before crossing IPC.
|
||||
|
||||
The reason for this split is simple: Launch Profiles are policy, while Native Templates are
|
||||
executable strings. Keeping that distinction explicit prevents the bridge from mixing config
|
||||
@@ -199,6 +200,11 @@ resolved a template yet, it should stop before IPC and surface a missing-profile
|
||||
This keeps all fallback logic in Svelte, where it can be edited without rebuilding Electron.
|
||||
The native layer should not invent or guess a default launch path.
|
||||
|
||||
The built-in defaults are organized as canonical profile names plus extension aliases. That
|
||||
lets multiple file types share one profile without repeating the same app/script details.
|
||||
URL-based presentations remain a special pseudo-extension handled separately from the cache
|
||||
open flow.
|
||||
|
||||
### Native Template Formats
|
||||
|
||||
| Format | Example |
|
||||
|
||||
@@ -22,11 +22,15 @@ guessing defaults.
|
||||
- [x] `get_launch_profile()` in `launcher_file_cont.svelte` reads from device config then event config; resolves to a `native_template` string and passes it to `launch_from_cache`
|
||||
|
||||
**Svelte-side migration — remaining before May 26:**
|
||||
- [ ] **[Launcher] Built-in Svelte default profiles** — move the "known good" pptx/key/pdf
|
||||
- [ ] **[Launcher] Built-in Svelte default profiles** — move the built-in presentation/media
|
||||
policy objects into a Svelte constants file (e.g. `ae_launcher__default_launch_profiles.ts`).
|
||||
Priority: `get_launch_profile()` already checks device config and event config; add a 3rd
|
||||
fallback to these Svelte defaults before returning `null`. Keep the fallback in Svelte, not
|
||||
in Electron.
|
||||
Use canonical profile names plus extension aliases so the media family does not repeat the
|
||||
same VLC config for every file type. Cover the core macOS set (`pptx`, `ppt`, `key`, `odp`,
|
||||
`pdf`), the media set (`mp4`, `mkv`, `mp3`, and related media types), the Windows /
|
||||
Parallels variants (`pptxwin`, `pptwin`, `odpwin`, `pdfwin`), and the URL/web-based
|
||||
presentation path. Priority: `get_launch_profile()` already checks device config and event
|
||||
config; add a 3rd fallback to these Svelte defaults before returning `null`. Keep the
|
||||
fallback in Svelte, not in Electron.
|
||||
- [ ] **[Launcher] Composable open flow** — refactor `handle_open_file()` to use
|
||||
`copy_from_cache_to_temp` + `run_osascript` / `run_cmd` directly instead of the all-in-one
|
||||
`launch_from_cache`. Finer error handling at each step (verify copy succeeded before
|
||||
|
||||
Reference in New Issue
Block a user