Skip to content

fix: filter flat odds shifts + add color emojis to change indicators - #18

Merged
chapati23 merged 1 commit into
mainfrom
fix/odds-shifts-emoji-thresholds
Mar 2, 2026
Merged

fix: filter flat odds shifts + add color emojis to change indicators#18
chapati23 merged 1 commit into
mainfrom
fix/odds-shifts-emoji-thresholds

Conversation

@gisk0

@gisk0 gisk0 commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Changes

1. Pre-filter flat markets from Odds Shifts

Markets with maxAbsDayChange < 0.01 (1%) are now filtered out before sorting/slicing, not just checked on the top item after. This prevents the section from showing markets with essentially zero change.

2. Color-coded change emojis

Added changeEmoji() helper that maps change magnitude to emojis:

  • 🚀 ≥10% up | 🟢 ≥1% up | ⚪ flat | 🔴 ≥1% down | 🚨 ≥10% down

Applied consistently across all three format functions:

  • formatOutcomeWithChange() — multi-market outcomes
  • formatMoverItem() — binary market change display
  • formatOddsShiftItem() — binary odds shift display

Tests

  • 533 pass, 0 fail
  • Added changeEmoji test suite (6 tests)
  • Updated all formatOutcomeWithChange expectations for new emoji prefixes

- Pre-filter markets with <1% absolute change from Odds Shifts section
  (previously only checked top item post-slice, showing flat markets)
- Add changeEmoji() helper for magnitude-based color coding:
  🚀 ≥10% up | 🟢 ≥1% up | ⚪ flat | 🔴 ≥1% down | 🚨 ≥10% down
- Apply emojis in formatOutcomeWithChange, formatMoverItem, formatOddsShiftItem
- Update tests with new expectations + add changeEmoji test suite
@chapati23
chapati23 merged commit 549b428 into main Mar 2, 2026
2 checks passed
@chapati23
chapati23 deleted the fix/odds-shifts-emoji-thresholds branch March 2, 2026 09:25
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.

2 participants