brain: Show stale progress bar
45fe3ae4d57d4b8ea5fa90ea46abf50cde718f20
1 parent
0df9b065
crates/brain/src/main.rs
+8 -4
| 50 | 50 | const IN_REVIEW_STATUS_ICON: char = '●'; |
|
| 51 | 51 | /// Marker shown when no brain state exists: ●. |
|
| 52 | 52 | const NO_STATE_STATUS_ICON: char = '●'; |
|
| 53 | 53 | /// Marker shown as the review-state table heading. |
|
| 54 | 54 | const STATUS_HEADING_ICON: char = '○'; |
|
| 55 | + | /// Thin neutral indicator shown when stored progress is stale. |
|
| 56 | + | const STALE_PROGRESS_BAR: &str = "────────"; |
|
| 55 | 57 | ||
| 56 | 58 | /// Parsed command-line arguments. |
|
| 57 | 59 | #[derive(Debug, Eq, PartialEq)] |
|
| 58 | 60 | struct Args { |
|
| 59 | 61 | /// How persisted review state should be loaded. |
| 383 | 385 | brain_state(status.state), |
|
| 384 | 386 | status_head(status), |
|
| 385 | 387 | review_status(status), |
|
| 386 | 388 | ahead_behind(status.relation), |
|
| 387 | 389 | comment_status(status.comments), |
|
| 388 | - | if status.state == BrainStatusState::NoState { |
|
| 389 | - | Line::blank() |
|
| 390 | - | } else { |
|
| 391 | - | progress_bar(status.progress, palette, colors::fixed::DIM) |
|
| 390 | + | match (status.state, status.base_state) { |
|
| 391 | + | (BrainStatusState::NoState, _) => Line::blank(), |
|
| 392 | + | (_, BrainStatusBaseState::Stale) => { |
|
| 393 | + | Line::new(Label::new(STALE_PROGRESS_BAR).fg(colors::fixed::DIM)) |
|
| 394 | + | } |
|
| 395 | + | _ => progress_bar(status.progress, palette, colors::fixed::DIM), |
|
| 392 | 396 | }, |
|
| 393 | 397 | ]); |
|
| 394 | 398 | } |
|
| 395 | 399 | table.lines(Constraint::max(Size::new(width, usize::MAX))) |
|
| 396 | 400 | } |