feat(filter): support field-qualified search terms#3044
Conversation
Tooltip was visible as long as the field had focus, feeling sticky while typing. Now shows on hover only (500 ms delay).
Search queries like `seed:aws-ha` or `-region:eu` now match against specific fields instead of all values.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughSearch parsing now supports field-qualified terms, exact matches, exclusions, and allowlisted fields. Table filtering now uses curried predicates, and shoot/seed search callers build keyed field maps before matching. The table search tooltip also disables focus-triggered opening and adds a 500ms delay. ChangesTable search behavior
Search tooltip
Sequence Diagram(s)sequenceDiagram
participant GShootList
participant useTableFilter
participant filterFn
GShootList->>useTableFilter: filteredItems computed
useTableFilter->>filterFn: filterFn(query)
filterFn-->>useTableFilter: item predicate
useTableFilter-->>GShootList: items.filter(predicate)
sequenceDiagram
participant GSeedList
participant parseSearch
participant SearchQuery
GSeedList->>parseSearch: parseSearch(query, QUALIFIED_SEARCH_FIELDS)
parseSearch-->>GSeedList: SearchQuery
GSeedList->>SearchQuery: matches(fields)
SearchQuery-->>GSeedList: boolean
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
frontend/src/composables/useTableFilter/index.js (1)
38-39: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winValidate the curried filter result before filtering.
Now that
filterFnis a factory, a stale caller can return a non-function and makeArray.prototype.filterthrow an unclear runtime error.Proposed guard
const predicate = filterFn(query) + if (typeof predicate !== 'function') { + throw new Error('useTableFilter: filterFn(query) must return a predicate function') + } return items.value.filter(predicate)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/composables/useTableFilter/index.js` around lines 38 - 39, The filter pipeline in useTableFilter is assuming filterFn(query) always returns a valid predicate, which can cause Array.prototype.filter to fail with a vague runtime error. Update the logic in the composable that builds the predicate to validate the curried result before calling items.value.filter, and handle the non-function case gracefully (for example by returning an empty result or a safe fallback) so stale callers do not break the table filtering flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/components/GTableSearch.vue`:
- Around line 8-12: The search syntax help tooltip in GTableSearch.vue is
becoming hover-only because open-on-focus is disabled on the v-tooltip
activator. Update the tooltip/activator wiring so keyboard and touch users can
still reveal the same help content, using the GTableSearch component’s search
input as the trigger and preserving an accessible non-hover interaction path.
In `@frontend/src/store/shoot/helper.js`:
- Around line 323-335: The search field map in helper.js is dropping the
existing workerless keyword handling, so searches for workerless no longer match
the intended shoots. Update the fields object built in the relevant
search/filter helper to include a derived workerless value alongside the
existing getRawVal entries, and make sure it is populated from the shoot/item
state used by the previous search path. Keep the change localized to the helper
logic that assembles searchable fields so existing keyword behavior is
preserved.
---
Nitpick comments:
In `@frontend/src/composables/useTableFilter/index.js`:
- Around line 38-39: The filter pipeline in useTableFilter is assuming
filterFn(query) always returns a valid predicate, which can cause
Array.prototype.filter to fail with a vague runtime error. Update the logic in
the composable that builds the predicate to validate the curried result before
calling items.value.filter, and handle the non-function case gracefully (for
example by returning an empty result or a safe fallback) so stale callers do not
break the table filtering flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5d0a1a81-6ce4-4d20-8df7-78fe702d08ac
📒 Files selected for processing (8)
frontend/__tests__/composables/useTableFilter/helper.spec.jsfrontend/__tests__/composables/useTableFilter/index.spec.jsfrontend/src/components/GTableSearch.vuefrontend/src/composables/useTableFilter/helper.jsfrontend/src/composables/useTableFilter/index.jsfrontend/src/store/shoot/helper.jsfrontend/src/views/GSeedList.vuefrontend/src/views/GShootList.vue
How to categorize this PR?
/area usability
/kind enhancement
What this PR does / why we need it:
Extends the shoot and seed list filters to support field-qualified search terms, e.g.
seed:aws-haor-region:eu.Also fixes the search hint tooltip, which was sticking open while the field had focus — now shows on hover only (500 ms delay).
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note:
Summary by CodeRabbit
New Features
field:value, quoted exact matches, negation, and more precise handling of empty values.Bug Fixes