Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2project specificStack: React
reactuxnotificationsconsistency
Use the shared toast utility for success and error feedback
Surface success/error messages through the app's Toast helper instead of ad-hoc UI, and only show a success toast when the design calls for it.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | if (error) setLocalError('Something went wrong'); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const Toast = useToast(); |
| 2 | if (error) Toast.error('Something went wrong'); |
Explanation (EN)
Objašnjenje (HR)