supported apps domain + some refactor of data types redundancy

This commit is contained in:
user
2026-03-28 16:19:24 +02:00
parent 6639bcd799
commit 671a712b08
26 changed files with 2052 additions and 169 deletions

View File

@@ -90,3 +90,23 @@ Update rule:
- Cleaned up unused `Smartphone` import from constants.ts
- Updated detail page breadcrumbs to go Dashboard > Device instead of Dashboard > Devices > Device
- Updated `goto` calls to navigate to `/dashboard/:id` instead of `/devices/:id`
### 12 — Supported Apps Catalogue
- Added a normalized `supported_app` schema and matching logic domain for supported-app CRUD
- Added an admin `/supported-apps` page and sidebar entry for managing the app catalogue
- Refactored links to reference `supportedAppId` and load supported app labels from the catalogue instead of freeform app fields/constants
### 13 — Fixed ws-scrcpy Stream URL
- Added `WS_SCRCPY_URL` constant in `constants.ts` for the static public ws-scrcpy domain
- Replaced broken `normalizeViewerUrl` (which wrongly jammed ADB port into the public domain) with `buildStreamUrl` in `device-details.vm.svelte.ts`
- New builder constructs the correct hash-based ws-scrcpy stream URL: `#!action=stream&udid={host}:{wsPort}&player=mse&ws=wss://.../?action=proxy-adb&remote=tcp:8886&udid={host}:{wsPort}`
- Device `host` and `wsPort` are now correctly treated as internal ADB address (e.g. `172.17.0.1:5555`), not the public domain
- Scrcpy server port (8886) hardcoded as constant since it's static per the ws-scrcpy architecture
### 14 — Frontend Domain Type Source-of-Truth Refactor
- Refactored `apps/main/src/lib/domains/{device,link,supported-app}` to remove local duplicate data type declarations and import canonical types from `@pkg/logic/domains/*/data`
- Updated device status validation in `device.remote.ts` to reuse `deviceStatusSchema` from logic instead of a duplicated local picklist
- Kept only derived UI helper types (`Pick`/`Omit`) where needed for presentation and transport-shape compatibility