Skip to content

Sort RSS feed articles newest-first - #257

Merged
taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/#251-rss-sort-newest-first
Sep 20, 2026
Merged

taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/#251-rss-sort-newest-first

Conversation

@taylorcox75

Copy link
Copy Markdown
Owner

Summary

  • app/(tabs)/rss/feed.tsx rendered feed.articles with no sort at all, so
    articles appeared in whatever order qBittorrent's rss/items returned
    (feed-storage order) — reported as "sorted randomly."
  • Add sortArticlesByDateDesc(articles: RssArticle[]) to utils/rss.ts,
    parsing each optional date field the same way formatArticleDate already
    does (new Date(raw) + a NaN guard). Newest first; articles with a
    missing or unparseable date sort last and keep their original relative
    order (stable sort), so a feed with no dates renders exactly as it does
    today.
  • Use the helper inside the existing useMemo in feed.tsx so sorting only
    happens when feed changes, not on every render.

No i18n, no UI change, no API change — single-site fix scoped to the RSS
feed detail screen, which is the only place articles are listed.

Fixes #251

Test plan

  • npx tsc --noEmit — exit 0
  • npm test — 78 suites / 1136 tests passing (added 6 cases to
    tests/utils/rss.test.ts: newest-first ordering, undated-last with
    original relative order preserved, unparseable dates treated as
    undated, empty-array input, input-array-not-mutated)
  • npm run lint — 0 errors, 37 warnings (baseline)
  • npm run format — clean
  • Not visually verified (no simulator/device in this environment, per
    AGENTS.md §9) — this is a pure sort applied to already-rendered data, no
    UI change.

🤖 Generated with Claude Code

feed.tsx rendered articles in whatever order qBittorrent's rss/items
returned (feed-storage order), so they appeared randomly sorted.
Add sortArticlesByDateDesc to utils/rss.ts and use it in the existing
useMemo. Undated or unparseable-date articles sort last and keep their
original relative order, so a feed with no dates renders unchanged.
@taylorcox75
taylorcox75 merged commit 0d70b7e into release/v3.8.45 Sep 20, 2026
1 check passed
@taylorcox75
taylorcox75 deleted the bugfix/#251-rss-sort-newest-first branch September 20, 2026 23:58
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.

1 participant