feat: add an image field to tracks - #63
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tracks can now have cover artwork, mirroring how records handle images.
What's included
tracks.imagecolumn.FileUpload(image(), 5 MB max,publicdisk,tracks/directory) on the Track form and the record's Tracks relation manager; anImageColumnon both the Tracks table and the relation manager table.Storage::disk('public').imagedefaults tonull(tracks stay imageless unless set).Decisions
imagefield (not front/back like the physical record) — a track isn't a physical object; one artwork fits.Test plan
TrackCatalogTest::test_track_image_is_shown_on_the_index_and_detail— asserts the stored image path renders on both public surfacescomposer lint:test(Pint) — pass ·composer analyse(PHPStan level 6) — no errorsNote: a live browser screenshot was attempted but the automation tool couldn't reach
document_idleon the DDEV public pages (an environmental issue seen elsewhere this session); the feature is verified by the HTTP test asserting the rendered image path.