Commit Graph

10128 Commits

Author SHA1 Message Date
Georges-Antoine Assi
e9ab144d39 feat(v2): render cover art at its natural aspect ratio
Stop forcing a fixed box ratio on gallery covers. Cards now share one
height and vary in width to match each cover image's natural aspect, with
no cropping.

- GameCover measures the rendered image's natural ratio on load and drives
  its own aspect-ratio from it (style ratio kept only as a pre-load seed);
  emits the measured ratio.
- GameCard default (gallery) card: fixed art height, natural width; size
  tiers and hero keep their fixed footprints. Forwards the ratio event.
- Gallery grid becomes flow-packed wrapping rows: useGalleryVirtualItems
  greedily packs same-height / natural-width cards per row (ragged right),
  measuring ratios client-side (cached by rom id, debounced re-pack). Row
  height stays uniform so RVirtualScroller, AlphaStrip, scroll restoration
  and grid-nav are unchanged.
- useResponsiveColumns additionally exposes usableWidth for width packing.
- Unit tests for packFlowRows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:33:28 -04:00
Zurdi
dbc6139752 Merge pull request #3570 from rommapp/chore/extract-files-layout
refactor: unify upload UX across GameDetails subtabs
2026-06-21 21:21:35 +02:00
Zurdi
ee33bf1b71 Merge pull request #3569 from rommapp/feat/share-savestates
feat: share saves & states with other users
2026-06-21 21:18:34 +02:00
zurdi
7c82965825 docs: address copilot review comments on PR #3570
Refresh stale doc comments that didn't keep pace with the refactor:

- `global.css` r-v2-asset-fade — list AssetList / AssetStrip / FileRow
  / ScreenshotsTab / SoundtrackPanel as the consumers (was: just
  AssetList / AssetStrip).
- `SaveDataTab.vue` section-head comment — drop the "subtitle" mention
  (subtitle was removed in this PR).
- `FilesTab.vue` file header — section header now hosts Upload only;
  Download-all / Copy-link moved to the selection toolbar (select-all
  then act). Updated the file-level summary and the content-column
  bullet list to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-21 18:18:00 +00:00
zurdi
d3bc224900 refactor: unify upload UX across GameDetails subtabs
Move every upload affordance out of the sidebar's collapsible action
panel into a section header at the top of each panel, matching
ScreenshotsSubtab. Sidebars become navigation-only.

Touched subtabs:
- SaveDataTab (Saves + States) — Upload per Mine section header.
- MediaTab Manual — header hosts the entry selector + Upload only;
  Delete + Redownload move into the PDF viewer's toolbar via new
  PdfViewer `deletable` / `redownloadable` props.
- MediaTab Soundtrack — header with just Upload.
- MediaTab — reorder subtabs so Screenshots sits above Soundtrack.
- FilesTab — header with Upload only (Download all / Copy link
  dropped; equivalent via select-all + selection toolbar).
- ScreenshotsSubtab + SaveDataTab — drop the redundant "Private to
  you until you make them public" subtitle and i18n keys.

Add a distinct entrance animation for dense, data-row content:
`r-v2-asset-fade` (fade + 14px rise, no scale, no overshoot, 320ms,
24ms stagger). Applied to AssetList / AssetStrip rows, FileRow,
screenshot thumbnails and soundtrack track rows so they cascade in
on first paint, separate from the bouncier `r-v2-card-fade` reserved
for hero cards.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-21 17:23:40 +00:00
Georges-Antoine Assi
49f2b1659c Merge pull request #3272 from rommapp/claude/user-game-activity-monitoring-Mqb1v
Add real-time activity tracking for active game sessions
2026-06-21 12:02:58 -04:00
zurdi
91640c36ec fix: address copilot review comments on PR #3569
* i18n `rom.cant-toggle-visibility` is interpolated with `{error}` in
  SaveDataTab but the strings dropped the placeholder, hiding the
  backend error detail from the snackbar. Add `{error}` to every locale
  (en_US source + es_ES translated, others English placeholder).
* `RSliderBtnGroup` badge visibility check did not handle the string
  `"0"` / `""` cases allowed by the `string | number | null` type.
  Extract a `showBadge` helper and use it in both the router-link and
  RBtn branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-21 15:55:23 +00:00
zurdi
1e902a966f style: align visibility toggle color across saves, states & screenshots
Notes already paints the lock button primary when private and muted when
public; bring screenshots and the new saves/states toggles to the same
binding so the three visibility surfaces read consistently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-21 15:45:39 +00:00
zurdi
47b198c61c style: apply eslint --fix to share-savestates refactor
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-21 15:22:43 +00:00
Zurdi
10587fc8e7 Merge pull request #3568 from androosio/fix/sibling-badge-undefined-siblings
fix: guard SiblingBadge against missing sibling_roms (scan crash with Group ROMs)
2026-06-21 17:20:17 +02:00
Georges-Antoine Assi
c6c7ce9ea6 cleanup 2026-06-21 11:13:30 -04:00
Georges-Antoine Assi
0460133992 Secure activity identity, cut Redis churn, remove v1 activity
Backend:
- Resolve the acting user from the authenticated socket session on
  connect instead of trusting the client-supplied user_id, so a client
  can no longer spoof a "now playing" session for another user. Only
  rom_id/device_id come from the payload.
- Emit activity:update/clear through the already-initialised socket
  server instead of opening (and leaking) a fresh AsyncRedisManager per
  REST heartbeat.
- Collapse get_all_active's per-key GET into a single MGET.
- Drop the pure pass-through _build_activity_entry helper.

Frontend:
- Remove all activity emits from the v1 EmulatorJS Player; the v2 shell
  is the single driver of the activity lifecycle.
- Remove activity from the v1 UI entirely (Activity view, ActivityBtn,
  ActivePlayers on game details, navigation, and the now-v2-only route).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:12:18 -04:00
androosio
b96a1dda2a fix: guard SiblingBadge against missing sibling_roms
The `scan:scanning_rom` socket emit strips `sibling_roms` from the rom
payload, so a freshly-scanned rom can reach SiblingBadge with the field
undefined (despite the schema typing it as required). Reading
`.length`/`.map` then threw `TypeError: Cannot read properties of
undefined (reading 'length')`, crashing the gallery during a scan while
"Group ROMs" was enabled.

Default `sibling_roms` to an empty list (a `siblings` computed). REST
payloads always include it (possibly empty), so only the socket path was
affected.

Closes #3567

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:11:16 +02:00
zurdi
44dd203058 feat: add AssetList and AssetStrip components for managing saves and states
- Introduced AssetList.vue for displaying a vertical list of saves with detailed information.
- Added AssetStrip.vue for a horizontal strip of state tiles, supporting selection and management modes.
- Created stories for AssetStrip to demonstrate various states and scenarios.
- Enhanced RSliderBtnGroup to include a badge for displaying counts next to labels.
- Updated EmulatorJS.vue to utilize the new AssetList and AssetStrip components, including badge counts for saves and states.
2026-06-21 14:14:55 +00:00
zurdi
9106c3721e feat: add visibility toggle for saves and states, enhance community sections
- Introduced new API endpoints for updating visibility of saves and states.
- Added `is_public` property to `SaveSchema` and `StateSchema`.
- Created new models for user saves and states with visibility attributes.
- Updated the `SaveDataTab` component to differentiate between "Mine" and "Community" sections.
- Implemented visibility toggle functionality for user saves and states.
- Enhanced localization files to include new strings for visibility actions.
2026-06-21 14:00:02 +00:00
Georges-Antoine Assi
8aaa52bcb2 wire up v2 ui 2026-06-21 08:07:00 -04:00
Georges-Antoine Assi
429e718a14 add ui for v2 2026-06-20 21:09:11 -04:00
Georges-Antoine Assi
4b091bfb34 Resolve activity device_type from the device record
Instead of always inferring "web" for browser-emitted activity events, look
the device up by device_id and use its client type, falling back to "web"
(the browser default) when no device record exists. Mirrors the REST
heartbeat endpoint, which derives device_type from device.client.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 18:56:03 -04:00
Georges-Antoine Assi
1caa6386c2 Translate activity.json into all locales
Add activity.json translations for every non-en_US locale and add the
matching `activity` key (added with the activity feature but left
English-only) to each common.json, so check_i18n_locales.py passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 13:48:47 -04:00
Georges-Antoine Assi
892a1b18e1 Merge branch 'master' into claude/user-game-activity-monitoring-Mqb1v 2026-06-20 13:42:11 -04:00
Zurdi
28e2ebe780 Merge pull request #3562 from rommapp/copilot/fix-game-entry-removal
Handle missing ROM files during delete-from-filesystem requests
2026-06-20 18:40:34 +02:00
Zurdi
dd3f9d0496 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-20 18:33:54 +02:00
copilot-swe-agent[bot]
bd0bc65e92 fix: allow ROM deletion when file is missing
Co-authored-by: zurdi15 <34356590+zurdi15@users.noreply.github.com>
2026-06-20 16:23:24 +00:00
copilot-swe-agent[bot]
bd2e6b7962 chore: outline minimal fix plan
Co-authored-by: zurdi15 <34356590+zurdi15@users.noreply.github.com>
2026-06-20 16:21:20 +00:00
copilot-swe-agent[bot]
5548a0cb95 Initial plan 2026-06-20 16:19:34 +00:00
zurdi
33a98d32a5 style: adjust tooltip padding for better visual alignment 2026-06-20 16:14:17 +00:00
zurdi
b94badf502 Merge remote-tracking branch 'refs/remotes/origin/master' 2026-06-20 16:12:45 +00:00
zurdi
b7a7f6a5e3 feat: enhance user permissions and UI elements for better access control 2026-06-20 16:12:05 +00:00
Zurdi
cce2587024 Merge pull request #3557 from rommapp/feat/logs-view
feat: real-time backend logs view
2026-06-20 17:54:23 +02:00
zurdi
78cac11913 feat: add DISABLE_LOGS_VIEWER configuration and implement checks in logs endpoints and frontend 2026-06-20 15:48:58 +00:00
Georges-Antoine Assi
74d60bbad9 Merge pull request #3559 from rommapp/feat/pytest-xdist
Run backend tests in parallel with pytest-xdist
2026-06-20 07:37:07 -04:00
zurdi
78eef900b9 feat: update logs endpoint to require 'logs.read' scope and adjust related authorization checks 2026-06-20 09:55:10 +00:00
Zurdi
26c853f1cd Merge pull request #3554 from rommapp/feat/add-debug-overlay
feat: Add debug overlay
2026-06-20 11:23:19 +02:00
zurdi
90777d5cbb refactor: address Copilot review on debug overlay
- Lazy-load DebugOverlay via defineAsyncComponent so its chunk (and the
  vueuse perf hooks it pulls in) stays out of the default bundle until the
  developer toggle is enabled.
- Add useDebugMode unit tests mirroring useCrtMode: default-off, persisted
  restore, write-through, and singleton sharing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:21:43 +00:00
Georges-Antoine Assi
b8450add5f Validate test database name before CREATE DATABASE
Addresses review feedback: `db_name` is interpolated into CREATE DATABASE
statements via f-strings (identifiers can't be bind parameters), so validate
it up-front against a plain-identifier allowlist ([A-Za-z0-9_]+) and refuse
anything containing quoting/other characters, rather than rely on quoting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:38:50 -04:00
Georges-Antoine Assi
26cf4b36f8 Scope test-user grant to the romm_test namespace
Addresses review feedback: granting ALL PRIVILEGES on *.* is overly broad,
especially against a shared DB instance. A database-level grant on the
`romm\_test%` wildcard pattern still lets the user CREATE the per-worker
databases (romm_test_gw0, ...) needed by pytest-xdist, while confining it to
that namespace — verified that out-of-namespace CREATE DATABASE is denied.

PostgreSQL needs no equivalent change: its CI service user (POSTGRES_USER)
is the container superuser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:34:46 -04:00
Georges-Antoine Assi
0e016eca9b Merge branch 'master' into claude/user-game-activity-monitoring-Mqb1v 2026-06-19 21:11:05 -04:00
Georges-Antoine Assi
02815ec403 Run backend tests in parallel with pytest-xdist
Add pytest-xdist and run the backend test suite across multiple workers
(`-n 4` in CI). Each worker gets its own database so the autouse
`clear_database` fixture can't wipe rows another worker is mid-test with:

- Rootdir `backend/conftest.py` sets a per-worker `DB_NAME`
  (`romm_test_gw0`, ...) before any app module is imported, so each
  worker's engine binds to its own database.
- `tests/conftest.py` creates the per-worker database on demand (mariadb/
  mysql and postgresql paths) just before migrations run.
- The test user's grant is widened to `*.*` (setup.sql + CI) so it can
  `CREATE DATABASE` for the workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:02:47 -04:00
Zurdi
4b58479232 Merge pull request #3556 from rommapp/feat/add-dropzone-to-savestates
feat: Add dropzone to saves/states
2026-06-20 01:02:14 +02:00
Zurdi
ca74dbbb96 Merge pull request #3555 from rommapp/fix/platform-refresh-on-scan
fix: Refresh platforms on scan
2026-06-20 00:20:47 +02:00
zurdi
8b70e31828 refactor: address Copilot review on logs feature
- main.py: await the cancelled log-forwarder task (suppressing
  CancelledError) so its pubsub/lock cleanup finishes before shutdown.
- forwarder: only heartbeat the Redis lock while we still own it; if a
  stall let another worker take it, relinquish forwarding to avoid
  duplicate lines (the outer loop re-contends).
- endpoints/logs.py: derive MAX_LOG_LIMIT from LOG_BUFFER_SIZE so the
  REST backfill never drifts from the producer's ring buffer.
- Logs.vue: append the download <a> to the DOM before click() (matches
  the Patcher pattern) for cross-browser reliability.
- Add tests/endpoints/test_logs.py: non-admin 403, limit clamping to
  [1, MAX_LOG_LIMIT], oldest-first ordering, and malformed-entry skip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 20:53:58 +00:00
zurdi
02c6fc8d3f fix: suppress bandit B110/B112 on intentional log-stream swallows
The log-stream handler and forwarder deliberately swallow exceptions: the
handler is a best-effort mirror that must never raise into the app, and the
forwarder can't log its own failures without feeding back into the stream.
Annotate these with `# nosec` (with justification) so Trunk's bandit check
passes, keeping lines within black's width.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 16:17:45 +00:00
zurdi
ad543d93ee feat: add logs feature with internationalization support
- Introduced a new logs view for admin users, allowing real-time monitoring of backend logs.
- Implemented a log entry streaming mechanism using Socket.IO.
- Added filtering and searching capabilities for log entries.
- Created localized log messages in Spanish, French, Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Romanian, Russian, Simplified Chinese, and Traditional Chinese.
- Updated router and sidebar components to include the new logs route.
- Enhanced user interface with tooltips and buttons for copying and downloading logs.
2026-06-19 16:06:50 +00:00
zurdi
40f7e49b11 feat: integrate dropzone for file uploads in SaveDataTab component 2026-06-19 14:52:59 +00:00
zurdi
67e70b21c1 fix: enhance platform refresh during scan completion and add new platforms to store 2026-06-19 14:43:33 +00:00
zurdi
eb1b477013 feat: add debug overlay with localization support for multiple languages 2026-06-19 13:06:26 +00:00
zurdi
fcccb5d583 feat: add random game button and localization for random ROM functionality 2026-06-19 12:40:10 +00:00
zurdi
68793c1f93 fix: game card reveal animation as global utility 2026-06-19 12:17:58 +00:00
Zurdi
c2d1bc592e Merge pull request #3552 from rommapp/feat/crt-mode
feat: CRT mode as a theme setting
2026-06-19 13:56:34 +02:00
Zurdi
24f8e6eb66 Merge pull request #3551 from rommapp/feat/add-user-avatar-to-notes
feat: Add user avatar to shared assets like notes or screenshots
2026-06-19 13:40:08 +02:00