May 7, 2026
1 pull request merged across 1 repo
bahdotsh/feedr
Summary
- The "What's New since last visit" summary was sorting feeds by new-item count only, which is not a total order. Two feeds tied on count came out in whatever order Rust's
HashMaphappened to iterate that frame; since the summary re-renders on every tick, tied feeds visibly shuffled several times per second. - Fix is one line in
get_summary_stats: chain a name tie-breaker after the count comparison (b.1.cmp(&a.1).then_with(|| a.0.cmp(&b.0))) — count descending, then name ascending. Preserves the existing UX (highest count first) and gives ties a stable, intuitive order. - The reporter's suggested snippet (
sort_by_key(|(name, count)| (count, name))) would have inverted the dominant ordering — thethen_withform keeps it descending and survives the existing sorting test.
Clippy cleanup
- The repo had 16 pre-existing
clippy::collapsible_matchwarnings insrc/events.rsandsrc/config_tui.rsblocking-D warnings. Most are technically safe to collapse, but the demo-feed shortcuts (KeyCode::Char('1'/'2'/'3')) cannot be — CLAUDE.md notes those number keys are intentionally hardcoded as no-ops, and collapsing would let user-configured bindings on those keys fire when feeds are present. - Clippy itself classifies the suggestions as
MaybeIncorrect(socargo clippy --fixskips them). Added function-scoped#[allow(clippy::collapsible_match)]onhandle_key_event,handle_mouse_event, andrun_editor, with a comment explaining the rationale on the most-affected handler.
Test plan
-
cargo fmt --all -- --check— clean -
cargo clippy --all-targets --all-features -- -D warnings— clean -
cargo test— 81 unit + 4 integration tests pass, including the newtest_get_summary_stats_tie_break_by_namewhich callsget_summary_statstwice and asserts the output is identical (regression guard against HashMap-induced flicker) - Manual verification: open the "What's New" screen with two or more feeds tied on new-item count and confirm the order no longer shifts between frames