brain: Unify history progress indicators
eadc990ec319fe85eefb74fe64c731b90bdb9a82
Derive both the history marker and percentage from accepted hunk counts so they cannot report conflicting progress states. Assisted-by: Codex:gpt-5.6-sol
1 parent
865bba9e
crates/brain/src/session/status.rs
+2 -2
| 376 | 376 | }; |
|
| 377 | 377 | let state = match slot.state { |
|
| 378 | 378 | CommitReviewState::Accepted => Label::from_char(REVIEWED_MARK).fg(palette.positive_fg), |
|
| 379 | 379 | CommitReviewState::Rejected => Label::from_char(REJECTED_MARK).fg(palette.negative_fg), |
|
| 380 | 380 | CommitReviewState::Dropped => Label::from_char(DROPPED_MARK).fg(colors::fixed::MUTED), |
|
| 381 | - | CommitReviewState::Pending if slot.progress.accepted > 0 => { |
|
| 381 | + | CommitReviewState::Pending if slot.accepted_hunks > 0 => { |
|
| 382 | 382 | Label::from_char(IN_PROGRESS_MARK).fg(colors::rgb::ORANGE) |
|
| 383 | 383 | } |
|
| 384 | 384 | CommitReviewState::Pending => Label::from_char(PENDING_MARK).fg(colors::fixed::MUTED), |
|
| 385 | 385 | }; |
|
| 386 | 386 | [ |
| 796 | 796 | slot.state = CommitReviewState::Pending; |
|
| 797 | 797 | assert_eq!( |
|
| 798 | 798 | commit_row(&slot, DiffPalette::default())[0].to_string(), |
|
| 799 | 799 | PENDING_MARK.to_string() |
|
| 800 | 800 | ); |
|
| 801 | - | slot.progress.accepted = 1; |
|
| 801 | + | slot.accepted_hunks = 1; |
|
| 802 | 802 | assert_eq!( |
|
| 803 | 803 | commit_row(&slot, DiffPalette::default())[0].to_string(), |
|
| 804 | 804 | IN_PROGRESS_MARK.to_string() |
|
| 805 | 805 | ); |
|
| 806 | 806 |