Skip to content

Commit 9bc1965

Browse files
committed
Studio: convert right sidebar Wheels/HSL tabs to collapsible panels
1 parent 612160e commit 9bc1965

1 file changed

Lines changed: 9 additions & 27 deletions

File tree

src/Studio.tsx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ const Studio = ({ onBack }: { onBack?: () => void } = {}) => {
183183
const [hslAdjustments, setHslAdjustments ] = useState<HslAdjustments>(defaultHslAdjustments);
184184
const [selectedBand, setSelectedBand ] = useState<HslBandKey>('reds');
185185
const [colorSidebarOpen, setColorSidebarOpen] = useState(true);
186-
const [colorTab, setColorTab ] = useState<'wheels' | 'hsl'>('wheels');
187186
const [colorWheels, setColorWheels ] = useState<ColorWheelAdjustments>({
188187
lift: { x: 0, y: 0, luma: 0 },
189188
gamma: { x: 0, y: 0, luma: 0 },
@@ -789,28 +788,11 @@ const Studio = ({ onBack }: { onBack?: () => void } = {}) => {
789788
{colorSidebarOpen && image && (
790789
<div className="hidden md:flex flex-col w-64 bg-gray-800 border-l border-gray-700 shrink-0">
791790

792-
{/* Tab bar */}
793-
<div className="flex border-b border-gray-700 shrink-0">
794-
{(['wheels', 'hsl'] as const).map(tab => (
795-
<button
796-
key={tab}
797-
onClick={() => setColorTab(tab)}
798-
className={`flex-1 py-2 text-xs font-medium uppercase tracking-wider transition-colors ${
799-
colorTab === tab
800-
? 'text-white border-b-2 border-purple-500 bg-gray-800'
801-
: 'text-gray-500 hover:text-gray-300 border-b-2 border-transparent'
802-
}`}
803-
>
804-
{tab === 'wheels' ? 'Wheels' : 'HSL'}
805-
</button>
806-
))}
807-
</div>
791+
<div className="flex-1 overflow-y-auto p-3 space-y-3">
808792

809-
<div className="flex-1 overflow-y-auto">
810-
811-
{/* ── WHEELS tab ── */}
812-
{colorTab === 'wheels' && (
813-
<div className="p-3 space-y-4">
793+
{/* ── Color Wheels panel ── */}
794+
<CollapsiblePanel id="wheels" title="Color Wheels">
795+
<div className="space-y-4">
814796
{([
815797
{ key: 'lift' as const, label: 'Shadows' },
816798
{ key: 'gamma' as const, label: 'Midtones' },
@@ -880,11 +862,11 @@ const Studio = ({ onBack }: { onBack?: () => void } = {}) => {
880862
Drag wheels to push color into shadows, midtones, or highlights. Double-click a wheel to reset it.
881863
</p>
882864
</div>
883-
)}
865+
</CollapsiblePanel>
884866

885-
{/* ── HSL tab ── */}
886-
{colorTab === 'hsl' && (
887-
<div className="p-3 space-y-3">
867+
{/* ── HSL panel ── */}
868+
<CollapsiblePanel id="hsl" title="HSL">
869+
<div className="space-y-3">
888870
{/* Band swatches */}
889871
<div className="grid grid-cols-4 gap-1.5">
890872
{HSL_BANDS.map(band => (
@@ -983,7 +965,7 @@ const Studio = ({ onBack }: { onBack?: () => void } = {}) => {
983965
</div>
984966
)}
985967
</div>
986-
)}
968+
</CollapsiblePanel>
987969

988970
</div>
989971
</div>

0 commit comments

Comments
 (0)