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 ruleP2universalStack: javascript
searchuxperformanceinput
Require a minimum query length before firing a search
Gate search/autocomplete requests behind a minimum input length to avoid noisy, useless queries.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | input.onChange = e => search(e.target.value); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | input.onChange = e => { |
| 2 | if (e.target.value.length > 2) search(e.target.value); |
| 3 | }; |
Explanation (EN)
Objašnjenje (HR)