From 005faefd5d0cbc9e2e69517af37bc5e680b95878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 16 Oct 2026 20:10:03 -0400 Subject: [PATCH] Resize handles: the line is a filled hairline, since gpui paints a border no wider than half its box: a split's divider, a resizable box's edge and a column's border drew half a pixel, and none at a scale of one --- AGENTS.md | 2 +- src/layout/split.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3acf6ee..1680e5d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,7 +47,7 @@ Ely GPUI Component. A component library for GPUI, in light and dark. - Colors, control and icon sizes, text sizes, radii, shadows come from `cx.theme()`. No raw `px()` literals inside components. - Gaps and padding use gpui's rem scale helpers (`gap_2`, `px_3`). That scale is the spacing system. -- Borders use gpui's fixed-pixel helpers (`border_1` is 1px). Hairlines do not scale. +- Borders use gpui's fixed-pixel helpers (`border_1` is 1px). Hairlines do not scale. gpui paints a border no wider than half its box, so a line as thin as its box is a fill, `w_px` or `h_px` with `bg`, as the resize handles draw theirs. - One component, one home. Duplicates point to it. - Fail fast. No silent fallbacks. Log state changes with `log`. - A handler a component needs is an argument of `new`, so leaving it out fails to compile. A state live data or the outside world can reach, a key gone from a list that changed or a failed load, logs an error naming the owner and draws a visible state, nothing chosen or an error line, and the app runs on. An assert on a caller's argument or on a fact true by construction stays; one that runtime data or input can trip is fixed. Chapters move to this as `tasks/panics.md` ticks them. diff --git a/src/layout/split.rs b/src/layout/split.rs index 917a137..0a15585 100644 --- a/src/layout/split.rs +++ b/src/layout/split.rs @@ -29,6 +29,7 @@ fn handle(id: impl Into, axis: Axis, line: Hsla, cx: &App) -> Statefu .flex() .justify_center() .items_center(); + // A filled line: gpui paints a border no wider than half its box. match axis { Axis::Horizontal => base .w(hit) @@ -36,10 +37,10 @@ fn handle(id: impl Into, axis: Axis, line: Hsla, cx: &App) -> Statefu .cursor(CursorStyle::ResizeLeftRight) .child( div() + .w_px() .h_full() - .border_l_1() - .border_color(line) - .group_hover("resize", |s| s.border_color(lit)), + .bg(line) + .group_hover("resize", |s| s.bg(lit)), ), Axis::Vertical => base .h(hit) @@ -47,10 +48,10 @@ fn handle(id: impl Into, axis: Axis, line: Hsla, cx: &App) -> Statefu .cursor(CursorStyle::ResizeUpDown) .child( div() + .h_px() .w_full() - .border_t_1() - .border_color(line) - .group_hover("resize", |s| s.border_color(lit)), + .bg(line) + .group_hover("resize", |s| s.bg(lit)), ), } }