T24c round 1 fix

- FileChangeCard's header wraps: the path keeps label_width, counts and
  verdict drop below as one group; MultiFileDiffReview's header wraps its
  counts and its all-buttons inside the box, parted by justify_between
- git::DiffViewer's fold rows are Tab stops with a focus ring when the
  owner opens folds; every row keeps a transparent border so heights match;
  an inert fold no longer shows a pointer
- tests: a_narrow_review_wraps_its_rows_inside_its_box,
  git::a_fold_opens_from_the_keyboard; the gallery adds a 280px review
- AGENTS: taffy drops gaps beside an auto margin; wrapping headers
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 08:52:38 -04:00
1 parent 0a44a2d905
commit b9bff970d0
8 files changed
+172 -28

No files matched your search

+14 -7
View File
@@ -3,7 +3,7 @@ use std::{ops::Range, rc::Rc};
use gpui::{
AnyElement, App, ElementId, FontWeight, HighlightStyle, Hsla, InteractiveElement, IntoElement,
MouseButton, ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled,
StyledText, Window, div, prelude::*, relative, uniform_list,
StyledText, Window, div, prelude::*, relative, transparent_black, uniform_list,
};
use super::{
@@ -13,6 +13,7 @@ use super::{
use crate::{
buttons::SegmentedControl,
editor::{code_colors, stack},
primitives::FocusRing,
theme::{ActiveTheme, ControlSize, Palette, TextSize},
typography::{LEADING, format},
};
@@ -243,6 +244,8 @@ impl RenderOnce for DiffViewer {
.w_full()
.flex()
.px_2()
.border_1()
.border_color(transparent_black())
.whitespace_nowrap()
.line_height(relative(LEADING));
match &rows[ix] {
@@ -287,13 +290,17 @@ impl RenderOnce for DiffViewer {
.justify_center()
.bg(colors.hover.opacity(0.5))
.text_color(colors.fg_subtle)
.cursor_pointer()
.hover(|row| row.text_color(colors.fg))
.on_mouse_down(MouseButton::Left, |_, window, _| {
window.prevent_default()
})
.when_some(open, |row, open| {
row.on_click(move |_, window, cx| open(stretch, window, cx))
row.tab_index(0)
.focus_ring(cx)
.cursor_pointer()
.hover(|row| row.text_color(colors.fg))
.on_mouse_down(MouseButton::Left, |_, window, _| {
window.prevent_default()
})
.on_click(move |_, window, cx| {
open(stretch, window, cx)
})
})
.child(format!(
"⋯ {}",