Skip to content

Commit c108046

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
Keep workflow preview values readable (#8256)
* fix(ui): keep preview values readable and restore version tint * fix(ui): keep preview file actions inert --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
1 parent 5ca5a29 commit c108046

15 files changed

Lines changed: 141 additions & 36 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components/versions.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export function Versions({
231231
className={cn(
232232
'flex h-[36px] cursor-pointer items-center px-4 transition-colors duration-100',
233233
isSelected
234-
? 'bg-[color-mix(in_srgb,var(--accent)_10%,transparent)] hover-hover:bg-[color-mix(in_srgb,var(--accent)_15%,transparent)]'
234+
? 'bg-[color-mix(in_srgb,hsl(var(--accent))_10%,transparent)] hover-hover:bg-[color-mix(in_srgb,hsl(var(--accent))_15%,transparent)]'
235235
: 'hover-hover:bg-[var(--surface-6)] dark:hover-hover:bg-[var(--border)]'
236236
)}
237237
onClick={() => handleRowClick(v.version)}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ export function ConditionInput({
11141114
overlayRefs.current.delete(block.id)
11151115
}
11161116
}}
1117+
data-preview-full-opacity={isPreview || undefined}
11171118
className={cn(
11181119
'pointer-events-none absolute inset-0 box-border overflow-auto whitespace-pre-wrap break-words border border-transparent bg-transparent px-3 py-2 font-sans text-sm',
11191120
(isPreview || disabled) && 'opacity-50'

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/eval-input/eval-input.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export function EvalInput({
197197
className='text-transparent caret-foreground [letter-spacing:inherit] placeholder:text-muted-foreground/50'
198198
/>
199199
<div
200+
data-preview-full-opacity={isPreview || undefined}
200201
className={cn(
201202
'pointer-events-none absolute inset-0 flex items-center overflow-hidden px-3 text-sm',
202203
(isPreview || disabled) && 'opacity-50'

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,13 @@ function SingleFileSelector({
215215
iconSize='compact'
216216
className='-translate-y-1/2 absolute top-1/2 right-[28px] z-10'
217217
onClick={onClear}
218-
disabled={isDeleting}
218+
disabled={disabled || isDeleting}
219+
data-preview-full-opacity={disabled || undefined}
219220
>
220221
{isDeleting ? (
221222
<div className='size-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
222223
) : (
223-
<X className='size-4 opacity-50 hover-hover:opacity-100' />
224+
<X className='size-4 opacity-50 hover-hover:opacity-100' data-preview-full-opacity />
224225
)}
225226
</Button>
226227
</div>
@@ -770,12 +771,13 @@ export function FileUpload({
770771
iconSize='compact'
771772
className='-translate-y-1/2 absolute top-1/2 right-[4px]'
772773
onClick={(e) => handleRemoveFile(file, e)}
773-
disabled={isDeleting}
774+
disabled={disabled || isPreview || isDeleting}
775+
data-preview-full-opacity={isPreview || undefined}
774776
>
775777
{isDeleting ? (
776778
<div className='size-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
777779
) : (
778-
<X className='size-4 opacity-50' />
780+
<X className='size-4 opacity-50' data-preview-full-opacity />
779781
)}
780782
</Button>
781783
</div>
@@ -972,7 +974,7 @@ export function FileUpload({
972974
onOpenChange={(open) => {
973975
if (open) void refetchWorkspaceFiles()
974976
}}
975-
disabled={disabled}
977+
disabled={disabled || isPreview}
976978
isLoading={loadingWorkspaceFiles}
977979
formatFileSize={formatFileSize}
978980
truncateMiddle={truncateMiddle}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/grouped-checkbox-list/grouped-checkbox-list.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function GroupedCheckboxList({
123123
)}
124124
>
125125
<span className='flex flex-1 items-center gap-2 truncate text-[var(--text-muted)]'>
126-
<ManageWorkspace className='size-4 shrink-0 opacity-50' />
126+
<ManageWorkspace className='size-4 shrink-0 opacity-50' data-preview-full-opacity />
127127
<span className='truncate'>Configure PII Types</span>
128128
</span>
129129
<SelectedCountDisplay

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/long-input/long-input.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ export function LongInput({
376376
/>
377377
<div
378378
ref={overlayRef}
379+
data-preview-full-opacity={isPreview || undefined}
379380
className={cn(
380381
'absolute inset-0 box-border overflow-auto whitespace-pre-wrap break-words border border-transparent bg-transparent px-2 py-2 font-sans text-sm',
381382
(isPreview || disabled) && 'opacity-50',

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ export function MessagesInput({
547547
{currentMessages.map((message, index) => (
548548
<div
549549
key={messageIdsRef.current[index] ?? `fallback-${index}`}
550+
data-preview-full-opacity={isPreview || undefined}
550551
className={cn(
551552
'relative flex w-full flex-col rounded-sm border border-[var(--border-1)] bg-[var(--surface-5)] transition-colors dark:bg-[var(--surface-5)]',
552553
disabled && 'opacity-50'

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ export const ShortInput = memo(function ShortInput({
393393
/>
394394
<div
395395
ref={overlayRef}
396+
data-preview-full-opacity={isPreview || undefined}
396397
className={cn(
397398
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 pr-3 font-sans text-foreground text-sm [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',
398399
(isPreview || disabled) && 'opacity-50',

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slider-input/slider-input.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ export function SliderInput({
6161
const isDisabled = isPreview || disabled
6262

6363
return (
64-
<div className={cn('relative pt-2 pb-[22px]', isDisabled && 'opacity-50')}>
64+
<div
65+
data-preview-full-opacity={isPreview || undefined}
66+
className={cn('relative pt-2 pb-[22px]', isDisabled && 'opacity-50')}
67+
>
6568
<Slider
6669
value={[normalizedValue]}
6770
min={min}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ export function FieldFormat({
725725
ref={(el) => {
726726
if (el) descriptionOverlayRefs.current[field.id] = el
727727
}}
728+
data-preview-full-opacity={isPreview || undefined}
728729
style={{ scrollbarWidth: 'none' }}
729730
className={cn(
730731
'pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 font-sans text-sm',

0 commit comments

Comments
 (0)