Skip to content

Commit a827723

Browse files
priscilawebdevcodex
andcommitted
ref(feedback): Align tooltip defaults with page-frame
Use page-frame as the single default tooltip path for FeedbackButton and keep non-page-frame behavior unchanged unless callers provide their own tooltip. This matches the agreed scope and removes the extra icon-only branching from the shared component. Refs DE-1104 Co-Authored-By: OpenAI Codex <noreply@openai.com>
1 parent 8442986 commit a827723

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

static/app/components/feedbackButton/feedbackButton.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ export function FeedbackButton({feedbackOptions, ...buttonProps}: Props) {
6363
}
6464

6565
const defaultLabel = t('Give Feedback');
66-
const isIconOnly = buttonProps.children === null;
67-
const children = isIconOnly ? null : (buttonProps.children ?? defaultLabel);
68-
const ariaLabel = buttonProps['aria-label'] ?? (isIconOnly ? defaultLabel : undefined);
69-
const tooltipTitle =
66+
const children = buttonProps.children ?? (hasPageFrameFeature ? null : defaultLabel);
67+
const label =
7068
buttonProps['aria-label'] ?? (typeof children === 'string' ? children : defaultLabel);
7169
const tooltipProps =
72-
buttonProps.tooltipProps?.title || (!hasPageFrameFeature && !isIconOnly)
70+
buttonProps.tooltipProps?.title || !hasPageFrameFeature
7371
? buttonProps.tooltipProps
74-
: {...buttonProps.tooltipProps, title: tooltipTitle};
72+
: {...buttonProps.tooltipProps, title: label};
7573

7674
return (
7775
<Button
@@ -80,7 +78,7 @@ export function FeedbackButton({feedbackOptions, ...buttonProps}: Props) {
8078
icon={<IconMegaphone />}
8179
{...buttonProps}
8280
tooltipProps={tooltipProps}
83-
aria-label={ariaLabel}
81+
aria-label={children === null ? label : buttonProps['aria-label']}
8482
onClick={e => {
8583
openForm?.(feedbackOptions);
8684
buttonProps.onClick?.(e);

0 commit comments

Comments
 (0)