feat(mwpw-190373): add recency threshold to localFirst geo-sort#468
Open
sheridansunier wants to merge 2 commits into
Open
feat(mwpw-190373): add recency threshold to localFirst geo-sort#468sheridansunier wants to merge 2 commits into
sheridansunier wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localFirstRecencyThresholdconfig field (months) to thesortobjectmodifiedDateolder than the threshold are dropped into the global fallback pool and sorted newest-to-oldest bycardDate, preventing stale regional content from crowding out fresh global contentlocalFirstbehaviour is preserved exactlyRequires: adobecom/milo#5962
Changes
CardFilterer.js—sortCardsaccepts a new 6th paramlocalFirstRecencyThreshold; theLOCALFIRSTcase splits cards into recent-regional (geo-sorted first) and fallback (old regional + global, date-desc)Container.jsx— readssort.localFirstRecencyThresholdfrom config and threads it through tosortCardsCardFilterer.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 behaviourTest plan
sort.localFirstRecencyThreshold: 3in a local collection config withdefaultSort: 'localFirst'and verify regional cards modified within 3 months appear before older regional and global cardslocalFirstsort🤖 Generated with Claude Code