Skip to content

feat: add an image field to tracks - #63

Merged
jaballer merged 2 commits into
mainfrom
feature/track-image
Jul 11, 2026
Merged

feat: add an image field to tracks#63
jaballer merged 2 commits into
mainfrom
feature/track-image

Conversation

@jaballer

Copy link
Copy Markdown
Owner

Summary

Tracks can now have cover artwork, mirroring how records handle images.

What's included

  • Migration: nullable tracks.image column.
  • Admin: a FileUpload (image(), 5 MB max, public disk, tracks/ directory) on the Track form and the record's Tracks relation manager; an ImageColumn on both the Tracks table and the relation manager table.
  • Public: artwork on the track detail page (bounded square) and a small thumbnail per row on the track index — both lazy-loaded with explicit dimensions to avoid layout shift, and served via Storage::disk('public').
  • Factory: image defaults to null (tracks stay imageless unless set).

Decisions

  • Single image field (not front/back like the physical record) — a track isn't a physical object; one artwork fits.
  • Reused the records' 5 MB limit and public-disk convention for consistency.

Test plan

  • TrackCatalogTest::test_track_image_is_shown_on_the_index_and_detail — asserts the stored image path renders on both public surfaces
  • Full suite — 113 passed (321 assertions)
  • composer lint:test (Pint) — pass · composer analyse (PHPStan level 6) — no errors
  • Migration verified on dev MariaDB and SQLite; Vite build clean

Note: a live browser screenshot was attempted but the automation tool couldn't reach document_idle on the DDEV public pages (an environmental issue seen elsewhere this session); the feature is verified by the HTTP test asserting the rendered image path.

jaballer added 2 commits July 11, 2026 10:34
Tracks can now have cover artwork, mirroring the records image pattern.

- Migration: nullable tracks.image column.
- Admin: FileUpload on the Track form and the record's Tracks relation manager
  (image(), 5 MB max, public disk, tracks/ directory); ImageColumn on both
  track tables.
- Public: artwork on the track detail page and a thumbnail per row on the
  track index (lazy-loaded, explicit dimensions to avoid layout shift).
- Factory image defaults to null; test covers the image rendering on both
  public surfaces.
Display each track's image as a thumbnail in the record page's tracklist,
completing the front-end coverage (track index + detail already show it). The
thumbnail slot is reserved only when at least one track in the list has
artwork, so an imageless tracklist stays compact and titles keep aligning.
@jaballer
jaballer merged commit f46f1c9 into main Jul 11, 2026
1 check passed
@jaballer
jaballer deleted the feature/track-image branch July 11, 2026 17:40
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