From cab1260faabc98a2d36df23d45a0aca51d341c48 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:05:09 +0700 Subject: [PATCH] refactor(ui): define the panel resize-handle width once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tab sidebar and the right panel each declared their own RESIZE_HANDLE_WIDTH = 8. Two edges the same window drags, two numbers that only happened to agree — the same shape as the target fade that had already drifted apart. One constant now, named where the panel lives. --- src/ui/right_panel.rs | 4 +++- src/ui/tab_sidebar.rs | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/right_panel.rs b/src/ui/right_panel.rs index 3513abf9..6d03be7d 100644 --- a/src/ui/right_panel.rs +++ b/src/ui/right_panel.rs @@ -20,7 +20,9 @@ use crate::ui::scrollbar::with_vertical_scrollbar; pub(crate) const MIN_WIDTH: f32 = 216.; pub(crate) const MAX_WIDTH_RATIO: f32 = 0.5; -const RESIZE_HANDLE_WIDTH: f32 = 8.; +/// How wide a panel edge is to grab. Both edges a window can drag — the tab +/// sidebar's and this panel's — are the same target, so they are one number. +pub(crate) const RESIZE_HANDLE_WIDTH: f32 = 8.; #[derive(Default)] pub(crate) struct RightPanelState { diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index 79993afb..41bce223 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -18,6 +18,7 @@ use crate::ui::app::{TITLE_BAR_HEIGHT, Tty7App}; use crate::ui::hints::tab_badge_label; use crate::ui::i18n::{L10nKey, t}; use crate::ui::reorder::{self, Reorder, Surface}; +use crate::ui::right_panel::RESIZE_HANDLE_WIDTH; use crate::ui::tab_strip::{DragTab, REORDER_SLIDE_MS}; const MIN_SIDEBAR_WIDTH: f32 = 180.; @@ -25,8 +26,6 @@ const MIN_SIDEBAR_WIDTH: f32 = 180.; const GRAB_HANDLE_W: f32 = 48.; const MAX_SIDEBAR_WIDTH_RATIO: f32 = 0.5; -const RESIZE_HANDLE_WIDTH: f32 = 8.; - const ROW_GAP: f32 = 2.; #[derive(Clone)]