Skip to content

feat(mwpw-190373): add recency threshold to localFirst geo-sort#468

Open
sheridansunier wants to merge 2 commits into
mainfrom
MWPW-190373
Open

feat(mwpw-190373): add recency threshold to localFirst geo-sort#468
sheridansunier wants to merge 2 commits into
mainfrom
MWPW-190373

Conversation

@sheridansunier

@sheridansunier sheridansunier commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a localFirstRecencyThreshold config field (months) to the sort object
  • Regional cards with a modifiedDate older than the threshold are dropped into the global fallback pool and sorted newest-to-oldest by cardDate, preventing stale regional content from crowding out fresh global content
  • When no threshold is set the existing localFirst behaviour is preserved exactly

Requires: adobecom/milo#5962

Changes

  • CardFilterer.jssortCards accepts a new 6th param localFirstRecencyThreshold; the LOCALFIRST case splits cards into recent-regional (geo-sorted first) and fallback (old regional + global, date-desc)
  • Container.jsx — reads sort.localFirstRecencyThreshold from config and threads it through to sortCards
  • CardFilterer.spec.js — 4 new unit tests covering: recent regional sorts first, recent regional sorted by country, fallback sorted newest-to-oldest, and zero threshold falls back to original behaviour

Test plan

  • Set sort.localFirstRecencyThreshold: 3 in a local collection config with defaultSort: 'localFirst' and verify regional cards modified within 3 months appear before older regional and global cards
  • Verify zero / absent threshold produces identical output to the current localFirst sort

🤖 Generated with Claude Code

Regional cards older than `sort.localFirstRecencyThreshold` (months) are
dropped into the global fallback pool and sorted newest-to-oldest by
cardDate, so stale regional content no longer crowds out fresh global content.
Threshold is read from config and passed through Container → CardFilterer.
Uses modifiedDate to determine recency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…string values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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