fix: address reviewer feedback — rename scroll field to bool, relocate static, drop env var
- 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
This commit is contained in:
1 parent
6f697f64f4
commit
645ca19d76
30 files changed
+43
-70
No files matched your search
@@ -83,7 +83,7 @@ mod tests {
|
||||
assert_eq!(app.tick_until_poll, 400);
|
||||
assert_eq!(app.scroll_interval, Duration::from_millis(100));
|
||||
assert_eq!(app.tick_count, 0);
|
||||
assert_eq!(app.ui_scroll_tick_count, 0);
|
||||
assert!(!app.should_text_scroll);
|
||||
assert!(!app.is_loading);
|
||||
assert!(!app.is_routing);
|
||||
assert!(!app.should_refresh);
|
||||
@@ -252,19 +252,16 @@ mod tests {
|
||||
..App::default()
|
||||
};
|
||||
|
||||
// Zero interval: elapsed() >= scroll_interval is always true, so every
|
||||
// call should signal "scroll now" (ui_scroll_tick_count == 0)
|
||||
app.on_ui_scroll_tick();
|
||||
assert_eq!(app.ui_scroll_tick_count, 0);
|
||||
assert!(app.should_text_scroll);
|
||||
|
||||
app.on_ui_scroll_tick();
|
||||
assert_eq!(app.ui_scroll_tick_count, 0);
|
||||
assert!(app.should_text_scroll);
|
||||
|
||||
// Long interval with a fresh timestamp: should signal "not yet" (count == 1)
|
||||
app.scroll_interval = Duration::from_secs(60);
|
||||
app.last_scroll = Instant::now();
|
||||
app.on_ui_scroll_tick();
|
||||
assert_eq!(app.ui_scroll_tick_count, 1);
|
||||
assert!(!app.should_text_scroll);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in new issue
Block a user