Skip to content

Commit 2ba2484

Browse files
authored
fix(editor): restore caret alignment and the intended type scale across the panel (#6297)
* fix(editor): restore caret alignment and the intended type scale across the panel Four distinct defects, all surfaced while testing the workflow editor. **Caret drift in the Start block's Description field.** Its overlay mirror was built differently from every sibling field: `overflow-hidden` + `truncate` and no scroll synchronisation, where the working fields use `overflow-x-auto` + `whitespace-pre` + `syncOverlayScroll`. Once the value passed the visible width the input scrolled and carried the caret with it while the overlay stayed pinned at the first character, so the gap grew as you typed. It now has the same plumbing as its siblings, on its own ref maps so it cannot collide with the value overlay. **Overlay mirrors left at 500 over 400 inputs.** #6291 dropped emcn Input and Textarea to the inherited weight, but the canvas files that mirror them were reverted from that PR, so 11 overlays kept a hardcoded `font-medium`. A mirror that renders heavier than the input beneath it misaligns by the weight delta on every character. All 11 realigned. **Input text tracking differently from its label.** The UA stylesheet resets form controls to `letter-spacing: normal`, so inside `.workspace-root` (0.02em) an input diverged from surrounding text — and from its own overlay — by 0.28px per character. emcn Input and Textarea now carry `[letter-spacing:inherit]`, which fixes every mirrored input at the source rather than per call site. **Weights and type sizes that changed meaning under #6241.** That PR deleted the tailwind remap of `font-medium` (440 light / 480 dark) without migrating the ~505 call sites written against it, so untouched code jumped to a stock 500. The panel's editor, toolbar, chat and connections surfaces are swept back to the inherited weight. The Chat header was also visibly taller than Toolbar and Editor purely because it used `text-[14px]` — font-size with no paired line-height — against otherwise byte-identical containers; it and the panel's two other arbitrary sizes now use named tokens. Also fixes five JSX conditionals in the workflow MCP settings page that had lost their braces, so `canManage && ()` rendered as literal text under the server detail tab. Verified: typecheck 0, biome clean, 18644/18645 vitest passing (the one failure is a missing `rg` binary and predates this branch). * fix(emcn): give chip text fields the same tracking as their mirrors An audit of the previous commit found the letter-spacing fix was incomplete: it landed on `Input`/`Textarea` but not on the chip family, so `ChipInput` and `ChipTextarea` kept the UA `letter-spacing: normal` while any overlay mirroring them inherited the ambient tracking. The MCP server form modal is a live instance — its shared `FormattedInput` layers a transparent `ChipInput` under a visible div, across the server URL and both header fields, whose values are long by nature. The caret separated from the text by roughly 0.28px per character. Fixed on `chipFieldTextClass` rather than the call site, so every chip field matches its mirror the way `Input`/`Textarea` already do. * fix(editor): restore the strong-text variant a class sweep welded together The font-weight sweep in 94c9f1f used a blanket sed, which turned [&_strong]:font-medium [&_strong]:text-[var(--text-primary)] into [&_strong]:[&_strong]:text-[var(--text-primary)] — a chained variant matching a <strong> inside a <strong>, so ordinary strong text in trigger setup instructions lost its color. The removed weight was also load-bearing rather than decorative. Preflight sets b/strong to font-weight: bolder, so against a 400 body a bare <strong> lands near 700; the class was holding it down to 500. Deleting it made that text heavier, the inverse of the sweep's intent — the same UA-default trap as <th>. Both variants are restored. Swept for the same damage: no chained [&…]:[&…] variants remain across apps/sim or packages, and this was the only variant-scoped weight the sed touched. Found independently by Greptile and Cursor Bugbot.
1 parent 0bef1c3 commit 2ba2484

36 files changed

Lines changed: 374 additions & 339 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/workflow-mcp-servers/workflow-mcp-servers.tsx

Lines changed: 223 additions & 219 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export function McpDeploy({
503503
return (
504504
<>
505505
<div className='flex h-full flex-col items-center justify-center gap-3'>
506-
<p className='text-[13px] text-[var(--text-muted)]'>
506+
<p className='text-[var(--text-muted)] text-small'>
507507
Create an MCP Server to expose your workflows as tools.
508508
</p>
509509
<Button variant='tertiary' onClick={() => setShowCreateModal(true)}>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/connection-blocks/components/field-item/field-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function FieldItem({
9292
>
9393
<span
9494
className={clsx(
95-
'min-w-0 flex-1 truncate font-medium',
95+
'min-w-0 flex-1 truncate',
9696
'text-[var(--text-secondary)] group-hover:text-[var(--text-primary)]'
9797
)}
9898
>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/connection-blocks/connection-blocks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function ConnectionItem({
161161
</div>
162162
<span
163163
className={clsx(
164-
'truncate font-medium',
164+
'truncate',
165165
'text-[var(--text-secondary)] group-hover:text-[var(--text-primary)]'
166166
)}
167167
>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function CheckboxItem({
7878
/>
7979
<Label
8080
htmlFor={`${blockId}-${option.id}`}
81-
className='cursor-pointer font-medium font-sans text-[var(--text-primary)] text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50'
81+
className='cursor-pointer font-sans text-[var(--text-primary)] text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50'
8282
>
8383
{formatDisplayText(option.label, { workflowSearchHighlight })}
8484
</Label>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ export function ConditionInput({
955955
: 'rounded-t-[4px] border-[var(--border-1)] border-b'
956956
)}
957957
>
958-
<span className='font-medium text-[var(--text-tertiary)] text-sm'>
958+
<span className='text-[var(--text-tertiary)] text-sm'>
959959
{isRouterMode ? `Route ${index + 1}` : block.title}
960960
</span>
961961
<div className='flex items-center gap-2'>
@@ -1105,7 +1105,7 @@ export function ConditionInput({
11051105
}}
11061106
placeholder='Describe when this route should be taken...'
11071107
disabled={disabled || isPreview}
1108-
className='min-h-[100px] resize-none rounded-none border-0 px-3 py-2 text-sm text-transparent caret-foreground placeholder:text-muted-foreground/50 focus-visible:ring-0 focus-visible:ring-offset-0'
1108+
className='min-h-[100px] resize-none rounded-none border-0 px-3 py-2 text-sm text-transparent caret-foreground [letter-spacing:inherit] placeholder:text-muted-foreground/50 focus-visible:ring-0 focus-visible:ring-offset-0'
11091109
rows={4}
11101110
style={{ height: `${getRouterHeight(block.id)}px` }}
11111111
/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export function CredentialSelector({
453453

454454
{needsUpdate && (
455455
<div className='mt-2 flex flex-col gap-1 rounded-sm border bg-[var(--surface-2)] px-2 py-1.5'>
456-
<div className='flex items-center font-medium text-caption'>
456+
<div className='flex items-center text-caption'>
457457
<span className='mr-1.5 inline-block size-[6px] rounded-xs bg-amber-500' />
458458
Additional permissions required
459459
</div>
@@ -471,7 +471,7 @@ export function CredentialSelector({
471471
})
472472
setShowOAuthModal(true)
473473
}}
474-
className='w-full px-2 py-1 font-medium text-caption'
474+
className='w-full px-2 py-1 text-caption'
475475
>
476476
Update access
477477
</Button>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function DocumentTagEntry({
211211
const tagCount = tags.filter((t) => t.tagName?.trim()).length
212212
return (
213213
<div className='space-y-1'>
214-
<Label className='font-medium text-muted-foreground text-xs'>Document Tags</Label>
214+
<Label className='text-muted-foreground text-xs'>Document Tags</Label>
215215
<div className='text-muted-foreground text-sm'>
216216
{tagCount > 0 ? `${tagCount} tag(s) configured` : 'No tags'}
217217
</div>
@@ -223,7 +223,7 @@ export function DocumentTagEntry({
223223
return (
224224
<div className='flex h-32 items-center justify-center rounded-sm border border-[var(--border-1)] border-dashed bg-[var(--surface-3)] dark:bg-[var(--code-bg)]'>
225225
<div className='text-center'>
226-
<p className='font-medium text-[var(--text-secondary)] text-sm'>
226+
<p className='text-[var(--text-secondary)] text-sm'>
227227
No tags defined for this knowledge base
228228
</p>
229229
<p className='mt-1 text-[var(--text-muted)] text-xs'>
@@ -250,7 +250,7 @@ export function DocumentTagEntry({
250250
}}
251251
>
252252
<div className='flex min-w-0 flex-1 items-center gap-2'>
253-
<span className='block truncate font-medium text-[var(--text-tertiary)] text-sm'>
253+
<span className='block truncate text-[var(--text-tertiary)] text-sm'>
254254
{tag.collapsed ? tag.tagName || `Tag ${index + 1}` : `Tag ${index + 1}`}
255255
</span>
256256
{tag.collapsed && tag.tagName && (
@@ -334,14 +334,14 @@ export function DocumentTagEntry({
334334
disabled={isReadOnly}
335335
autoComplete='off'
336336
placeholder={placeholder}
337-
className='allow-scroll w-full overflow-auto text-transparent caret-foreground'
337+
className='allow-scroll w-full overflow-auto text-transparent caret-foreground [letter-spacing:inherit]'
338338
/>
339339
<div
340340
ref={(el) => {
341341
if (el) overlayRefs.current[cellKey] = el
342342
}}
343343
className={cn(
344-
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 font-medium font-sans text-sm',
344+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 font-sans text-sm',
345345
!isReadOnly && 'pointer-events-none'
346346
)}
347347
>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function EvalInput({
139139

140140
const renderMetricHeader = (metric: EvalMetric, index: number) => (
141141
<div className='flex items-center justify-between overflow-hidden rounded-t-[4px] border-[var(--border-1)] border-b bg-[var(--surface-4)] px-2.5 py-[5px]'>
142-
<span className='font-medium text-[var(--text-tertiary)] text-sm'>Metric {index + 1}</span>
142+
<span className='text-[var(--text-tertiary)] text-sm'>Metric {index + 1}</span>
143143
<div className='flex items-center gap-2'>
144144
<Tooltip.Root key={`add-${metric.id}`}>
145145
<Tooltip.Trigger asChild>
@@ -194,7 +194,7 @@ export function EvalInput({
194194
onChange={(e) => updateMetric(metric.id, 'name', e.target.value)}
195195
placeholder='Accuracy'
196196
disabled={isPreview || disabled}
197-
className='text-transparent caret-foreground placeholder:text-muted-foreground/50'
197+
className='text-transparent caret-foreground [letter-spacing:inherit] placeholder:text-muted-foreground/50'
198198
/>
199199
<div
200200
className={cn(
@@ -244,7 +244,7 @@ export function EvalInput({
244244
placeholder='How accurate is the response?'
245245
disabled={isPreview || disabled}
246246
className={cn(
247-
'min-h-[80px] whitespace-pre-wrap text-transparent caret-foreground'
247+
'min-h-[80px] whitespace-pre-wrap text-transparent caret-foreground [letter-spacing:inherit]'
248248
)}
249249
rows={3}
250250
/>
@@ -253,7 +253,7 @@ export function EvalInput({
253253
if (el) descriptionOverlayRefs.current[metric.id] = el
254254
}}
255255
className={cn(
256-
'absolute inset-0 overflow-auto bg-transparent px-2 py-2 font-medium font-sans text-[var(--code-foreground)] text-sm',
256+
'absolute inset-0 overflow-auto bg-transparent px-2 py-2 font-sans text-[var(--code-foreground)] text-sm',
257257
!(isPreview || disabled) && 'pointer-events-none'
258258
)}
259259
>
@@ -300,9 +300,9 @@ export function EvalInput({
300300
autoComplete='off'
301301
data-form-type='other'
302302
name='eval-range-min'
303-
className='text-transparent caret-foreground'
303+
className='text-transparent caret-foreground [letter-spacing:inherit]'
304304
/>
305-
<div className='pointer-events-none absolute inset-0 flex items-center truncate px-2 py-1.5 font-medium font-sans text-sm'>
305+
<div className='pointer-events-none absolute inset-0 flex items-center truncate px-2 py-1.5 font-sans text-sm'>
306306
{formatDisplayText(String(metric.range.min ?? ''), {
307307
workflowSearchHighlight: getMetricSearchHighlight(index, ['range', 'min']),
308308
})}
@@ -321,9 +321,9 @@ export function EvalInput({
321321
autoComplete='off'
322322
data-form-type='other'
323323
name='eval-range-max'
324-
className='text-transparent caret-foreground'
324+
className='text-transparent caret-foreground [letter-spacing:inherit]'
325325
/>
326-
<div className='pointer-events-none absolute inset-0 flex items-center truncate px-2 py-1.5 font-medium font-sans text-sm'>
326+
<div className='pointer-events-none absolute inset-0 flex items-center truncate px-2 py-1.5 font-sans text-sm'>
327327
{formatDisplayText(String(metric.range.max ?? ''), {
328328
workflowSearchHighlight: getMetricSearchHighlight(index, ['range', 'max']),
329329
})}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function FilterRuleRow({
114114
}}
115115
>
116116
<div className='flex min-w-0 flex-1 items-center gap-2'>
117-
<span className='block truncate font-medium text-[var(--text-tertiary)] text-sm'>
117+
<span className='block truncate text-[var(--text-tertiary)] text-sm'>
118118
{rule.collapsed && rule.column
119119
? formatDisplayText(getColumnLabel(rule.column), {
120120
workflowSearchHighlight: getLabelHighlight('column', getColumnLabel(rule.column)),
@@ -175,12 +175,12 @@ export function FilterRuleRow({
175175
disabled={isReadOnly}
176176
autoComplete='off'
177177
placeholder='Enter value'
178-
className='allow-scroll w-full overflow-auto text-transparent caret-foreground'
178+
className='allow-scroll w-full overflow-auto text-transparent caret-foreground [letter-spacing:inherit]'
179179
/>
180180
<div
181181
ref={overlayRef}
182182
className={cn(
183-
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 font-medium font-sans text-sm',
183+
'absolute inset-0 flex items-center overflow-x-auto bg-transparent px-2 py-1.5 font-sans text-sm',
184184
!isReadOnly && 'pointer-events-none'
185185
)}
186186
>

0 commit comments

Comments
 (0)