Filter updates#43
Merged
Merged
Conversation
…tate Backend: - New entries column on giveaways (+ migration); the scraper always parsed the entry count but the sync dropped it. Stored on create and refreshed on every scan update - GiveawayResponse exposes entries and a computed win_chance percent (copies/entries*100, capped at 100; 100 when no entries yet) - /giveaways/active and /giveaways/wishlist accept min_chance (0.01-100%) and ending_within (minutes), filtered in SQL alongside the existing min_score Frontend: - Giveaways page: stepped sliders on the Active and Wishlist tabs - Min Chance (Any, then 0.01%..100%) and Ending In (5min..24h, last notch Any); win-chance badge on cards with entry-count tooltip - Filters (tab, score, safety, chance, time) now persist across visits via a localStorage-backed zustand store; search stays session-only
- The entries count never parsed: the links row on SteamGifts is
<div class="giveaway__links">, not a span, so every giveaway stored
0 entries - which made the win-chance filter pass everything and hid
the chance badge. Also handle thousands separators ("1,234 entries"
parsed as 234 with the old regex) and the singular "1 entry"
- Adaptive win_chance precision: two decimals for ordinary odds, four
for long shots, so 1 copy / 25,000 entries reads 0.004% instead of
collapsing to 0% (which read as 'no filter' in the UI)
- Cards always show the win chance for active giveaways, plus a
dedicated entries line above the reviews (locale-formatted count,
copies when >1, 'No entries recorded yet' before the first scan)
Verified live: after a scan, a 1,619-entry giveaway reports 0.0618%.
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.
Update filters on giveaway page