refactor(ui): define the panel resize-handle width once

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.
This commit is contained in:
l0ng-ai
2026-08-08 22:05:09 +07:00
parent 555b21cf9d
commit cab1260faa
2 changed files with 4 additions and 3 deletions
+3 -1
View File
@@ -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 {
+1 -2
View File
@@ -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)]