You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enrich the user experience, the artist page should provide contextual information about an artist's career. A concise summary will help users discover more about the artists they listen to and improve the application's overall quality.
Acceptance Criteria
A short career summary (2–6 sentences) is displayed on the artist page if available.
The source of the summary (e.g., "Source: Wikipedia") is shown with a link to the full article.
Summaries are cached to improve performance and reduce redundant API calls.
All licensing and attribution requirements (e.g., Wikimedia's CC BY-SA) are respected and displayed.
A fallback message, like “No biography available,” is shown when a summary cannot be found.
The UI gracefully handles loading states while the summary is being fetched.
Proposed Technical Solution
1. Data Fetching:
Primary API: Use the Wikimedia REST API (/page/summary/{title}) to get concise, pre-formatted extracts.
Artist Identification: Use an external service like MusicBrainz or Last.fm to resolve the correct Wikipedia page title from the artist's ID.
API Module: All new data-fetching logic should be added to a dedicated src/api/externalApi.js file.
2. Caching Strategy:
Client-Side Caching: Cache the fetched summaries in the Zustand store.
Cache Key: Use the artist's ID as the key for the cache entry.
Stale-While-Revalidate: On subsequent visits, display the cached data immediately while re-fetching in the background if the data is stale (e.g., older than 7 days).
3. UI Implementation:
A new component, ArtistBio.jsx, will be created within the src/features/artist/ directory.
This component will be responsible for:
Displaying the sanitized biography text.
Showing the source and a "Read more" link.
Rendering the loading and fallback states.
The ArtistBio.jsx component will be integrated into the main ArtistPage.jsx component.
Implementation Steps
API Layer: Implement functions in src/api/externalApi.js to fetch artist biography data from the Wikimedia API.
State Management: Update the Zustand store to handle caching for artist summaries.
Component: Create the ArtistBio.jsx component to display the summary, source, and handle loading/fallback states.
Integration: Add the new ArtistBio.jsx component to the ArtistPage.jsx.
Attribution: Ensure the UI correctly displays any required attribution for the summary source.
Description:
Motivation
To enrich the user experience, the artist page should provide contextual information about an artist's career. A concise summary will help users discover more about the artists they listen to and improve the application's overall quality.
Acceptance Criteria
Proposed Technical Solution
1. Data Fetching:
/page/summary/{title}) to get concise, pre-formatted extracts.src/api/externalApi.jsfile.2. Caching Strategy:
3. UI Implementation:
ArtistBio.jsx, will be created within thesrc/features/artist/directory.ArtistBio.jsxcomponent will be integrated into the mainArtistPage.jsxcomponent.Implementation Steps
src/api/externalApi.jsto fetch artist biography data from the Wikimedia API.ArtistBio.jsxcomponent to display the summary, source, and handle loading/fallback states.ArtistBio.jsxcomponent to theArtistPage.jsx.