Commit Graph

232 Commits

Author SHA1 Message Date
Claudio Ortolina e64f2b12c4 ML-200: switch to a vertical chart 2026-05-31 22:02:12 +03:00
Claudio Ortolina e67b172d64 ML-200: daily scrobble count charts 2026-05-31 21:52:06 +03:00
Claudio Ortolina 33474c1472 Allow scrobbling wishlisted records 2026-05-29 08:09:55 +03:00
Claudio Ortolina dd24258f33 Make stats formats and types counters sync 2026-05-27 23:45:29 +03:00
Claudio Ortolina f75e34211b Update dependencies
mix:
  decimal 3.1.0 => 3.1.1
  oban 2.22.1 => 2.23.0
2026-05-27 20:36:16 +03:00
Claudio Ortolina 65b2f3e1f2 Update dependencies
ex_slop 0.4.1 => 0.4.2

Introduces a new check around misusing the `length/1` function which
require widespread fixes.
2026-05-25 19:45:33 +03:00
Claudio Ortolina 2d8989a8d0 ML-169.8: keep latest record query synchronous
get_latest_record is a single fast ORDER BY LIMIT 1 query --
no reason to async-load it. Removes the <.async_result> wrapper
and the now-unnecessary render_async() from its test.
2026-05-25 09:42:14 +03:00
Claudio Ortolina f347f56218 ML-169.8: reduce Stats mount sync queries to 3
Move 7 non-critical queries out of synchronous mount into assign_async
and start_async tasks with skeleton loading placeholders.

Only scalar badge counters (collection count, wishlist count, scrobble
count) remain synchronous. All async sections use <.async_result> with
loading and failed slots. Scrobble activity preserves LiveView streams
via handle_async. On-this-day date changes use AsyncResult.ok/2.
2026-05-25 09:31:43 +03:00
Claudio Ortolina 27d3a9f285 Try and reduce test flakiness 2026-05-23 06:56:52 +01:00
Claudio Ortolina 3f2e5f2e27 ML-169.10: drop socket-internals delete tests
Remove 12 unit tests that accessed socket internals via :sys.get_state
and called handle_async directly — these leak implementation details and
error/exit paths can't be reached through the DOM.

Keep the 3 integration delete tests that use pure DOM assertions: visit,
assert_has, click, refute_has, render_async, DB verification.
2026-05-22 16:27:42 +01:00
Claudio Ortolina b10be7ba3c ML-169.10: async delete actions with initial implementation 2026-05-22 16:19:54 +01:00
Claudio Ortolina ec6980eea0 ML-193: add secondary parser, search, and API coverage tests
Add ~80 focused tests across 10 files covering:

- Record set search by name, description, contained record title, artist name
- Navigation events for records, artists, record sets, links, and view-all actions
- MusicBrainz.ReleaseGroup parser (artist credits, included RGs, release IDs, types)
- MusicBrainz.ReleaseSearchResult edge cases (missing RG, unknown formats)
- LastFm.Session XML edge cases (non-subscriber, missing nodes)
- MusicLibrary.HttpError default status-kind mapping
- Discogs.API.ErrorResponse fallback message and retry-delay behavior
- ArtistRefreshWikipediaData {:cancel, :no_english_wikipedia} worker path
- StatsComponents grouped on-this-day records and anniversary labels
2026-05-21 10:45:29 +01:00
Claudio Ortolina 66fb688b2a Fix toasts not appearing for notes and barcode scan 2026-05-21 07:49:36 +01:00
Claudio Ortolina 2983313426 ML-192: add high value missing tests
- Record editing + cover search
- Barcode scan errors + cart editing
- Notes
- Scrobble rules application over set of tracks
- Image conversion
2026-05-21 06:38:02 +01:00
Claudio Ortolina 23960b5b23 ML-169.10.1: Add delete coverage
Cover current delete behavior across LiveView index and show paths, and strengthen existing delete tests with persistence assertions.\n\nValidation: mise run dev:precommit
2026-05-20 18:04:29 +01:00
Claudio Ortolina e204e555bd ML-188: guard PubSub record updates during edit mode
Add live_action guard to handle_info({:update, record}) in both
CollectionLive.Show and WishlistLive.Show. When the user is editing,
background worker updates are skipped and a warning toast is shown
instead of overwriting the socket. Normal show-mode updates and
mismatched-ID no-ops are unchanged.

6 tests added covering all three code paths.
2026-05-19 11:38:42 +01:00
Claudio Ortolina 4ae55ea0ad Use negative assertion to debug CI failures 2026-05-17 21:34:00 +01:00
Claudio Ortolina 122c07836b ML-182.5: migrate blocked LiveView tests
Replace direct LiveView PID and isolated component test patterns with PhoenixTest-backed page flows while keeping narrow unwrap bridges where PhoenixTest cannot express the component interaction.

Precommit: mise run dev:precommit
2026-05-17 21:24:29 +01:00
Claudio Ortolina a630c58578 Once again, increase timeout due to CI performance 2026-05-16 22:41:50 +01:00
Claudio Ortolina 90ac4fa23a Extract LiveView async test helper 2026-05-16 22:27:46 +01:00
Claudio Ortolina 4fa05d6ad1 Make test wait longer due to CI performance 2026-05-16 22:16:09 +01:00
Claudio Ortolina 9f5a26198f ML-182.4: convert tests to phoenix_test 2026-05-16 16:30:42 +01:00
Claudio Ortolina 07d65fe78f ML-182.3: finish wave-3 of conversion LiveViewTest to PhoenixTest 2026-05-16 15:23:53 +01:00
Claudio Ortolina 73c469e83d ML-182.3: migrate scrobble rules tests to PhoenixTest 2026-05-15 07:00:15 +01:00
Claudio Ortolina 9eda49ed46 ML-182.3: migrate record_set/show tests to PhoenixTest 2026-05-15 06:47:25 +01:00
Claudio Ortolina bd09840443 ML-182.3: convert record_set_live/index_test to PhoenixTest 2026-05-15 06:31:50 +01:00
Claudio Ortolina 2237c7db20 ML-182.3: partial progress in conversion 2026-05-14 23:23:15 +01:00
Claudio Ortolina dda700ad96 ML-182: convert 4 test files to PhoenixTest only
Waves 1-2: scrobble_live/index, scrobbled_tracks_live/index, release_group_show, release_show. Dropped unwrap/2 bridges and page_title/1 usage. Search form tests use visit with query params. page_title tests use assert_has("title", ...).
2026-05-14 23:22:02 +01:00
Claudio Ortolina a59dd22a18 ML-168: broadcast index_changed event after background import
Import workers now broadcast :records_index_changed on
"records:index_changed" after successful import via
Records.broadcast_index_changed/0.

CollectionLive.Index and WishlistLive.Index subscribe to the
topic in mount/3 and reload their record streams on receipt,
with a live_action guard to skip reloads when the grid is
hidden behind a modal (:import, :barcode_scan).

IndexActions.handle_index_changed/1 refreshes total_entries
before reloading to keep the pagination bar accurate.
2026-05-14 17:15:06 +01:00
Claudio Ortolina 621b35d824 Open universal search modal instantly via client-side JS
Replace phx-click server event with Fluxon.open_dialog for zero-latency
modal opening. The modal DOM is now always present (no :if conditional) so
it can be shown instantly; the server syncs state in the background.

Fix test selectors that now match the always-present modal form by scoping
to forms without phx-target (which the modal form always has).
2026-05-07 20:43:15 +01:00
Claudio Ortolina 0784fc5e0c Fix page title for scrobble anything release page 2026-04-23 21:06:32 +01:00
Claudio Ortolina 1bd5707cb4 Fix page title for scrobble anything index and release group route 2026-04-23 21:06:12 +01:00
Claudio Ortolina 8911afad94 Add tests for Top Albums component 2026-04-23 16:41:44 +01:00
Claudio Ortolina c7c7e1fe4e Navigate from scrobble search to release-group page 2026-04-23 14:47:50 +01:00
Claudio Ortolina 0dcd6eab83 Replace /scrobble/:release_id with nested route 2026-04-23 14:39:26 +01:00
Claudio Ortolina d8041dc0dd Add /scrobble/:rg_id release-group page 2026-04-23 14:35:58 +01:00
Claudio Ortolina f7f38d580e Enable unaliased modules ex_slop check 2026-04-22 20:37:09 +01:00
Claudio Ortolina 0776700170 ML-142: Improve scrobble UI in the release component
- Sticky bar for easier track-based scrobbling
- Support setting custom finish time
2026-04-22 17:19:35 +01:00
Claudio Ortolina 9851a5c6bf Use cart with barcode scanner 2026-04-20 15:46:40 +01:00
Claudio Ortolina eaece07193 Count formats in results 2026-04-20 15:15:29 +01:00
Claudio Ortolina c4ebe636ff Fix ML-143 review: security, worker, and test improvements
Closes ML-143 review findings:
- cast_id/1 uses Integer.parse instead of String.to_integer
- add_to_cart validates against server-side release_groups
- JS.push payload trimmed to {id, format} only
- Oban.insert_all result checked for partial failures
- handle_async success resets @importing? to false
- ImportFromMusicbrainzReleaseGroup gets unique constraint
- Record.parse_datetime/1 made public with safe match
- Workers delegate to Record.parse_datetime/1
- Test coverage: change_format, clear_cart, wishlist single import
2026-04-20 15:15:29 +01:00
Claudio Ortolina 3f5ce060b1 Implement ML-143: Cart-style multi record import
Closes ML-143.
2026-04-20 15:15:29 +01:00
Claudio Ortolina a6319d55df Pin artist_live/show image_data_hash assertions
Refs #176
2026-04-20 06:50:04 +01:00
Claudio Ortolina 0dcfecf741 Increase render_async timeout to cater for slower CI 2026-04-19 09:29:04 +01:00
Claudio Ortolina f4db063298 Test artist edit form and record set picker flows
Closes #180
2026-04-19 09:00:06 +01:00
Claudio Ortolina 22a47f4ca9 Add tests for previously uncovered modules 2026-04-19 07:47:20 +01:00
Claudio Ortolina 94143010c0 Fix doubly-wrapped safe tuple in artist bio render 2026-04-17 16:00:22 +01:00
Claudio Ortolina 851cb36858 Fix dl accessibility violations on stats dashboard 2026-04-15 14:16:24 +01:00
Claudio Ortolina 405235e2b3 Add picker to create scrobble rules on the fly 2026-04-15 10:53:58 +01:00
Claudio Ortolina 726b7d5ef8 Add tests for chat auto-open via query param 2026-04-13 13:16:28 +01:00