Skip to content

Rename the toast button style props to Sonner's singular names - #7988

Open
zeyadrabie wants to merge 3 commits into
reflex-dev:mainfrom
zeyadrabie:toast-singular-button-style
Open

zeyadrabie wants to merge 3 commits into
reflex-dev:mainfrom
zeyadrabie:toast-singular-button-style

Conversation

@zeyadrabie

@zeyadrabie zeyadrabie commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7984 (follow-up to #7786).

Renamed action_button_styles and cancel_button_styles on ToastProps to action_button_style and cancel_button_style to match Sonner's keys directly, and removed the _TOAST_STYLE_PROP_ALIASES rename in dict().

  • The plural props stay declared (so NoExtrasAllowedProps still accepts them) and forward to the singular fields in __init__ with a console.deprecate warning (deprecated in 0.11.1, removed in 1.0).
  • If both the singular and plural name are passed for the same button, the singular one is used and the plural one still logs the deprecation warning.
  • Small behavior note: mutating props.action_button_styles after construction won't get renamed anymore since the dict() rename step is gone.
  • Added tests in test_toast.py, the two props in toast.md, a deprecation news fragment, and regenerated the stubs.

Ran pytest, ruff, and pyright (Linux platform) locally. The only failures were 17 symlink tests (WinError 1314) that also fail on main on Windows.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

View guided diff

Add action_button_style and cancel_button_style to ToastProps and
deprecate action_button_styles and cancel_button_styles. The plural
names still work until 1.0: each logs a deprecation warning and is
moved to the singular field. Passing both names for the same button
raises InvalidPropValueError. The serialize-time rename added in reflex-dev#7786
is no longer needed and is removed.

Closes reflex-dev#7984
@zeyadrabie
zeyadrabie requested review from a team and Alek99 as code owners November 25, 2026 00:24
@FarhanAliRaza FarhanAliRaza added breaking Public API facing change considered for minor release bump pre-v1.0 documentation Improvements or additions to documentation enhancement Anything you want improved labels Nov 25, 2026 — with ChatGPT Codex Connector
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issue was found in the latest changes.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found in the latest changes.

Summary

Renames toast button style props to action_button_style and cancel_button_style.

  • Toast button styles use Sonner’s singular option names.

Reviews (3) · Last reviewed commit: "Use the singular toast style when both n..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@codspeed

codspeed Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 146 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing zeyadrabie:toast-singular-button-style (e1c38b8) with main (6f5c39c)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

f"Pass only one of {name!r} and the deprecated {deprecated_name!r} "
f"to {component_name or type(self).__name__!r}."
)
raise InvalidPropValueError(msg)

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.

We are already renaming in old pr. So maybe now we should rename and show warning but it should work and not raise error for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, passing both now uses the singular one and just shows the deprecation warning.

Passing a deprecated plural toast style name together with its singular
replacement no longer raises. The plural name still logs the deprecation
warning, and the singular value is used.

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

breaking Public API facing change considered for minor release bump pre-v1.0 documentation Improvements or additions to documentation enhancement Anything you want improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename rx.toast action_button_styles / cancel_button_styles to match Sonner's singular option names

2 participants