diff --git a/docs/ui-specification.md b/docs/ui-specification.md index 3c5616b..ec34157 100644 --- a/docs/ui-specification.md +++ b/docs/ui-specification.md @@ -1,147 +1,47 @@ -# UI specification +# Crate user guide and interface specification -This document describes the user interface of Crate, an application for discovering, exploring and reviewing music albums. +Crate helps people find albums, explore details and reviews, and keep a personal list of albums to revisit. This document describes the behavior available in the current application. The README's [implementation status](../README.md#implementation-status) is the source for milestone and project-level status. -The design is based on our updated Figma prototype, with a focus on a consistent layout, responsive design and accessible interactions. +## Discover albums -## Design overview +Discover shows albums as soon as the page opens. A search is optional. To search, enter words from an album title or artist and submit with **Search** or Enter. Typing alone does not send a search. A search can be reset from the no-results view. -Crate uses a music-inspired design with dark green navigation, mint-green accents and a vinyl theme. The interface supports both light and dark mode based on the user's system preference. +The ten most recent distinct submitted searches are saved for the browser's simulated user. A user can choose a recent search from the search suggestions or clear the saved history. If history cannot be loaded, the interface offers a retry. -The main views are **Discover**, where users browse and search for albums, **Album details**, where they can explore an album's information, tracklist and reviews, and **My Crate**, where they can revisit saved albums. +### Filters and sorting -Discover, My Crate and the album detail page display album artwork from Cover Art Archive when available. Albums without available artwork use the existing vinyl placeholder. +The **Filters** control opens the filter options. Filters cover genre, release decade, artist country and whether an album has reviews. Options display matching album counts. Genres combine with AND; multiple decades or countries combine with OR within their group. Selected options appear as removable chips and can also be cleared together. The result summary reports how many albums are loaded out of the total matches. -### Discover +Results can be sorted by relevance, title, release year or average rating. Browse defaults to newest first; a submitted text search defaults to relevance. Sorting and filters are applied to the complete matching catalog on the server. Changing either preserves the other choices. -**Dark mode** +Search text, sorting and filters are encoded in the URL. Reloading, sharing the link, and using browser back and forward therefore restore the same Discover state. Opening an album and returning to Discover also retains that state. -![Discover page in dark mode](images/discover_desktop_dark.png) +### Results and recovery -**Light mode** +The page initially requests up to 20 albums. Scrolling can load two further pages automatically, up to 60 albums. A **Load more** button can request more pages; after the automatic limit, further pages require that button. New results append to the list. -![Discover page in light mode](images/discover_desktop_light.png) +While the request is in progress, the page announces a loading status. If the initial search or browse request fails, it shows an error and a **Retry search** or **Retry albums** button. If a later page fails, the loaded results remain and the user can retry loading more. When nothing matches, Crate explains that no albums were found and offers **Reset search**. -The Discover page opens with a large music-themed hero, including the heading "Music worth holding onto." and a search field. +Album cards show the title and artist alongside available release year, genre, rating and review count. Artwork comes from Cover Art Archive when available; otherwise Crate uses its vinyl placeholder. The album link opens details, while the separate crate control saves or removes that album. -Below the hero, users can browse albums, apply filters, change the sorting order and open individual albums. Results are presented in a responsive grid of album cards. +## Album details, ratings and reviews -Each card shows artwork, the album title, artist, release year, genres, rating and review count when available. Clicking a card opens its details, while the separate Crate button adds or removes the album from the user's collection. +An album page shows its title, credited artists, release year, genres, average rating, available track list and reviews. Tracks are informational; Crate does not play music. When artwork loads, its source attribution links to the MusicBrainz release group. -### Album details +The review form lets the current user select one to five stars and optionally add a comment. They can publish, edit or delete their own review. Other users' reviews show their display name, rating, date and comment; the current user's review is marked **You**. Additional reviews load using **Load more reviews**. If that request fails, existing reviews stay visible and another attempt is available. An album with no reviews invites the user to write the first one. -**Dark mode** +While album details load, the page announces the loading state. If the album cannot be loaded, it reports that the album is unavailable and provides a link back to Discover with the search state intact. Review submission and update errors are shown without discarding the form's input. -![Album detail page in dark mode](images/album_detail_dark.png) +## Your crate, without sign-in -**Light mode** +The crate is a personal saved-album list. Users do not need an account or sign-in: Crate assigns a simulated ID in that browser and sends it with requests. The saved list is kept in the application database for that ID, so it remains available when the same browser returns. It is not an account that can be used to sync across browsers or devices. Clearing that browser's site data removes its local ID and will make the previous list inaccessible from that browser. -![Album detail page in light mode](images/album_detail_light.png) +Users can add or remove an album from a card or detail page. **Your crate** lists saved albums newest first, with up to 20 per page and a **Load more** button for further albums. During loading the page reports progress. If the list cannot be loaded, **Try again** retries the request; if loading an additional page fails, saved results remain and the user can try that page again. An empty crate explains how to save albums and links back to Discover. -The album detail page shows artwork, title, artists, release year, genres and average rating. Users can add or remove the album from their Crate and return to Discover without losing their search or filter choices. +## Visual and responsive behavior -When artwork loads successfully, an attribution link below it opens the corresponding MusicBrainz release-group page. +The layout adapts the album grid and album details to narrow screens, and filter groups stack when there is less width. Text and controls support enlarged text without horizontal page scrolling. Artwork in result and crate grids loads lazily; detail artwork loads immediately. The interface offers visible focus, labelled controls, keyboard operation and status announcements. Rating choices use native radio buttons. Reduced-motion preferences are respected. -The tracklist displays track numbers, titles and durations when available. Tracks are shown as information only; the application does not provide music playback. +The current [Discover design](images/discover_desktop_light.png) is included as a visual reference. The Figma [prototype](https://www.figma.com/make/0UUQFX4QJDEbtYG8YHjTUd/Redesign-Crate-Music-Discovery) informed the design; the implemented behavior described above is authoritative where it differs. -Users can rate albums from one to five stars and optionally write a comment. They can also edit or delete their own reviews and read reviews from other users. - -### My Crate - -![My Crate page with saved albums](images/my_crate.png) - -The **Your crate** link in the main navigation opens My Crate. The page lists the user's saved albums, newest saved first, and shows how many albums are displayed out of the total saved. - -Users can add or remove albums using the Crate buttons on Discover and album detail pages. In My Crate, clicking a card opens the album's details, while its separate Crate button removes it from the saved collection. The main navigation provides a link back to Discover. - -Saved albums use the same responsive card grid as Discover, with fewer columns on smaller screens. Cards display album covers when available and the vinyl placeholder otherwise. - -The page initially loads up to 20 albums. A **Load more** button loads additional saved albums, with feedback during loading or errors. - -An empty crate shows **Nothing saved yet**, explains how to save albums and provides a **Discover albums** link. - -## Search, filters and sorting - -### Search and browsing - -Users can browse albums immediately without entering a search term. - -They can also search by album title or artist. Searches are submitted using Enter or the Search button, rather than updating while typing. - -The submitted search, selected filters and sorting preference are reflected in the URL. This allows users to reload or share a search and use browser back/forward navigation without losing their choices. - -### Filters - -![Discover filter panel with available filter options](images/filters.png) - -The Filters button opens an expandable panel containing three filter groups: - -- **Genres:** Select one or more genres. -- **Decades:** Filter albums by release decade. -- **Reviews:** Show only albums with reviews. - -Available filter options include result counts. Selected filters also appear as removable chips above the results. - -Users can remove filters individually or clear them all. Genre selections are combined using AND, while selected decades use OR. - -### Sorting - -By default, albums are shown newest first when browsing and by relevance when searching. - -Users can also sort alphabetically, by release year or by rating. Changing the sorting order does not clear the search or selected filters. - -### Results and pagination - -Discover initially shows 20 albums. Up to two additional pages can load automatically as users scroll, bringing the total to 60 albums when enough results are available. - -A **Load more** button lets users request further results. New albums are added to the existing list rather than replacing it. - -If no albums match the search or filters, the page shows a message and a Reset search button. - -A **Top** button allows users to return to the beginning of Discover. On desktop, it appears as a floating control. On smaller screens, it appears below the results to avoid covering other buttons. - -## Ratings and reviews - -![Review form and community reviews](images/reviews.png) - -The Ratings & reviews section contains a form for rating an album and optionally leaving a written comment. - -Ratings use a five-star selection. The form supports publishing, updating and deleting reviews. Errors are shown without clearing the user's input, allowing them to try again. - -Community reviews show the author's name, rating, date and comment. The user's own review is labelled "You". Additional reviews can be loaded using **Load more reviews**. - -Albums without reviews display an empty-state message inviting users to write the first review. - -## Responsive design - -Crate adapts to desktop and mobile screen sizes. - -![Discover page on mobile](images/mobile_discover.png) - -![Album detail page on mobile](images/mobile_album_detail.png) - -On smaller screens, the album grid uses fewer columns, filter groups stack vertically, and album details place the artwork above the album information. The tracklist and reviews also stack into a single column. - -Album covers adapt to different screen sizes. Images in Discover and My Crate load lazily, while artwork on the album detail page loads immediately. - -Text, buttons and other controls adjust to narrow screens and enlarged text without requiring horizontal page scrolling. - -## Accessibility - -Accessibility has been considered throughout the interface. - -The application supports keyboard navigation, visible focus indicators and labelled controls. Users can operate search, filters, Crate buttons and review forms without a mouse. - -Rating selection uses native radio buttons, allowing keyboard users to change ratings with the arrow keys. Buttons remain keyboard-accessible during loading where needed, and status messages provide feedback after actions. - -Information is not communicated through colour alone. Saved albums, selected filters and ratings also use text or symbols. - -The interface respects reduced-motion preferences, including disabling unnecessary animation and using instant scrolling for Back to top. - -## Design references - -The UI was developed using an updated [Figma prototype](https://www.figma.com/make/0UUQFX4QJDEbtYG8YHjTUd/Redesign-Crate-Music-Discovery) as a visual reference. - -Some details differ from the prototype to support the application's actual functionality and maintain consistency across both themes. - -For an overview of implemented features and remaining work, see the [README](../README.md#implementation-status). +For technical decisions behind search, filtering, pagination and simulated identity, see [architecture decisions](architecture.md).