Commit Graph
39 Commits
Author SHA1 Message Date
adrianbonpin 3d2f1384df fix(plugin): extract _collect_screenshots pure function, add fallback test 2026-07-13 04:59:17 +08:00
adrianbonpin 0018673747 fix(plugin): discover Steam Game Mode screenshots + safe preview fallback 2026-07-13 04:54:17 +08:00
adrianbonpin 5759fdbafd fix(plugin): align _find_mangohud_log with scoped clear, reset lastLogPath on error 2026-07-13 04:51:29 +08:00
adrianbonpin 61154dbda3 fix(plugin): safe recording start — no mid-game config rewrite, scoped log clear 2026-07-13 04:45:37 +08:00
adrianbonpin 868faafb4d fix(plugin): screenshot limit, version/build fields, delete button, workspace scripts
- list_screenshots: bump limit 12 → 50 so users can scroll further back
- Add versionString + buildId to DeckyVaultImportV1, SessionData, and
  buildImportPayload. Import endpoint now saves them on new game versions.
- Screenshot delete button in preset detail modal: owner/admin sees a
  trash icon on hover that calls DELETE /api/performance/:id/screenshots/:sid
- Root workspace scripts for plugin workflow:
  bun run plugin:build  | plugin:zip | plugin:release | plugin:deploy
- Add deploy.sh (SSH scripts to push plugin to Deck)
2026-06-29 00:33:20 +08:00
adrianbonpin 8cff20c13e feat(plugin): thumbnail previews for screenshot picker
The screenshot picker now shows a live thumbnail next to each recent
Steam screenshot so users can identify the right one before selecting.

- read_screenshot() Python RPC: returns a base64 data URL for inline
  display. Tries Pillow downscale (320px), falls back to raw bytes
  (Steam Deck screenshots are ~78KB so this is fine without Pillow).
- Thumbnail component: 56x56 rounded image with loading placeholder.
- Thumbnails load progressively in both the picker list and the
  selected-shots rows via a useEffect.
2026-06-29 00:17:04 +08:00
adrianbonpin b416f49e3d feat(plugin): attach Steam Deck screenshots to performance submissions
The plugin can now attach up to 2 Steam Deck screenshots (Steam + R1)
to a performance entry, uploaded together in one Submit tap.

Backend:
- Screenshot upload/delete endpoints now accept API key auth via
  requireRoleWithApiKeyFallback (was session-only), so the plugin's
  x-api-key header works. The 2-screenshot limit was already enforced
  server-side (MAX_SCREENSHOTS_PER_ENTRY = 2).

Plugin Python (main.py):
- list_screenshots(): scans ~/Pictures/Screenshots/ + Steam Client/
  subfolder, skips the most_recent.jpg duplicate, returns recent shots
- upload_screenshots(): hard-caps at 2, builds multipart/form-data with
  urllib, posts to /api/performance/:id/screenshots

Plugin UI (session-form.tsx):
- New Screenshots section (max 2) with a picker listing recent Steam
  screenshots (time + size), selected shots as removable rows
- Submit flow: upload entry → get entry ID → upload selected screenshots
  → combined success message (partial-success if screenshots fail)
2026-06-29 00:10:01 +08:00
adrianbonpin 4958220c55 feat: add /plugin docs page + TDP peripheral overhead
Plugin docs page (/plugin):
- Hero, feature grid, numbered install guide, screenshot gallery, install CTA
- Navbar 'Plugin' link added
- Screenshot slots with placeholders for 6 captures (flip HAS_SCREENSHOT
  once PNGs are dropped into /public/plugin/)
- Structured data (SoftwareApplication) + breadcrumbs

TDP fix:
- Add 3W fixed overhead to CPU+GPU power for screen/fan/speakers/peripherals
  so reported TDP is closer to total system power draw
2026-06-28 22:49:13 +08:00
adrianbonpin 3ed0ee3128 fix: API key test now actually verifies the key against a real auth endpoint
The old test hit /api/games/lookup which is a public endpoint with no auth,
so it never checked the key — any key (or a deleted one) reported as valid.

- Add GET /api/plugin/verify-key endpoint that uses authenticateWithApiKey
  to properly verify the x-api-key header via Better Auth
- Plugin test_api_key now calls /api/plugin/verify-key instead of games-lookup
- Returns the linked user's name + avatar on success for richer feedback
2026-06-28 22:22:47 +08:00
adrianbonpin 1de08ed4ec feat: QR code phone pairing for Decky plugin + MangoHud guide revision + SteamOS version fix
- Add plugin_pairings table + migration (0028) for short-lived pairing sessions
- Add pairing API: POST /api/plugin/pair/initiate, GET /status/:token, POST /confirm
- Add /pair web page: user scans QR on phone, confirms, API key auto-created
- Plugin: 'Pair with Phone' button renders QR code (qrcode.react), polls for status, saves API key
- Plugin: new initiate_pair + check_pair_status Python RPCs
- Revise MangoHud Setup Guide into clean numbered steps
- Fix SteamOS version detection: read VERSION_ID + BUILD_ID (was just 'SteamOS')
2026-06-28 22:09:39 +08:00
adrianbonpin 234877cef2 fix(plugin): detect Steam App ID from compatdata, read proper game name from appmanifest 2026-06-28 21:28:56 +08:00
adrianbonpin 9b6b37f8a4 fix(plugin): poll-based game detection via Python backend, remove broken SteamClient events 2026-06-28 21:25:57 +08:00
adrianbonpin 83ab7fa1e6 fix(plugin): browser-like UA for Cloudflare, detect current game, fix proton version, single-line notes 2026-06-28 21:15:17 +08:00
adrianbonpin 7ebb2669a1 fix(plugin): sum cpu_power + gpu_power for TDP, remove in-game settings, single-line notes 2026-06-28 21:03:00 +08:00
adrianbonpin b98528fbaf fix(plugin): add wrapper script to force MangoHud config file 2026-06-28 20:54:01 +08:00
adrianbonpin 7a653198e7 fix(plugin): update verify config check, add debug list tmp 2026-06-28 20:51:47 +08:00
adrianbonpin 2b53b30be6 fix(plugin): read mangohud version from script file instead of running it 2026-06-28 20:48:27 +08:00
adrianbonpin 6a486ed257 fix(plugin): add debug logging to check_mangohud 2026-06-28 20:47:43 +08:00
adrianbonpin 55bc86874a fix(plugin): use os.popen instead of subprocess for mangohud version 2026-06-28 20:46:42 +08:00
adrianbonpin 6b2dada082 fix(plugin): use full path for mangohud, return empty string instead of unknown 2026-06-28 20:45:28 +08:00
adrianbonpin 912b783593 fix(plugin): fallback version check with full binary path 2026-06-28 20:43:37 +08:00
adrianbonpin e1269b2de1 fix(plugin): clean up MangoHud version display 2026-06-28 20:40:32 +08:00
adrianbonpin 928ec8ec9a fix(plugin): retry mangohudctl start logging until game launches 2026-06-28 20:38:18 +08:00
adrianbonpin 37cc24ff60 fix(plugin): add control socket, autostart_log=1, timeout-safe mangohudctl 2026-06-28 20:33:12 +08:00
adrianbonpin aa52e0feb6 fix(plugin): use autostart_log instead of mangohudctl, improve log search 2026-06-28 20:29:38 +08:00
adrianbonpin ea3b01b28b fix(plugin): add User-Agent header to API requests for Cloudflare compat 2026-06-28 20:23:58 +08:00
adrianbonpin 6e1957524b feat(plugin): restructure layout like LSFG-VK, use mangohudctl for logging 2026-06-28 20:21:33 +08:00
adrianbonpin c230367d14 fix(plugin): search for any MangoHud log in /tmp/ instead of fixed filename 2026-06-28 19:04:35 +08:00
adrianbonpin 7ab7af468a fix(plugin): autostart MangoHud logging on record, write config on start 2026-06-28 18:56:43 +08:00
adrianbonpin 3196812c0d fix(plugin): dropdown data prop, always show guide, add config export/import 2026-06-28 17:43:36 +08:00
adrianbonpin 4b7efd3c5c fix: accept steamAppId=0 in games lookup, treat 400 as valid key in plugin test 2026-06-28 17:36:32 +08:00
adrianbonpin 046e483861 fix(plugin): hybrid SSL context - verify when possible, fall back gracefully 2026-06-28 17:33:55 +08:00
adrianbonpin 961c81e97f fix(plugin): use unverified SSL context for DeckyVault API calls 2026-06-28 17:32:14 +08:00
adrianbonpin 6c5ac9814d feat(plugin): add upload and API key test methods in backend 2026-06-28 07:55:56 +08:00
adrianbonpin 890fab3da5 feat(plugin): add export-to-file method in backend 2026-06-28 07:55:32 +08:00
adrianbonpin 6b7dfdd53c feat(plugin): add system info reader (hardware, OS, Proton, launch options) 2026-06-28 07:55:00 +08:00
adrianbonpin e48efe86b1 feat(plugin): add MangoHud log parser with unit tests 2026-06-28 07:54:32 +08:00
adrianbonpin dc1281411d feat(plugin): add MangoHud status check and config writing to backend 2026-06-28 07:53:02 +08:00
adrianbonpin 67e9e2cf63 feat(plugin): add Python backend skeleton with settings management 2026-06-28 07:52:33 +08:00