Skip to content

Commit d9472f1

Browse files
Address greptile comments
1 parent de2c479 commit d9472f1

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

  • apps/sim
    • app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slack-setup-wizard
    • components/emcn/components/wizard

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slack-setup-wizard/slack-setup-wizard.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,14 @@ interface SecretInputProps {
396396
* Password-style input that masks its value with bullets only while the
397397
* field is unfocused. Typing, pasting, and selection all see the real text
398398
* so users can verify what they just pasted before clicking Next.
399+
*
400+
* @remarks
401+
* Change events that fire while the field is blurred carry the bullet
402+
* string as their value (autofill, form resets, synthetic React events),
403+
* which would silently overwrite the stored secret with `•` characters.
404+
* We gate the `onChange` callback on `isFocused` so only real edits — made
405+
* while the user is interacting and the displayed value is the real text —
406+
* propagate to the store.
399407
*/
400408
function SecretInput({ id, label, value, onChange, disabled, placeholder }: SecretInputProps) {
401409
const [isFocused, setIsFocused] = useState<boolean>(false)
@@ -410,7 +418,10 @@ function SecretInput({ id, label, value, onChange, disabled, placeholder }: Secr
410418
id={id}
411419
type='text'
412420
value={displayValue}
413-
onChange={(e) => onChange(e.target.value)}
421+
onChange={(e) => {
422+
if (!isFocused) return
423+
onChange(e.target.value)
424+
}}
414425
onFocus={() => setIsFocused(true)}
415426
onBlur={() => setIsFocused(false)}
416427
disabled={disabled}

apps/sim/components/emcn/components/wizard/wizard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ const WizardRoot: React.FC<WizardProps> = ({
157157
</ModalHeader>
158158

159159
<div className='flex gap-1.5 px-6 pb-4'>
160-
{steps.map((step, i) => (
160+
{steps.map((_step, i) => (
161161
<div
162-
key={step.props.title}
162+
key={i}
163163
className={cn(
164164
'h-1 flex-1 rounded-full transition-colors',
165165
i <= clamped ? 'bg-[var(--brand-secondary)]' : 'bg-[var(--surface-5)]'

0 commit comments

Comments
 (0)