feat: configure personal pull request review indicators

This commit is contained in:
Valdemar Lorenzen
2026-10-21 11:14:50 +02:00
parent bd71d463a4
commit 0202644efa
18 changed files with 901 additions and 88 deletions
+29 -5
View File
@@ -3536,6 +3536,18 @@ fn draw_diff(
panels.picker_scroll.distance,
);
let mut lines = Vec::with_capacity(count * row_height);
let (requested_symbol, approved_symbol) = editor.map_or(("🙏", "👍"), |editor| {
(
editor.pull_request_review_requested_symbol.as_str(),
editor.pull_request_approved_symbol.as_str(),
)
});
let symbol_width = if pull_requests {
requested_symbol.width().max(approved_symbol.width())
} else {
0
};
let decoration_width = symbol_width + usize::from(symbol_width > 0);
for (index, revision) in entries
.enumerate()
.skip(first)
@@ -3549,10 +3561,21 @@ fn draw_diff(
} else {
Style::default()
};
let symbol = if pull_requests {
match diff.pull_request_review_state(revision) {
crate::diff::PullRequestReviewState::Requested => requested_symbol,
crate::diff::PullRequestReviewState::Approved => approved_symbol,
crate::diff::PullRequestReviewState::None => "",
}
} else {
""
};
let label = format!(
"{} {}",
"{} {symbol}{:padding$}{}",
if index == diff.selected { ">" } else { " " },
display_text(&revision.label)
"",
display_text(&revision.label),
padding = decoration_width.saturating_sub(symbol.width()),
);
let width = usize::from(results.width);
if row_height == 2 {
@@ -3560,9 +3583,10 @@ fn draw_diff(
lines.push(Line::styled(
visible_line(
&format!(
"{}{}",
if pull_requests { " " } else { " " },
display_text(&revision.description)
"{:indent$}{}",
"",
display_text(&revision.description),
indent = 2 + decoration_width,
),
0,
width,