fix(podcasts): page search hits episode titles/descriptions (issue #8)

WHY: the /podcasts search box filtered feed CARDS only (title, display
name, host, publisher, feed description). D14's episode search existed
only as the /api/podcasts/search endpoint and was never wired into the
page — searching 'Quarter' (present only in episode titles) cleared the
grid while 'Trader' (feed metadata) survived.

The page query now consults SearchMyPodcastEpisodes (subscription-scoped
via RLS — the caller's identity) when a query is present; a feed
surfaces when its OWN metadata OR any of its episodes matches, with an
'N matching episode(s)' badge on the card.

PIN: SSR test with a needle that exists only in an episode title — the
feed must surface with the match count.
This commit is contained in:
John O'Keefe committed 2026-10-29 19:49:39 -04:00
1 parent c753780817
commit ffc80f7ba7
5 files changed
+129 -38

No files matched your search

+5
View File
@@ -179,6 +179,11 @@ templ PodcastFeedCardView(feed PodcastFeedCard) {
<span class="badge" style="background-color: var(--surface-secondary); color: var(--text-secondary)">
{ podcastInt(feed.DownloadedN) + " / " + podcastInt(feed.EpisodeTotal) + " downloaded" }
</span>
if feed.EpisodeMatches > 0 {
<span class="badge" style="background-color: var(--accent-muted); color: var(--accent)">
{ podcastInt(feed.EpisodeMatches) + " matching episode" + podcastPlural(feed.EpisodeMatches) }
</span>
}
if feed.NewEpisodes {
<span class="badge" style="background-color: var(--accent-muted); color: var(--accent)">new episodes</span>
}