Skip to content

Commit 6e4afcb

Browse files
committed
fix: remove "click to add" instruction from placeholders in non-editable mode
Previously, block title placeholders would show "click to add a title" even when not editable, which was misleading since users couldn't actually edit. Now they show just the block type (e.g. "Python", "SQL", etc.) to provide context while removing the interactive instruction that doesn't apply in non-editable mode. Changes made to: - Python block - SQL block - Visualization block - Pivot Table block - Writeback block
1 parent 80edcbb commit 6e4afcb

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

apps/web/src/components/v2Editor/customBlocks/pivotTable/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ function PivotTableBlock(props: Props) {
489489
className={clsx(
490490
'text-sm font-sans font-medium pl-1 ring-gray-200 focus:ring-gray-400 block w-full rounded-md border-0 text-gray-800 hover:ring-1 focus:ring-1 ring-inset focus:ring-inset placeholder:text-gray-400 focus:ring-inset py-0 disabled:ring-0 h-2/3 bg-transparent focus:bg-white'
491491
)}
492-
placeholder="Pivot Table (click to add a title)"
492+
placeholder={props.isEditable ? "Pivot Table (click to add a title)" : "Pivot Table"}
493493
value={attrs.title}
494494
onChange={onChangeTitle}
495495
disabled={!props.isEditable}

apps/web/src/components/v2Editor/customBlocks/python/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ function PythonBlock(props: Props) {
511511
className={clsx(
512512
'text-sm font-sans font-medium pl-1 ring-gray-200 focus:ring-gray-400 block w-full rounded-md border-0 text-gray-800 hover:ring-1 focus:ring-1 ring-inset focus:ring-inset placeholder:text-gray-400 focus:ring-inset py-0 disabled:ring-0 h-2/3 bg-transparent focus:bg-white'
513513
)}
514-
placeholder="Python (click to add a title)"
514+
placeholder={props.isEditable ? "Python (click to add a title)" : "Python"}
515515
value={title}
516516
disabled={!props.isEditable}
517517
onChange={onChangeTitle}

apps/web/src/components/v2Editor/customBlocks/sql/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ function SQLBlock(props: Props) {
822822
className={clsx(
823823
'text-sm font-sans font-medium pl-1 ring-gray-200 focus:ring-gray-400 block w-full rounded-md border-0 text-gray-800 hover:ring-1 focus:ring-1 ring-inset focus:ring-inset placeholder:text-gray-400 focus:ring-inset py-0 disabled:ring-0 h-2/3 bg-transparent focus:bg-white'
824824
)}
825-
placeholder="SQL (click to add a title)"
825+
placeholder={props.isEditable ? "SQL (click to add a title)" : "SQL"}
826826
value={title}
827827
onChange={onChangeTitle}
828828
disabled={!props.isEditable}

apps/web/src/components/v2Editor/customBlocks/visualization/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ function VisualizationBlock(props: Props) {
685685
className={clsx(
686686
'text-sm font-sans font-medium pl-1 ring-gray-200 focus:ring-gray-400 block w-full rounded-md border-0 text-gray-800 hover:ring-1 focus:ring-1 ring-inset focus:ring-inset placeholder:text-gray-400 focus:ring-inset py-0 disabled:ring-0 h-2/3 bg-transparent focus:bg-white'
687687
)}
688-
placeholder="Visualization (click to add a title)"
688+
placeholder={props.isEditable ? "Visualization (click to add a title)" : "Visualization"}
689689
value={title}
690690
onChange={onChangeTitle}
691691
disabled={!props.isEditable}

apps/web/src/components/v2Editor/customBlocks/writeback/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function WritebackBlock(props: Props) {
247247
className={clsx(
248248
'text-sm font-sans font-medium pl-1 ring-gray-200 focus:ring-gray-400 block w-full rounded-md border-0 text-gray-800 hover:ring-1 focus:ring-1 ring-inset focus:ring-inset placeholder:text-gray-400 focus:ring-inset py-0 disabled:ring-0 h-2/3 bg-transparent focus:bg-white'
249249
)}
250-
placeholder="Writeback (click to add a title)"
250+
placeholder={props.isEditable ? "Writeback (click to add a title)" : "Writeback"}
251251
value={title}
252252
onChange={onChangeTitle}
253253
disabled={!props.isEditable}

0 commit comments

Comments
 (0)