1 ADR 0096 opened media is a context preserving overlay
Forgejo Actions edited this page 2026-09-25 16:38:07 +00:00

ADR 0096: Opened Media Is A Context-Preserving Overlay

Status: accepted Date: 2026-09-25

Context

All media-open interactions in the web frontend open the shared MediaDetailViewer as an in-page overlay on the current view - never a navigation away from it. (1) Opening media from any collection view (search results, timeline, albums, people, map, discovery, future surfaces) renders the overlay on that page; the underlying context (query, filter tokens, scroll position, selection) stays intact. (2) Overlay prev/next navigation moves within the SOURCE collection's item order via MediaDetailViewer navigationOverride (computeNavigationFromItems over the local item list) - never the global timeline order. (3) Overlay state is URL-addressable via a media= param on the current page so deep links, browser back/forward and refresh restore the open overlay; closing (X, Esc) removes the param and returns to the exact same view. New searches / filter changes while an overlay is open close it first. (4) The bare /media/:id route remains for direct links (notifications, shared links) and as the grid href fallback (middle-click, no-JS); it is not a browsing destination. (5) Any new media entry point must follow this pattern; a plain /media/ link in browsing UI is a defect.