feat: add shadow highlight to issue list

This commit is contained in:
2026-05-13 18:14:45 +08:00
parent cf3c292a17
commit af5fd60eb5

View File

@@ -2,7 +2,7 @@ use std::ops::Deref;
use gpui::{ use gpui::{
InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled, div, list, InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled, div, list,
prelude::FluentBuilder, px, point, prelude::FluentBuilder, px,
}; };
use crate::{ use crate::{
@@ -135,8 +135,8 @@ impl gpui::RenderOnce for IssueListItem {
let theme = app::current_theme(cx); let theme = app::current_theme(cx);
let repo_name_text = match self.repo_name { let repo_name_text = match self.repo_name {
Some(name) => text(name), | Some(name) => text(name),
None => text("Unknown repo"), | None => text("Unknown repo"),
} }
.text_xs() .text_xs()
.opacity(0.5); .opacity(0.5);
@@ -147,24 +147,25 @@ impl gpui::RenderOnce for IssueListItem {
.opacity(0.5) .opacity(0.5)
} else { } else {
match self.status { match self.status {
api::issues::PullRequestState::Closed => { | api::issues::PullRequestState::Closed => {
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.danger) font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.danger)
} }
api::issues::PullRequestState::Merged => { | api::issues::PullRequestState::Merged => {
font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.success) font_icon(FontIcon::PullRequestClosed).text_color(theme.colors.success)
} }
_ => font_icon(FontIcon::PullRequestArrow).text_color(theme.colors.success), | _ => font_icon(FontIcon::PullRequestArrow).text_color(theme.colors.success),
} }
} }
.flex_shrink_0() .flex_shrink_0()
.size_4(); .size_4();
let description_text = match self.description { let description_text = match self.description {
Some(description) => text(description).text_xs(), | Some(description) => text(description).text_xs(),
None => text("No description provided").opacity(0.5).text_xs(), | None => text("No description provided").opacity(0.5).text_xs(),
}; };
div() div()
.relative()
.w_full() .w_full()
.px_1p5() .px_1p5()
.py_1() .py_1()
@@ -196,11 +197,27 @@ impl gpui::RenderOnce for IssueListItem {
it.border_b_1().border_color(theme.colors.border) it.border_b_1().border_color(theme.colors.border)
}) })
.when(self.is_selected, |it| { .when(self.is_selected, |it| {
it.bg(theme.colors.surface_elevated) it.bg(gpui::Rgba {
.border_r_1() a: 0.05,
.border_b_0() ..theme.colors.accent
.border_color(theme.colors.accent) })
.pb(px(5.)) .overflow_hidden()
.border_r_1()
.child(
div()
.absolute()
.right_0()
.top_0()
.bottom_0()
.w_px()
.bg(theme.colors.accent)
.shadow(vec![gpui::BoxShadow {
blur_radius: px(16.),
spread_radius: px(2.),
color: gpui::Hsla::from(theme.colors.accent).alpha(0.8),
offset: point(px(-2.), px(0.)),
}]),
)
}) })
} }
} }