Skip to content

Commit 3bc5e44

Browse files
committed
refactor(linux): drop the leftmost-cell ribbon on changed rows; tint + strikethrough are enough
1 parent 4307c84 commit 3bc5e44

2 files changed

Lines changed: 18 additions & 47 deletions

File tree

linux/crates/app/src/ui/app/mod.rs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -749,38 +749,21 @@ impl SimpleComponent for App {
749749
box-shadow: inset 0 0 0 2px @accent_color;\
750750
border-radius: 2px;\
751751
}\
752-
/* Row-level pending indicators on the leftmost cell.\
753-
A 4px inset ribbon flush to the left edge marks the\
754-
row's overall mutation state. Independent of the\
755-
per-cell highlights so a row with one modified cell\
756-
still reads as a modified row at a glance. The\
757-
`solid` (non-alpha) accent matches the saturation of\
758-
GNOME Builder's diff gutters — at 3px+alpha the\
759-
ribbon was effectively invisible against tinted row\
760-
backgrounds.\
761-
*/\
762-
.tp-row-leftmost-insert {\
763-
box-shadow: inset 4px 0 0 @success_color;\
764-
}\
765-
.tp-row-leftmost-update {\
766-
box-shadow: inset 4px 0 0 @warning_color;\
767-
}\
768-
.tp-row-leftmost-delete {\
769-
box-shadow: inset 4px 0 0 @error_color;\
770-
}\
771752
/* One-shot flash on the row that produced a failing\
772753
commit statement. Animation fades the red overlay\
773754
to transparent over ~1.8s; the bind callback\
774755
re-applies the class until the BrowseTab clears\
775-
tracker.error_row.\
756+
tracker.error_row. No leftmost ribbon — the row's\
757+
background already turns red via the animation,\
758+
matching the pending-state row tints which are\
759+
themselves background-only (no extra gutter).\
776760
*/\
777761
@keyframes tp-flash-error {\
778762
0% { background: alpha(@error_color, 0.55); }\
779763
100% { background: alpha(@error_color, 0); }\
780764
}\
781765
.tp-row-leftmost-error-flash {\
782766
animation: tp-flash-error 1.8s ease-out;\
783-
box-shadow: inset 3px 0 0 @error_color;\
784767
}",
785768
);
786769
gtk::style_context_add_provider_for_display(&display, &provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);

linux/crates/app/src/ui/grid.rs

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,16 @@ fn build_column(
341341
// Persisted rows are keyed by PK column values via
342342
// RowKey::from_pk_values.
343343
//
344-
// The leftmost cell (idx == 0) gets an extra row-level class
345-
// (tp-row-leftmost-{insert|update|delete}) that draws a 3px
346-
// accent ribbon flush to the left edge — a HIG-aligned signal
347-
// for "this row has changes" that survives row recycling.
344+
// Pending state is communicated through the row's BACKGROUND
345+
// TINT alone (insert = green, modified = orange via
346+
// `.tp-cell-modified`, delete = red+strikethrough). No
347+
// leftmost-cell ribbon — that custom GNOME-Builder-style
348+
// gutter felt foreign next to the AdwListView idiom, and
349+
// the tint+strikethrough already make the row state legible
350+
// at a glance.
348351
let pending_classes: Vec<&'static str> = if let Some(_tab_id) = tab_ctx_for_bind.tab_id {
349352
if row.draft_id().is_some() {
350-
let mut v = vec!["tp-row-pending-insert"];
351-
if idx == 0 {
352-
v.push("tp-row-leftmost-insert");
353-
}
354-
v
353+
vec!["tp-row-pending-insert"]
355354
} else {
356355
let pk_values: Vec<Value> = tab_ctx_for_bind
357356
.pk_col_indices
@@ -372,20 +371,12 @@ fn build_column(
372371
(_, CellState::Modified) => v.push("tp-cell-modified"),
373372
_ => {}
374373
}
375-
if idx == 0 {
376-
// Error-row flash takes precedence over the
377-
// pending-state ribbon: the user's attention
378-
// should be on the failing row first.
379-
if t.is_error_row(&key) {
380-
v.push("tp-row-leftmost-error-flash");
381-
} else {
382-
match row_state {
383-
RowState::PendingDelete => v.push("tp-row-leftmost-delete"),
384-
RowState::InsertDraft => v.push("tp-row-leftmost-insert"),
385-
RowState::Modified => v.push("tp-row-leftmost-update"),
386-
RowState::Clean => {}
387-
}
388-
}
374+
// Error-flash overlay on the leftmost cell — a
375+
// transient background-only animation pulls the
376+
// eye to the row that failed to commit. No
377+
// accompanying gutter ribbon (see comment above).
378+
if idx == 0 && t.is_error_row(&key) {
379+
v.push("tp-row-leftmost-error-flash");
389380
}
390381
v
391382
})
@@ -683,9 +674,6 @@ const PENDING_CSS_CLASSES: &[&str] = &[
683674
"tp-cell-modified",
684675
"tp-row-pending-delete",
685676
"tp-row-pending-insert",
686-
"tp-row-leftmost-insert",
687-
"tp-row-leftmost-update",
688-
"tp-row-leftmost-delete",
689677
"tp-row-leftmost-error-flash",
690678
];
691679

0 commit comments

Comments
 (0)