mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
fix(webui): prevent RulerSlider from collapsing to 0px width in control bar
- Use flex layout with flex-1 on left and right clusters to preserve center cluster width - Enforce min-w-[140px] and w-full on RulerSlider - Fix tooltip positioning and remove outer overflow-hidden
This commit is contained in:
@@ -122,7 +122,7 @@ export const RulerSlider: React.FC<RulerSliderProps> = ({
|
||||
onPointerCancel={handlePointerUp}
|
||||
onKeyDown={handleKeyDown}
|
||||
className={cn(
|
||||
'relative select-none cursor-ew-resize flex flex-col justify-end h-9 touch-none overflow-hidden group',
|
||||
'relative select-none cursor-ew-resize flex flex-col justify-end h-9 touch-none w-full min-w-[140px] group',
|
||||
disabled && 'opacity-50 cursor-not-allowed',
|
||||
className,
|
||||
)}
|
||||
@@ -131,7 +131,7 @@ export const RulerSlider: React.FC<RulerSliderProps> = ({
|
||||
{isDragging && (
|
||||
<div
|
||||
data-testid="ruler-slider-tooltip"
|
||||
className="absolute -top-1 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-primary text-primary-foreground text-[10px] font-mono font-medium shadow-md whitespace-nowrap pointer-events-none z-30 animate-in fade-in zoom-in-95 duration-100"
|
||||
className="absolute -top-6 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded bg-primary text-primary-foreground text-[10px] font-mono font-medium shadow-md whitespace-nowrap pointer-events-none z-30 animate-in fade-in zoom-in-95 duration-100"
|
||||
>
|
||||
{displayedDegree}°
|
||||
</div>
|
||||
@@ -143,8 +143,6 @@ export const RulerSlider: React.FC<RulerSliderProps> = ({
|
||||
style={{
|
||||
maskImage:
|
||||
'linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent)',
|
||||
webkitMaskImage:
|
||||
'linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent)',
|
||||
}}
|
||||
>
|
||||
{/* Baseline bar */}
|
||||
|
||||
Reference in New Issue
Block a user