Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 36 additions & 144 deletions src/__tests__/components/__snapshots__/Buttons.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4102,17 +4102,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Medium",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -4259,17 +4251,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -4386,17 +4370,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#00f1a2",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -4543,17 +4519,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Medium",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -4700,17 +4668,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -4827,17 +4787,9 @@ exports[`Buttons should render spinning buttons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#00f1a2",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
null,
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6041,19 +5993,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Medium",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6238,19 +6180,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6405,19 +6337,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#00f1a2",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6602,19 +6524,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Medium",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6799,19 +6711,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#FFFFFF",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down Expand Up @@ -6966,19 +6868,9 @@ exports[`Buttons should render with child icons 1`] = `
"fontSize": 22,
"includeFontPadding": false,
},
[
{
"includeFontPadding": false,
},
{
"color": "#00f1a2",
"fontFamily": "Quicksand-Regular",
"fontSize": 22,
},
{
"marginLeft": 11,
},
],
{
"opacity": 0,
},
null,
]
}
Expand Down
25 changes: 16 additions & 9 deletions src/components/buttons/EdgeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,19 @@ export function EdgeButton(props: Props): React.ReactElement | null {
)}
{label == null ? null : (
<EdgeText
style={[
styles.labelBase,
type === 'primary'
? styles.labelPrimary
: type === 'secondary'
? styles.labelSecondary
: styles.labelTertiary,
children == null ? null : styles.labelWithIcon
]}
style={
spinner || pending
? styles.labelInvisible
: [
styles.labelBase,
type === 'primary'
? styles.labelPrimary
: type === 'secondary'
? styles.labelSecondary
: styles.labelTertiary,
children == null ? null : styles.labelWithIcon
]
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent Visibility in Spinner/Pending States

The button's label now hides on spinner || pending, but the contentRowStyle (for icons/children) only hides on spinner. This inconsistency leaves icons visible alongside the spinner overlay when pending is true, while the label is hidden. Additionally, the labelInvisible style replaces labelBase, potentially losing includeFontPadding: false and causing subtle layout shifts.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I fully understand this AI comment, but it might be worth double-checking.

numberOfLines={1}
adjustsFontSizeToFit
minimumFontScale={0.65}
Expand Down Expand Up @@ -281,6 +285,9 @@ const getStyles = cacheStyles((theme: Theme) => {
fontFamily: theme.escapeButtonFont,
fontSize: theme.rem(theme.escapeButtonFontSizeRem)
},
labelInvisible: {
opacity: 0
},
spinnerOverlay: {
...StyleSheet.absoluteFillObject,
alignItems: 'center',
Expand Down
Loading