Skip to content

Commit d895701

Browse files
committed
update all subblocks to allow scrolling in read only mode
1 parent 8122b87 commit d895701

File tree

8 files changed

+38
-11
lines changed

8 files changed

+38
-11
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ export function DocumentTagEntry({
324324
ref={(el) => {
325325
if (el) overlayRefs.current[cellKey] = el
326326
}}
327-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
327+
className={cn(
328+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
329+
!isReadOnly && 'pointer-events-none'
330+
)}
328331
>
329332
<div className='w-full whitespace-pre' style={{ minWidth: 'fit-content' }}>
330333
{formatDisplayText(

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ export function EvalInput({
226226
ref={(el) => {
227227
if (el) descriptionOverlayRefs.current[metric.id] = el
228228
}}
229-
className='pointer-events-none absolute inset-0 overflow-auto bg-transparent px-[8px] py-[8px] font-medium font-sans text-[#eeeeee] text-sm'
229+
className={cn(
230+
'absolute inset-0 overflow-auto bg-transparent px-[8px] py-[8px] font-medium font-sans text-[#eeeeee] text-sm',
231+
!(isPreview || disabled) && 'pointer-events-none'
232+
)}
230233
>
231234
<div className='whitespace-pre-wrap'>
232235
{formatDisplayText(metric.description || '', {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ function InputMappingField({
273273
ref={(el) => {
274274
if (el) overlayRefs.current.set(fieldId, el)
275275
}}
276-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
276+
className={cn(
277+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
278+
!disabled && 'pointer-events-none'
279+
)}
277280
style={{ overflowX: 'auto' }}
278281
>
279282
<div

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-tag-filters/knowledge-tag-filters.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ export function KnowledgeTagFilters({
312312
ref={(el) => {
313313
if (el) overlayRefs.current[cellKey] = el
314314
}}
315-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
315+
className={cn(
316+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
317+
!isReadOnly && 'pointer-events-none'
318+
)}
316319
>
317320
<div className='w-full whitespace-pre' style={{ minWidth: 'fit-content' }}>
318321
{formatDisplayText(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ export function LongInput({
353353
<div
354354
ref={overlayRef}
355355
className={cn(
356-
'pointer-events-none absolute inset-0 box-border overflow-auto whitespace-pre-wrap break-words border border-transparent bg-transparent px-[8px] py-[8px] font-medium font-sans text-sm',
357-
(isPreview || disabled) && 'opacity-50'
356+
'absolute inset-0 box-border overflow-auto whitespace-pre-wrap break-words border border-transparent bg-transparent px-[8px] py-[8px] font-medium font-sans text-sm',
357+
isPreview || disabled ? 'opacity-50' : 'pointer-events-none'
358358
)}
359359
style={{
360360
fontFamily: 'inherit',

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ export function MessagesInput({
719719
ref={(el) => {
720720
overlayRefs.current[fieldId] = el
721721
}}
722-
className='pointer-events-none absolute top-0 left-0 z-[1] m-0 box-border w-full overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words border-none bg-transparent px-[8px] py-[8px] font-medium font-sans text-[var(--text-primary)] text-sm leading-[1.5] [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden'
722+
className={cn(
723+
'absolute top-0 left-0 z-[1] m-0 box-border w-full overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words border-none bg-transparent px-[8px] py-[8px] font-medium font-sans text-[var(--text-primary)] text-sm leading-[1.5] [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',
724+
!(isPreview || disabled) && 'pointer-events-none'
725+
)}
723726
>
724727
{formatDisplayText(message.content, {
725728
accessiblePrefixes,

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ export function FieldFormat({
269269
ref={(el) => {
270270
if (el) nameOverlayRefs.current[field.id] = el
271271
}}
272-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
272+
className={cn(
273+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
274+
!isReadOnly && 'pointer-events-none'
275+
)}
273276
style={{ scrollbarWidth: 'none' }}
274277
>
275278
<div
@@ -514,7 +517,10 @@ export function FieldFormat({
514517
ref={(el) => {
515518
if (el) overlayRefs.current[field.id] = el
516519
}}
517-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
520+
className={cn(
521+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
522+
!isReadOnly && 'pointer-events-none'
523+
)}
518524
style={{ scrollbarWidth: 'none' }}
519525
>
520526
<div

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,10 @@ export function VariablesInput({
452452
ref={(el) => {
453453
if (el) overlayRefs.current[assignment.id] = el
454454
}}
455-
className='pointer-events-none absolute inset-0 flex items-start overflow-auto bg-transparent px-3 py-2 font-mono text-sm'
455+
className={cn(
456+
'absolute inset-0 flex items-start overflow-auto bg-transparent px-3 py-2 font-mono text-sm',
457+
!isReadOnly && 'pointer-events-none'
458+
)}
456459
style={{ scrollbarWidth: 'none' }}
457460
>
458461
<div className='w-full whitespace-pre-wrap break-words'>
@@ -514,7 +517,10 @@ export function VariablesInput({
514517
ref={(el) => {
515518
if (el) overlayRefs.current[assignment.id] = el
516519
}}
517-
className='pointer-events-none absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm'
520+
className={cn(
521+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-[8px] py-[6px] font-medium font-sans text-sm',
522+
!isReadOnly && 'pointer-events-none'
523+
)}
518524
style={{ scrollbarWidth: 'none' }}
519525
>
520526
<div

0 commit comments

Comments
 (0)