Skip to content

fix(chat): fix secret-input chat widget reshaping after submit#5346

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-secret-reveal-chrome
Jul 2, 2026
Merged

fix(chat): fix secret-input chat widget reshaping after submit#5346
waleedlatif1 merged 1 commit into
stagingfrom
fix/chat-secret-reveal-chrome

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The chat "paste a secret" widget (e.g. pasting an ELEVENLABS_API_KEY) visibly changed shape right after submit
  • Root cause: the post-submit redacted state (SecretReveal) used bespoke h-9/rounded-md/px-2.5 chrome with an absolutely-positioned copy button, instead of the canonical chip-field chrome (h-[30px]/rounded-lg/px-2) that the pre-submit input (SecretInput) uses
  • Rebuilt SecretReveal on the same chipFieldSurfaceClass/chipFieldTextClass tokens as ChipInput, with the copy button as an inline trailing adornment instead of an absolute-positioned overlay
  • Same shared component is used in Settings → Copilot and the "create API key" modal, so those pick up the more consistent chip-field sizing too

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

SecretReveal (the post-submit redacted state) used bespoke h-9/rounded-md/px-2.5
chrome with an absolutely-positioned copy button, instead of the canonical
chip-field chrome (h-[30px]/rounded-lg/px-2) that SecretInput (the pre-submit
state) uses. That mismatch made the credential-paste widget visibly resize
right after saving. Rebuilt SecretReveal on the same chipFieldSurfaceClass
tokens as ChipInput, with the copy button as an inline trailing adornment.
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 2, 2026 1:16am

Request Review

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Presentational-only change in a shared UI component; copy behavior and redaction logic are unchanged.

Overview
Fixes a visible layout jump in the chat “paste a secret” flow when the widget switches from SecretInput to the redacted SecretReveal state after submit.

SecretReveal no longer uses one-off h-9 / rounded-md styling and an absolutely positioned copy control. It now composes chipFieldSurfaceClass and chipFieldTextClass (same tokens as ChipInput / SecretInput) in a h-[30px] flex row, with a smaller inline trailing copy button. Redacted and revealed states keep the same outer dimensions as the pre-submit field, so Settings Copilot and API-key modals that reuse this component get consistent chip-field sizing too.

Reviewed by Cursor Bugbot for commit 245431e. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a visual reshaping glitch in the chat widget's secret-input field: after submitting a secret (e.g. an API key), the post-submit SecretReveal component used different sizing tokens (h-9, rounded-md, px-2.5) than the pre-submit SecretInput (h-[30px], rounded-lg, px-2), causing a visible layout jump.

  • SecretReveal is rebuilt on the canonical chipFieldSurfaceClass / chipFieldTextClass tokens from chip-chrome.ts, matching ChipInput's geometry exactly.
  • The copy button moves from an absolutely-positioned overlay to an inline flex trailing adornment (size-[18px], flex-shrink-0), and w-full is added so the container always stretches to fill its parent.

Confidence Score: 5/5

Safe to merge — the change is a pure visual alignment fix with no logic alterations and no new dependencies beyond the already-present chip-chrome token file.

The only changed file swaps out hard-coded Tailwind classes for shared design tokens; the component's copy-to-clipboard behaviour, redaction logic, and props interface are all untouched. The new w-full is the only behavioural addition and is appropriate for a field component used in full-width layout contexts.

No files require special attention.

Important Files Changed

Filename Overview
packages/emcn/src/components/secret-reveal/secret-reveal.tsx Replaces bespoke height/border/padding chrome with shared chipFieldSurfaceClass + chipFieldTextClass tokens, moves copy button from absolute positioning to inline flex, and adds w-full. Logic is unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SecretReveal rendered] --> B{isHidden?\nredacted=true OR !value}
    B -- Yes --> C[Show REDACTED_DOTS\ntext-muted color\nNo copy button]
    B -- No --> D[Show actual value\ntext-body color]
    D --> E[Inline copy Button\nsize-18px, flex-shrink-0]
    E --> F{copied?}
    F -- Yes --> G[Check icon\nsize-14px]
    F -- No --> H[Duplicate icon\nsize-14px]

    style C fill:#f0f0f0
    style D fill:#e8f4e8
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[SecretReveal rendered] --> B{isHidden?\nredacted=true OR !value}
    B -- Yes --> C[Show REDACTED_DOTS\ntext-muted color\nNo copy button]
    B -- No --> D[Show actual value\ntext-body color]
    D --> E[Inline copy Button\nsize-18px, flex-shrink-0]
    E --> F{copied?}
    F -- Yes --> G[Check icon\nsize-14px]
    F -- No --> H[Duplicate icon\nsize-14px]

    style C fill:#f0f0f0
    style D fill:#e8f4e8
Loading

Reviews (1): Last reviewed commit: "fix(chat): fix secret-input chat widget ..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 26fb687 into staging Jul 2, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/chat-secret-reveal-chrome branch July 2, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant