SearchBar: Accept otherwise invalid input as quick search expression#353
Merged
SearchBar: Accept otherwise invalid input as quick search expression#353
SearchBar: Accept otherwise invalid input as quick search expression#353Conversation
This is required for the following to work: (Icinga DB Web's hosts list) * Paste `state.soft_state=1|host.name=docker-master` into the searchbar * Change *Host Soft State* to *Host Soft Statee* without pushing enter * Add another condition, any will do, complete it, wait for the autosubmit * The changed column should now be reported as invalid Previously, the steps above resulted in an stacktrace as the invalid column was passed on to the ORM.
04cdc84 to
3587d69
Compare
There was a problem hiding this comment.
Pull request overview
Enhances SearchBar validation and filter parsing to support treating otherwise-invalid input as a “quick search” expression, reducing user pitfalls when suggestions are slow or absent (issue #352).
Changes:
- Extended
Parser/ParseExceptionhandling (incl. explicit EOL reporting) and added multiple parser regression tests. - Updated
SearchBarto optionally transform certain invalid single-term expressions into a multi-column quick search filter. - Improved client-side validation pattern generation for
ValidatedTermand wired search columns from ORM models intoSearchBar.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ParserTest.php | Adds coverage for additional parse error scenarios and adjusts expected positions/messages. |
| src/Filter/Parser.php | Refines parse error positioning/EOL behavior and detects invalid operators in column expressions. |
| src/Control/SearchBar/ValidatedTerm.php | Tightens default HTML pattern logic and adds escaping helper for pattern fragments. |
| src/Control/SearchBar.php | Implements quick-search fallback behavior and improves parse-error UX/field feedback. |
| src/Compat/SearchControls.php | Supplies model search columns to SearchBar and improves invalid-column handling for edge relations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3587d69 to
91221e2
Compare
Jan-Schuppik
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Noticed a few other glitches regarding validation, and needed to enhance it anyway since we have to make sure we don't use a valid expression as quick filter.
resolves #352