From 4e74eefddd4c1e38f7c97662cc52fae6d2a01698 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Tue, 28 Jul 2026 04:51:19 +0200 Subject: [PATCH] fix(studio): meet the 24x24 pointer target minimum on toolbar and lane controls --- .../src/components/StudioLeftSidebar.tsx | 15 +++-- .../src/components/StudioRightPanel.tsx | 10 ++- .../studio/src/components/TimelineToolbar.tsx | 4 +- .../components/editor/KeyframeNavigation.tsx | 5 ++ .../editor/propertyPanelPrimitives.tsx | 4 +- .../components/nle/TimelineResizeDivider.tsx | 13 ++-- .../src/components/pointerTargetSize.test.tsx | 65 +++++++++++++++++++ .../components/sidebar/CompositionsTab.tsx | 5 +- .../components/TimelineClipDiamonds.tsx | 12 +++- .../components/TimelineDiamondConnectors.tsx | 5 +- 10 files changed, 121 insertions(+), 17 deletions(-) create mode 100644 packages/studio/src/components/pointerTargetSize.test.tsx diff --git a/packages/studio/src/components/StudioLeftSidebar.tsx b/packages/studio/src/components/StudioLeftSidebar.tsx index 40842ecc5..4ca96ee69 100644 --- a/packages/studio/src/components/StudioLeftSidebar.tsx +++ b/packages/studio/src/components/StudioLeftSidebar.tsx @@ -154,10 +154,10 @@ export function StudioLeftSidebar({ onAddAssetToTimeline={onAddAssetToTimeline} onAddCompositionToTimeline={onAddCompositionToTimeline} /> - {/* Vertical resize divider: 3px visible seam, 8px pointer-capture zone via + {/* Vertical resize divider: 3px visible seam, 13px pointer-capture zone via the absolutely-positioned inner hit area. The outer element is w-[3px] so - it contributes only 3px of gap in the flex row; the inner -left-[2.5px] - element widens the hit area to 8px without affecting layout. */} + it contributes only 3px of gap in the flex row; the inner -left-[2px] + element widens the hit area without affecting layout. */}
- {/* Expanded hit zone: 8px wide, centered on the 3px seam */} -
+ {/* Expanded hit zone, deliberately asymmetric: 2px into the sidebar card, + the 3px seam, then 8px into the preview pane's p-2 stage gutter — the + only dead space adjacent to this seam. It stops at 13px rather than the + 24px WCAG 2.2 (2.5.8) target because the next pixel on either side is + live: the sidebar's scrolling tab content on the left, the preview + stage on the right. Silently stealing their clicks is the worse bug. */} +
{/* Visible hairline */}
diff --git a/packages/studio/src/components/StudioRightPanel.tsx b/packages/studio/src/components/StudioRightPanel.tsx index fc96e3605..cf9c69f09 100644 --- a/packages/studio/src/components/StudioRightPanel.tsx +++ b/packages/studio/src/components/StudioRightPanel.tsx @@ -446,7 +446,7 @@ export function StudioRightPanel({ return ( <> - {/* Vertical resize divider: 3px visible seam, 8px pointer-capture zone via + {/* Vertical resize divider: 3px visible seam, 13px pointer-capture zone via the absolutely-positioned inner hit area. */}
- {/* Expanded hit zone: 8px wide, centered on the 3px seam */} -
+ {/* Expanded hit zone, deliberately asymmetric: 8px into the preview pane's + p-2 stage gutter (the only dead space here), the 3px seam, then 2px + into the inspector card. It stops at 13px rather than the 24px WCAG 2.2 + (2.5.8) target because the next pixel on either side is live: the + preview stage on the left, the inspector's own controls on the right. */} +
{/* Visible hairline */}
diff --git a/packages/studio/src/components/TimelineToolbar.tsx b/packages/studio/src/components/TimelineToolbar.tsx index c745f087d..eda358891 100644 --- a/packages/studio/src/components/TimelineToolbar.tsx +++ b/packages/studio/src/components/TimelineToolbar.tsx @@ -449,7 +449,9 @@ export function TimelineToolbar({ domEditSession, onSplitElement }: TimelineTool setZoomMode("manual"); setManualZoomPercent(timelineSliderToZoomPercent(Number(e.target.value))); }} - className="mx-1 w-[96px] cursor-pointer appearance-none bg-transparent [&::-webkit-slider-runnable-track]:h-[2px] [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-neutral-700 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:shadow-[0_0_0_2px_#0a0a0a,0_1px_3px_rgba(0,0,0,0.5)] [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb:active]:cursor-grabbing" + // h-6 on the input is the 24x24 WCAG 2.2 (2.5.8) target: the visible + // track stays 2px and the thumb 10px, only the pointer box grows. + className="mx-1 h-6 w-[96px] cursor-pointer appearance-none bg-transparent [&::-webkit-slider-runnable-track]:h-[2px] [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-neutral-700 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:shadow-[0_0_0_2px_#0a0a0a,0_1px_3px_rgba(0,0,0,0.5)] [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb:active]:cursor-grabbing" />