Skip to content

Commit 2199bbb

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
improvement(ui): reuse chips for panel selection actions (#8166)
Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
1 parent 68c9b5d commit 2199bbb

4 files changed

Lines changed: 13 additions & 57 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { Deploy } from './deploy'
22
export { Editor } from './editor'
3-
export { PanelTabButton } from './panel-tab-button'
43
export { Toolbar } from './toolbar'

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/panel-tab-button.tsx‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import { createCommands } from '@/app/workspace/[workspaceId]/utils/commands-uti
5555
import {
5656
Deploy,
5757
Editor,
58-
PanelTabButton,
5958
Toolbar,
6059
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components'
6160
import {
@@ -742,7 +741,7 @@ export const Panel = memo(function Panel() {
742741
<div className='flex gap-1.5'>
743742
<DropdownMenu open={isMenuOpen} onOpenChange={setIsMenuOpen}>
744743
<DropdownMenuTrigger asChild>
745-
<Button aria-label='Workflow actions' className='size-[30px]'>
744+
<Button aria-label='Workflow actions' iconSize='regular'>
746745
<MoreHorizontal className='size-[14px]' />
747746
</Button>
748747
</DropdownMenuTrigger>
@@ -803,7 +802,7 @@ export const Panel = memo(function Panel() {
803802
</DropdownMenu>
804803
<Button
805804
aria-label={isChatOpen ? 'Close chat' : 'Open chat'}
806-
className='size-[30px]'
805+
iconSize='regular'
807806
variant={isChatOpen ? 'active' : 'default'}
808807
onClick={() => setIsChatOpen(!isChatOpen)}
809808
>
@@ -854,29 +853,28 @@ export const Panel = memo(function Panel() {
854853
<div className='flex shrink-0 items-center justify-between px-2 pt-3.5'>
855854
<div className='flex gap-1'>
856855
{isCopilotTabAvailable && (
857-
<PanelTabButton
856+
<Chip
858857
active={_hasHydrated && activeTab === 'copilot'}
859-
className='truncate'
860858
onClick={() => handleTabClick('copilot')}
861859
data-tab-button='copilot'
862860
>
863861
Chat
864-
</PanelTabButton>
862+
</Chip>
865863
)}
866-
<PanelTabButton
864+
<Chip
867865
active={_hasHydrated && activeTab === 'toolbar'}
868866
onClick={() => handleTabClick('toolbar')}
869867
data-tab-button='toolbar'
870868
>
871869
Toolbar
872-
</PanelTabButton>
873-
<PanelTabButton
870+
</Chip>
871+
<Chip
874872
active={_hasHydrated && activeTab === 'editor'}
875873
onClick={() => handleTabClick('editor')}
876874
data-tab-button='editor'
877875
>
878876
Editor
879-
</PanelTabButton>
877+
</Chip>
880878
</div>
881879
</div>
882880

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/components/output-panel/output-panel.tsx‎

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import {
55
Button,
6+
Chip,
67
Code,
78
cn,
89
Input,
@@ -308,29 +309,13 @@ export const OutputPanel = React.memo(function OutputPanel({
308309
onClick={handleHeaderClick}
309310
>
310311
<div className='flex items-center'>
311-
<Button
312-
variant='ghost'
313-
className={cn(
314-
'text-small',
315-
!showInput ? 'text-[var(--text-primary)]!' : 'text-[var(--text-icon)]!'
316-
)}
317-
onClick={handleOutputButtonClick}
318-
aria-label='Show output'
319-
>
312+
<Chip active={!showInput} onClick={handleOutputButtonClick} aria-label='Show output'>
320313
Output
321-
</Button>
314+
</Chip>
322315
{hasInputData && (
323-
<Button
324-
variant='ghost'
325-
className={cn(
326-
'text-small',
327-
showInput ? 'text-[var(--text-primary)]!' : 'text-[var(--text-icon)]!'
328-
)}
329-
onClick={handleInputButtonClick}
330-
aria-label='Show input'
331-
>
316+
<Chip active={showInput} onClick={handleInputButtonClick} aria-label='Show input'>
332317
Input
333-
</Button>
318+
</Chip>
334319
)}
335320
</div>
336321
<div className='flex shrink-0 items-center gap-2'>

0 commit comments

Comments
 (0)