Skip to content

Improve record editing: allow changing artist and genre properly #352

Description

@holden

Problem

Editing a record currently has significant limitations around changing the artist and genre (and label) fields.

Issues Found

1. Artist autocomplete only returns artists already in the collection

  • Api::ArtistsController scopes results to records: { user_id: COLLECTION_USER_ID } — so if you want to reassign a record to an artist not yet in your collection, the search returns nothing
  • Same issue exists for labels (Api::LabelsController)

2. No way to create new artists, labels, or genres inline

  • If the correct artist/label/genre doesn't exist in the database at all, there's no create-on-the-fly option in the edit form
  • The form partial even has a comment noting this as a future phase: "Phase 2: Will add searchable dropdowns with create-on-the-fly for artists/labels"

3. Admin editing UX is buried

  • On the admin record show page, artist/genre/label/format editing is hidden inside a collapsed <details> section ("Record associations") — easy to miss

Current State

The backend does permit these changes — record_params allows :artist_id, :label_id, :genre_id, :record_format_id — but the UI makes it impractical:

  • Public edit form (/records/:id/edit): Has all fields but artist/label autocomplete is limited to existing collection entries
  • Admin show page (/admin/records/:id): Has individual change buttons but hidden in collapsed section

Desired Behavior

  • Artist autocomplete should search all artists in the database, not just those in the current collection
  • Same for label autocomplete
  • Add ability to create a new artist inline if search returns no results
  • Add ability to create a new label inline if search returns no results
  • Consider making the admin associations section more prominent or always visible
  • Genre dropdown should include all genres (this already works correctly)

Files Involved

  • app/controllers/api/artists_controller.rb — artist search scope
  • app/controllers/api/labels_controller.rb — label search scope
  • app/views/records/_form.html.erb — public edit form
  • app/views/admin/records/show.html.erb — admin edit UI
  • app/javascript/controllers/form_autocomplete_controller.js — autocomplete JS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions