I’m working on a music service using Next.js 14 with a search feature for artists, albums, and tracks. The search is performed on the /search
segment, and the URL parameters ?query=
and &sort_by=
are added. When an artist is selected, it redirects to /artist/[id]
, but I’m using Intercepting Routes and Parallel Routes from the Next.js documentation to display the artist’s information in a drawer instead of navigating away from /search
.
The drawer can be minimized to return to the search results. However, when accessing the artist page directly (e.g., reloading the page or navigating to /artist/[id]
), the artist information is shown as a full page instead of in a drawer.
Expected Behavior: I want the artist page to always open in the drawer, even when accessed outside the search context, so that users can easily minimize the drawer and return to /search
.
Question: Is there a way to consistently display the /artist/[id]
page as a drawer in Next.js 14, regardless of how the page is accessed?
drawer image