feat(episodes): add a setting to control the Latest Episodes list length (#114)#200
Conversation
…der, import, load sanitize) - Align MAX_EPISODE_LIST_LIMIT with the feed cache's per-feed retention (75) so a chosen limit is always serveable from a warm cache; selecting a podcast still shows its full archive. - Sort each feed by date before truncating so the per-feed limit keeps the NEWEST episodes even when the feed/cache is not newest-first. - Rehydrate the episodeListLimit store on settings import (was only persisted). - Sanitize episodeListLimit in loadSettings so a malformed persisted value is repaired in the settings object, not just clamped at runtime. - Settings input: don't clobber the saved limit on empty/mid-edit input and skip redundant saves. - Rebuild the latest list with a single sort+slice on limit change. Refs #114
Deploying podnotes with
|
| Latest commit: |
cbcc503
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e399f8b1.podnotes.pages.dev |
| Branch Preview URL: | https://chhoumann-114-episode-list-l.podnotes.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 609950c3e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…114) Codex review (P2): setCachedEpisodes persisted the first 75 episodes in feed order, so an oldest-first feed cached its OLDEST episodes. After a warm restart within the cache TTL, the Latest Episodes list rebuilt from that stale set and search missed the actual newest episodes. Select the newest 75 by date while preserving original order (feeds <= the cap are untouched), so the per-feed list limit is correct for any feed ordering.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3808548358
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…114) Codex review (P2): the previous commit changed which episodes the feed cache retains (newest-by-date instead of first-in-feed-order), but an unexpired v2 entry written by the old code still holds the first 75 feed items. For an oldest-first feed those are the oldest episodes, so a warm start after upgrade would keep Latest Episodes/search stuck on stale items until the TTL expired. Bump the storage key v2 -> v3 (and drop v2 as a legacy key) so the new retention applies immediately on upgrade, matching the existing v1 -> v2 precedent.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds an episodeListLimit setting that controls how many of each saved feed's
most recent episodes appear in the aggregated Latest Episodes list (and how
far back the search box reaches when no individual podcast is selected).
Closes #114.
Why
In #114 a user reported that searching the episode list returned far fewer
results than other podcast apps. PodNotes only surfaces the latest 10
episodes per feed in the aggregated Latest Episodes view, and the search box (when
no podcast is selected) searches exactly that set — so older episodes were never
found. There was no way to widen that window.
What changed
episodeListLimitsetting (default 10, range 1-75), surfaced in thesettings tab as "Latest episodes per podcast".
latestEpisodesstore now keeps the newestepisodeListLimitepisodes perfeed instead of a hard-coded 10, and reacts live to the setting (no reload
needed).
unbounded by this setting — so any one show's complete back catalogue stays
searchable from its own view.
Default behaviour is unchanged: a fresh or upgraded vault keeps the historical
10-per-feed window.
Review-driven hardening
Two adversarial reviewers (opposite-model) plus an ultracode review pass surfaced
several real issues, all addressed here:
feed, so a larger limit could never be served on a warm start. The max is
aligned to that cap (75), with a cross-reference comment so the two can't drift.
date before truncating, so it keeps the newest episodes even when a feed (or
cache) isn't already newest-first.
episodeListLimitstore (previously the value was persisted but the open view kept the old limit).
0from an olddata.json) is repaired in the settings object on load, not just clamped at
runtime, so it can't be re-persisted.
field is empty/mid-edit, and skips redundant saves.
sort+slice instead of repeated array copies.
Testing
npm run lint,format:check,typecheck,check:a11y,build,test— allgreen (463 tests; new store + sanitize coverage, including an oldest-first feed
regression test).
loadSettingsrepairedthe persisted value to 75).
Release / migration impact
Additive top-level settings key.
loadSettingsmerges overDEFAULT_SETTINGS, soexisting vaults get
episodeListLimit: 10automatically; the e2e provision seed(
DEFAULT_PODNOTES_DATA) was updated to keep the seed-sync test green.