Skip to content

refactor(web): MessageCopyButton drops size and className props nobody passes - #28758

Open
only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/audit-m150
Open

only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/audit-m150

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

MessageCopyButton accepts optional size and className props and forwards them to Button, but no caller passes either one. Every copy button already renders at the default size="xs" with no extra class, so the props are unused API that suggests the button can be resized or restyled from outside.

Change

The two props, their types, and their forwarding are removed from apps/web/src/components/chat/MessageCopyButton.tsx. Button now gets size="xs" directly. label, icon, extraFlavors and variant are unchanged. One file, 1 line added, 6 removed.

Scope and approval

No issue. This is maintenance work with no behavior change: the button looks and works the same at every call site, so it needs no product-direction approval under CONTRIBUTING.md. If maintainers would rather keep the props for future callers, this PR can simply be closed.

Verification

  • Every call site on main was checked: TimelineAssistantRows.tsx:224, TimelineUserMessageRow.tsx:334, 336, 787, 800 and MessageCopyButton.browser.test.tsx:11. None passes size or className. The one spread (TimelineUserMessageRow.tsx:789) only adds extraFlavors. The mobile UserMessageCopyButton is a separate component.
  • Button receives the same props as before for every caller: size was always the "xs" default, and className was always undefined, which cn(buttonVariants(...)) treats the same as a missing prop.
  • vp run check:changed 1d626d02d9: format, lint, knip, typecheck (2 packages), the MessageCopyButton browser test and the React compiler check all pass.

No screenshots: nothing renders differently, because every caller already got these exact Button props.

Not checked:

  • The full CI test suites and the build.

Prior PRs

No open or closed PR makes this change. #13208 by juliusmarminge last reworked how this button forwards className and variant to Button. #12865 by saphid changed the action names, and #23679 by only21mil changed clipboard errors; neither changed these props.

Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly

…utton

No caller passed either prop, so the button now always renders at size xs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 1, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at add0139

Macroscope's review found this PR approvable — Removes unused copy-button customization props while preserving the existing size and behavior at all call sites. No product defaults or diagnostic suppressions change.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 3fd2b85 and add0139.

Files selected for processing: 1
  • apps/web/src/components/chat/MessageCopyButton.tsx

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

MessageCopyButton no longer accepts size or className props. Its button size is fixed to xs. Variant behavior remains unchanged.

Changes: Message copy button

Layer / File(s) Summary
Button props and fixed size
apps/web/src/components/chat/MessageCopyButton.tsx
The component no longer accepts size or className. The button always uses size xs; variant mapping is unchanged.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Refactor

Merge Risk: Minimal · up to add01

The change is limited to removing unused props and fixing the button size, with no identified merge-blocking risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: removing the unused size and className props from MessageCopyButton.
Description check Passed The description includes all required sections, explains the problem and change, documents scope and approval rationale, reports focused verification results, identifies unchecked full CI and build ch…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes all required sections, explains the problem and change, documents scope and approval rationale, reports focused verification results, identifies unchecked full CI and build checks, and explains why screenshots are not applicable.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant