SystemStatus was declared three times, byte for byte identically, in
radarr_models, sonarr_models, and lidarr_models. MetadataProfile and the
Lidarr release download body were each declared in a single servarr module
despite having nothing servarr specific about them: MetadataProfile is an
id and name pair structurally identical to QualityProfile, which already
lives in servarr_models, and a download body of a guid plus an indexer id
is the generic form of that request.
Move all three into servarr_models, preserving that file's alphabetical
ordering, and drop the prefix from LidarrReleaseDownloadBody now that it is
no longer owned by one servarr.
RadarrReleaseDownloadBody and SonarrReleaseDownloadBody deliberately stay
where they are. Radarr's carries a movie id and Sonarr's carries optional
series, episode, and season fields, so the three types are not
interchangeable and only the Lidarr shape is the common one.
Behavior is unchanged. Every remaining edit is an import path update or the
rename at a call site.
- Rename `ui_scroll_tick_count: u64` → `should_text_scroll: bool` across all 33
call sites; `on_ui_scroll_tick` now assigns true/false instead of 0/1
- Remove two now-redundant comments from `test_on_ui_scroll_tick`
- Move `WHITESPACE_RE` static declaration below module imports in network/mod.rs
- Remove `MANAGARR_TICK_RATE_MS` env var and its parsing helpers; `recv()`-based
blocking already brings idle CPU to near-0, and tuning tick rate silently
stretches the poll cadence — keep `DEFAULT_TICK_RATE_MS` const only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
- Revert src/main.rs to draw-at-top-of-loop (original structure) so
auto-scrolling is no longer coupled to event rate. Lock is released
before blocking on recv() so the network task is never starved.
- Replace ticks_until_scroll counter in on_ui_scroll_tick() with an
Instant + Duration (default 100ms). Scroll now advances at a fixed
wall-clock rate (10 chars/sec) regardless of draw rate or tick rate,
which is the correct long-term fix for the animation regression.
- Update tests: assert scroll_interval == 100ms in default/new tests;
rewrite test_on_ui_scroll_tick to cover zero-interval (always fires)
and long-interval (suppressed) cases.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
- Compile whitespace regex once via OnceLock instead of on every
non-success response; makes format_error_body infallible (String
return, no Result) eliminating the only practical failure mode
- Revert default tick rate from 100ms back to 50ms to preserve the
existing 20-second Servarr poll cadence (tick_until_poll=400 × 50ms);
the recv() change is the real CPU fix — the tick rate change was
unnecessary and silently halved the data refresh rate
- Keep MANAGARR_TICK_RATE_MS as opt-in override; note that tuning it
proportionally stretches the poll interval alongside the tick rate
- Replace non-blocking try_recv() event loop with blocking recv() to
eliminate idle spin; the sender tick timeout still drives minimum
wakeup rate so the UI stays responsive
- Lower default tick rate from 50 ms to 100 ms (10 ticks/sec vs 20);
add MANAGARR_TICK_RATE_MS env var for runtime tuning
- Move terminal draws to event boundaries (key + tick) instead of every
loop pass, reducing unnecessary redraws
- In network error handling, prefer concise JSON fields (message /
errorMessage / error) over the raw HTTP body, so Radarr ASP.NET
stack traces don't flood the TUI banner; full body still logged
- Add unit tests for tick-rate parsing and Radarr-style JSON error body
Observed: ~0.6% total CPU at idle vs measurably higher with prod defaults