Skip to content

ref(scraps): remove deprecated formatLabel option from slider#112690

Merged
TkDodo merged 6 commits intomasterfrom
tkdodo/ref/remove-deprecated-formatLabel
Apr 14, 2026
Merged

ref(scraps): remove deprecated formatLabel option from slider#112690
TkDodo merged 6 commits intomasterfrom
tkdodo/ref/remove-deprecated-formatLabel

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented Apr 10, 2026

No description provided.

@TkDodo TkDodo marked this pull request as ready for review April 10, 2026 17:28
@TkDodo TkDodo requested review from a team as code owners April 10, 2026 17:28
@TkDodo TkDodo requested a review from natemoo-re April 10, 2026 17:28
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 10, 2026
Comment thread static/app/components/core/slider/slider.tsx
Comment thread static/app/components/core/slider/slider.tsx
Copy link
Copy Markdown
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Thank you! ❤️

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 34e97f0. Configure here.

return (
<div className={className} ref={ref}>
{!showCustomInput && showLabel && <SliderLabel>{labelText}</SliderLabel>}
{!showCustomInput && <SliderLabel>{labelText}</SliderLabel>}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing showLabel causes unwanted label in volume sliders

Medium Severity

The showLabel prop was removed from RangeSlider, so the SliderLabel now always renders when !showCustomInput. In volumeSliders.tsx, showLabel={false} was previously passed to hide this label. Since showCustomInput isn't passed there either, the SliderLabel will now appear showing a raw numeric value (e.g. 5000000), which is redundant with the separately rendered VolumeAmount that already displays a nicely formatted version (e.g. "5M"). This is a visual regression on the checkout page.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 34e97f0. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i checked and it looks fine. actually looked broken before, see:

Screenshot 2026-04-10 at 20 12 41

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmm @natemoo-re what do you think, this is how it looks now:

Screenshot 2026-04-10 at 20 24 52

the 0 and 4 are a bit redundant, so is the 2 probably ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Definitely redundant—ideally we'd remove the custom "50,000 included" and "1M" to use the built-in label system and use formatOptions to display the "2" as "200K"?

Tricky because the value doesn't match what we're presenting...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@TkDodo I'm going to take this for a spin locally and see if I can refactor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ugh this is a pain to untangle, will have to pick it up on Monday.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mmm untangling this is more of a rabbit hole than anticipated. I will pick this up next week!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

oh I didn’t see your latest comments 😅 . What I did in this commit (e1257b3) is to allow formatOptions: 'hidden' for our slider to completely hide the label, as formatting to custom values with Intl.NumberFormatOptions is not really possible.

Waiting till next week if you have a better idea :)

Screenshot 2026-04-11 at 09 59 38

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@natemoo-re are you fine with this solution?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep I'm happy with this!

@TkDodo TkDodo merged commit ff568d2 into master Apr 14, 2026
65 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/remove-deprecated-formatLabel branch April 14, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants