Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.
This repository was archived by the owner on Jul 15, 2026. It is now read-only.

Bug: clicking a file on the Media "Files" tab does nothing #4

Description

@joestump-agent

Context / Problem

On the Media page's Files tab, clicking a file attachment does nothing — it neither opens nor downloads the file.

Steps to reproduce

  1. Go to Media → Files.
  2. Click a file card / its filename link.

Expected vs actual

  • Expected: the file opens or downloads.
  • Actual: nothing happens.

Investigation notes (verified)

  • File cards already render a download link: templates/gallery.html gallery_files_page uses <a class="media-file-name" href="{{mediaURL .ConversationID .RelPath}}" download="{{.OriginalName}}"> (the download attribute was added for issue Media/attachment UX: don't navigate the webview to raw files; styled error pages joestump/msgbrowse#161).
  • The whole app is hx-boosted, so same-origin anchor clicks are intercepted by HTMX and swapped into #main-content. A boosted click on a link whose response is a raw binary (served by handleMedia, GET /media/{id}/{path...} in internal/web/media.go) would fail to swap and read as "nothing happens." Prime suspect — verify whether the anchor needs hx-boost="false" / hx-disable (or target="_blank") to bypass boosting, and whether handleMedia sets a Content-Disposition: attachment header.
  • Also confirm mediaURL resolves correctly for the Files tab (images on the same page work, so the path helper itself is likely fine).

Proposed solution / Acceptance criteria

  • Clicking a file on the Files tab reliably downloads (or opens) it in both browser and desktop-webview modes.
  • Fix works for infinite-scroll continuation pages (handleGalleryItemsgallery_files_page).
  • Non-stat-able / missing files still render without breaking the click for valid ones.

Relevant code

  • internal/web/templates/gallery.html (gallery_files_page)
  • internal/web/media.go (handleMedia, /media/{id}/{path...})
  • internal/web/gallery.go (decorateFiles, handleGalleryItems)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions