Skip to content

feat: add Last.fm tag rule editing (full CRUD)#282

Merged
fiddur merged 1 commit intodevelopfrom
feat/lastfm-rule-editing
Feb 28, 2026
Merged

feat: add Last.fm tag rule editing (full CRUD)#282
fiddur merged 1 commit intodevelopfrom
feat/lastfm-rule-editing

Conversation

@fiddur
Copy link
Owner

@fiddur fiddur commented Feb 28, 2026

Summary

  • Adds update capability for Last.fm auto-tagging rules end-to-end — previously only create and delete existed
  • Adds inline edit UI to the Last.fm tag rules component on the data sources page
  • Includes 9 integration tests for the new updateLastFmTagRule DB function

Changes

api-spec

  • updateLastFmTagRuleBodySchema and updateLastFmTagRuleResponseSchema with all fields optional for partial updates

Backend

  • updateLastFmTagRule DB function with dynamic SQL SET clause (only updates provided fields)
  • PUT /lastfm/tag-rules/:id REST route with tag cleanup + retroactive reapplication
  • update_lastfm_tag_rule MCP tool
  • 9 new integration tests covering: single field update, multi-field update, merge gap update/clear, artist_names update, non-existent rule, empty update, match type change, persistence verification

Frontend

  • EditableRuleRow component with inline edit mode (same pattern as ScreentimeCategoriesSettings)
  • Edit/Cancel/Save buttons with useMutation for optimistic flow
  • Full form with all rule fields: name, tag, match type/mode, track, artists (with chip UI), merge gap
  • Dark mode and mobile responsive CSS

Add update capability for Last.fm auto-tagging rules across all layers:
- api-spec: updateLastFmTagRuleBodySchema/Response schemas
- Backend: updateLastFmTagRule DB function with dynamic SET clause
- REST API: PUT /lastfm/tag-rules/:id route
- MCP: update_lastfm_tag_rule tool
- Frontend: inline edit UI in LastFmTagRulesSettings component
- Integration tests: 9 new tests for updateLastFmTagRule
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 41.02564% with 92 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.43%. Comparing base (8d40f29) to head (402025f).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
apps/backend/src/lastfm-router.ts 0.00% 50 Missing ⚠️
apps/backend/src/mcp/lastfm-tools.ts 19.23% 42 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #282      +/-   ##
===========================================
+ Coverage    31.33%   31.43%   +0.09%     
===========================================
  Files          181      181              
  Lines        22861    22986     +125     
  Branches      1842     1856      +14     
===========================================
+ Hits          7163     7225      +62     
- Misses       15663    15727      +64     
+ Partials        35       34       -1     
Flag Coverage Δ
backend 58.08% <41.02%> (-0.25%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fiddur fiddur marked this pull request as ready for review February 28, 2026 11:58
@fiddur fiddur merged commit f73c291 into develop Feb 28, 2026
5 of 6 checks passed
@fiddur fiddur deleted the feat/lastfm-rule-editing branch February 28, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant