Repository navigation
Rename the toast button style props to Sonner's singular names - #7988
zeyadrabie wants to merge 3 commits into
Conversation
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
[Medium impact] The PR appears safe to merge; no actionable issue was found in the latest changes. SummaryRenames toast button style props to
Reviews (3) · Last reviewed commit: "Use the singular toast style when both n..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
| 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Closes #7984 (follow-up to #7786).
Renamed
action_button_stylesandcancel_button_stylesonToastPropstoaction_button_styleandcancel_button_styleto match Sonner's keys directly, and removed the_TOAST_STYLE_PROP_ALIASESrename indict().NoExtrasAllowedPropsstill accepts them) and forward to the singular fields in__init__with aconsole.deprecatewarning (deprecated in 0.11.1, removed in 1.0).props.action_button_stylesafter construction won't get renamed anymore since thedict()rename step is gone.test_toast.py, the two props intoast.md, a deprecation news fragment, and regenerated the stubs.Ran
pytest,ruff, andpyright(Linux platform) locally. The only failures were 17 symlink tests (WinError 1314) that also fail onmainon Windows.All Submissions:
Type of change