Skip to content

Episode page: back link returns to the list it came from - #22

Merged
dben merged 1 commit into
mainfrom
claude/nice-hopper-jx434m
Oct 24, 2026
Merged

dben merged 1 commit into
mainfrom
claude/nice-hopper-jx434m

Conversation

@dben

@dben dben commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

The back link on the episode page always went to the plain show page, dropping the list view, Downloaded/Grabbed toggles and search the user had set. It now returns to the list as they left it.

How it works

  • list_return_url() in podblock/web/routes/podcasts.py reads the Referer header (the app already sends Referrer-Policy: same-origin). When it is this show's episode list, it rebuilds the list URL (view, narrows, q) with the existing _list_url(). The page number is dropped, so the list opens at the top.
  • show_episode passes the result to episode.html as back.
  • Falls back to /podcasts/{id} when there is no Referer, it is from another site or show, or it is one of the show's other tabs (Private feed, Filters, Settings).
  • A Referer was used instead of a from parameter on each row link, because the polled /episodes/{id}/row refresh would have lost the parameter.

Known limit

After saving timeline edits, the redirect back to the episode has the episode page as its Referer, so the back link goes to the plain show page.

Testing

  • Added test_back_to_the_show_keeps_the_list_it_came_from covering the cases above.
  • Full suite passed apart from that test's first run (fixed HTML escaping in the test); tests/test_podcast_pages.py re-run: 27 passed. ruff check . is clean.
  • Not tried in a browser.

Generated by Claude Code

The link now uses the show's list URL (view, downloaded/grabbed narrows, search) taken from
the Referer when the page was reached from that show's episode list, and falls back to the
show page otherwise.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JSf3yWtWAcbkWcXbKkgwMh
@dben
dben merged commit b5610b9 into main Oct 24, 2026
5 checks passed
@dben
dben deleted the claude/nice-hopper-jx434m branch October 24, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants