Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(sources): import a playable version from another source after confirmation

merged
#696 opened by devfeat/playable-match→main
Conversation4
devopened this pull requestAuthor· 2 weeks ago
Commits
0
Files changed…

Summary

Part of #693 (part 3a: single-track Playable Match). This PR does not close #693; playlist-wide matching is a follow-up.

A track refused as unavailable can now find a playable version on another ready source. The user picks a candidate in a dialog, and the candidate is imported through the normal Streaming Import path and remembered for next time.

Changes

  • A track refused as empty_url (a source's no_media) shows "Find a playable version" when another ready source can search.
  • New find_playable_matches command searches other ready sources for <title> <first artist>, skipping sources whose search needs sign-in without a session.
  • Ranking: same ISRC first, then exact title and artist, then similar title with overlapping artists. Known durations more than 3 s apart are dropped unless the ISRC matches. Candidates whose version marks (live, remix, instrumental, karaoke, acoustic, 伴奏, 现场, ライブ, and others) differ from the original rank below the rest. Refused and same-source candidates are dropped. At most 10 results.
  • New Playable Match dialog with a native radio group; the first candidate is preselected. Confirming calls remember_playable_match and imports the candidate with its own Streaming Track Identity and no Playlist Origin Stamp.
  • A remembered match imports directly next time. The original row shows "In library" through the annotation from the new playable_matches table (migration 016, additive).
  • Behavior note: matchable refused rows are no longer dimmed or hidden by "hide unavailable".
  • Docs: ADR 0048 (answers the ADR 0035 "new product surface" requirement), CONTEXT.md term Playable Match, IPC contract docs/references/contracts/catalog.md. Strings added in all 17 locales.

Acceptance criteria

Acceptance criteria are not in a linked issue here; they are the behavior described under Changes, with #693 as the parent.

Test plan

Run locally:

  • cargo fmt
  • cd src-tauri && cargo clippy --all-targets -- -D warnings — clean
  • cargo test -q — PASS (1332 + 174 + 320 passed, 14 ignored, 0 failed)
  • pnpm lint — PASS
  • pnpm build — PASS
  • pnpm test — PASS (240 files, 2566 tests)
  • Playwright chromium-accessibility and webkit-accessibility on tests/e2e/accessibility/streaming-sources.spec.ts — PASS (14)
  • Pre-push hook (coverage and patch coverage): patch coverage 91.3%, target 80%

Not run: an import against a real plugin source. The mock backend import fails by design, so the e2e checks the dialog flow and accessibility. The row flip to "In library" is covered by a store unit test.

Product standards

  • Interaction and accessibility: native radio group dialog with focus return. Keyboard and WCAG 2.2 AA axe e2e in tests/e2e/accessibility/streaming-sources.spec.ts (Chromium and WebKit).
  • Interfaces and compatibility: two new IPC commands documented in the catalog contract; additive migration 016.
  • Lifecycle and testing: Rust ranking and persistence/annotation tests, store and dialog tests.

Related issues

Part of #693

claude.ai/code/session_01N6gLN7iSoCkgZaPffMrAim

coderabbitai[bot]commented· 2 weeks ago

[!WARNING]

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: thedavidweng/OpenKara
  • Branch: feat/playable-match
  • File: .coderabbit.yaml
  • Commit: 8758133
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a42c2fa1-f642-43e8-9dba-ea5ef1172e78
Commits

Reviewing files that changed from the base of the PR and between 3eb9a25372e3c4c731bb4a20ee206d8dea33808c and 87581335bfb31b3a84ad17c027732b1017c97207.

Files ignored due to path filters: 1

  • docs/references/generated/db-schema.md is excluded by !**/generated/**, !**/generated/**, !docs/references/generated/**
Files selected for processing: 40

  • CONTEXT.md
  • docs/adr/0048-match-a-playable-version-on-another-source-with-user-confirmation.md
  • docs/adr/README.md
  • docs/references/contracts/catalog.md
  • src-tauri/migrations/016_playable_matches.sql
  • src-tauri/src/cache/mod.rs
  • src-tauri/src/catalog/identity.rs
  • src-tauri/src/catalog/import.rs
  • src-tauri/src/catalog/matching.rs
  • src-tauri/src/catalog/mod.rs
  • src-tauri/src/commands/catalog.rs
  • src-tauri/src/lib.rs
  • src/components/Catalog/PlayableMatchDialog.test.tsx
  • src/components/Catalog/PlayableMatchDialog.tsx
  • src/components/Catalog/StreamingTrackList.tsx
  • src/components/Layout/AppLayout.tsx
  • src/lib/backend/types.ts
  • src/lib/tauri/catalog.ts
  • src/locales/de.json
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/fr.json
  • src/locales/id.json
  • src/locales/it.json
  • src/locales/ja.json
  • src/locales/ko.json
  • src/locales/nl.json
  • src/locales/pl.json
  • src/locales/pt-BR.json
  • src/locales/ru.json
  • src/locales/th.json
  • src/locales/tr.json
  • src/locales/vi.json
  • src/locales/zh-CN.json
  • src/locales/zh-TW.json
  • src/mock/tauri-mock-impl.ts
  • src/stores/catalog-store.test.ts
  • src/stores/catalog-store.ts
  • src/types/ipc.ts
  • tests/e2e/accessibility/streaming-sources.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
github-actions[bot]commented· 2 weeks ago

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 84.99% (🎯 65%) 9196 / 10820
🟢 Statements 84.16% (🎯 65%) 9832 / 11682
🟢 Functions 81.64% (🎯 60%) 2407 / 2948
🟢 Branches 76.94% (🎯 60%) 5750 / 7473
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/Catalog/PlayableMatchDialog.tsx 97.43% 90.9% 100% 96.77% 67-69
src/components/Catalog/StreamingTrackList.tsx 90.07% 86.9% 95% 91.86% 132, 163-167, 283, 286, 290-296, 481, 499, 502, 582
src/components/Layout/AppLayout.tsx 95.65% 94.82% 88.23% 94.59% 67, 109
src/lib/backend/types.ts 100% 100% 100% 100%
src/locales/de.json 100% 100% 100% 100%
src/locales/en.json 100% 100% 100% 100%
src/locales/es.json 100% 100% 100% 100%
src/locales/fr.json 100% 100% 100% 100%
src/locales/id.json 100% 100% 100% 100%
src/locales/it.json 100% 100% 100% 100%
src/locales/ja.json 100% 100% 100% 100%
src/locales/ko.json 100% 100% 100% 100%
src/locales/nl.json 100% 100% 100% 100%
src/locales/pl.json 100% 100% 100% 100%
src/locales/pt-BR.json 100% 100% 100% 100%
src/locales/ru.json 100% 100% 100% 100%
src/locales/th.json 100% 100% 100% 100%
src/locales/tr.json 100% 100% 100% 100%
src/locales/vi.json 100% 100% 100% 100%
src/locales/zh-CN.json 100% 100% 100% 100%
src/locales/zh-TW.json 100% 100% 100% 100%
src/stores/catalog-store.ts 75.28% 60.15% 87.5% 77.86% 311-321, 345, 361, 363-367, 403-423, 431, 444, 455-474, 602, 606-607, 615-622, 633-634, 639-646, 673-682, 704-710, 737-739, 745, 755-756, 767-769, 790-794, 811, 839, 865, 880-882, 895, 903, 911, 927, 937-938, 940, 974, 1009, 1034-1036, 1042, 1053-1054, 1070, 1078, 1114-1126, 1186, 1202, 1207-1209, 1213, 1218-1244
Generated in workflow #2400 for commit 8758133 by the Vitest Coverage Report Action
codecov[bot]commented· 2 weeks ago

Codecov Report

:x: Patch coverage is 91.74312% with 9 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 88.1%. Comparing base (3eb9a25) to head (8758133). :white_check_mark: All tests successful. No failed tests found.

Files with missing linesPatch %Lines
src/stores/catalog-store.ts88.6%5 Missing :warning:
src/components/Catalog/PlayableMatchDialog.tsx95.4%2 Missing :warning:
src/components/Catalog/StreamingTrackList.tsx90.0%2 Missing :warning:
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #696    +/-   ##
======================================
  Coverage   88.1%   88.1%
======================================
  Files        238     239     +1
  Lines      13582   13682   +100
  Branches    4593    4539    -54
======================================
+ Hits       11971   12061    +90
- Misses      1528    1538    +10
  Partials      83      83
FlagCoverage Δ
frontend88.1% <91.7%> (+<0.1%):arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

ComponentsCoverage Δ
frontend88.1% <91.7%> (+<0.1%):arrow_up:
rust∅ <ø> (∅)
Files with missing linesCoverage Δ
src/components/Layout/AppLayout.tsx95.9% <100.0%> (+<0.1%):arrow_up:
src/locales/de.json100.0% <ø> (ø)
src/locales/en.json100.0% <ø> (ø)
src/locales/es.json100.0% <ø> (ø)
src/locales/fr.json100.0% <ø> (ø)
src/locales/id.json100.0% <ø> (ø)
src/locales/it.json100.0% <ø> (ø)
src/locales/ja.json100.0% <ø> (ø)
src/locales/ko.json100.0% <ø> (ø)
src/locales/nl.json100.0% <ø> (ø)
... and 11 more

... and 1 file with indirect coverage changes

:rocket: New features to boost your workflow:
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
kilo-code-bot[bot]commented· 2 weeks ago

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (40 files)
  • CONTEXT.md
  • docs/adr/0048-match-a-playable-version-on-another-source-with-user-confirmation.md
  • docs/adr/README.md
  • docs/references/contracts/catalog.md
  • docs/references/generated/db-schema.md (incremental: generated doc update only)
  • src-tauri/migrations/016_playable_matches.sql
  • src-tauri/src/cache/mod.rs
  • src-tauri/src/catalog/identity.rs
  • src-tauri/src/catalog/import.rs
  • src-tauri/src/catalog/matching.rs
  • src-tauri/src/catalog/mod.rs
  • src-tauri/src/commands/catalog.rs
  • src-tauri/src/lib.rs
  • src/components/Catalog/PlayableMatchDialog.test.tsx
  • src/components/Catalog/PlayableMatchDialog.tsx
  • src/components/Catalog/StreamingTrackList.tsx
  • src/components/Layout/AppLayout.tsx
  • src/lib/backend/types.ts
  • src/lib/tauri/catalog.ts
  • src/locales/de.json, en.json, es.json, fr.json, id.json, it.json, ja.json, ko.json, nl.json, pl.json, pt-BR.json, ru.json, th.json, tr.json, vi.json, zh-CN.json, zh-TW.json
  • src/mock/tauri-mock-impl.ts
  • src/stores/catalog-store.test.ts
  • src/stores/catalog-store.ts
  • src/types/ipc.ts
  • tests/e2e/accessibility/streaming-sources.spec.ts
Previous Review Summary (commit 0b1ff66)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0b1ff66)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (40 files)
  • CONTEXT.md
  • docs/adr/0048-match-a-playable-version-on-another-source-with-user-confirmation.md
  • docs/adr/README.md
  • docs/references/contracts/catalog.md
  • src-tauri/migrations/016_playable_matches.sql
  • src-tauri/src/cache/mod.rs
  • src-tauri/src/catalog/identity.rs
  • src-tauri/src/catalog/import.rs
  • src-tauri/src/catalog/matching.rs
  • src-tauri/src/catalog/mod.rs
  • src-tauri/src/commands/catalog.rs
  • src-tauri/src/lib.rs
  • src/components/Catalog/PlayableMatchDialog.test.tsx
  • src/components/Catalog/PlayableMatchDialog.tsx
  • src/components/Catalog/StreamingTrackList.tsx
  • src/components/Layout/AppLayout.tsx
  • src/lib/backend/types.ts
  • src/lib/tauri/catalog.ts
  • src/locales/de.json, en.json, es.json, fr.json, id.json, it.json, ja.json, ko.json, nl.json, pl.json, pt-BR.json, ru.json, th.json, tr.json, vi.json, zh-CN.json, zh-TW.json
  • src/mock/tauri-mock-impl.ts
  • src/stores/catalog-store.test.ts
  • src/stores/catalog-store.ts
  • src/types/ipc.ts
  • tests/e2e/accessibility/streaming-sources.spec.ts

Reviewed by free · Input: 40.6K · Output: 1.2K · Cached: 116.2K

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.