feat(tracker): field-prefixed search, inline filter chips and zero-hit empty state - #10998
feat(tracker): field-prefixed search, inline filter chips and zero-hit empty state#10998MichaelUray wants to merge 2 commits into
Conversation
…t empty state Adds SearchInputAdvanced (field:value prefixes routed to Elasticsearch query_string), match highlighting, inline filter chips with overflow popover, a reusable zero-hit empty state in view-resources, and search-scope/highlight view options for List and Kanban. Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
| /** | ||
| * Allowed ES-native fields users may type directly. | ||
| * | ||
| * KEEP IN SYNC with elastic/src/adapter.ts KNOWN_FIELD_RE (and vice versa). |
There was a problem hiding this comment.
What do you think about refactoring it to ensure both sides use synced fields?
For example, add a small reusable package with common configs for server side and UI.
| // highlight toggles stay consistent across every viewlet that opts in. | ||
| const SEARCH_VIEW_OPTIONS: ViewOptionModel[] = [ | ||
| { | ||
| key: 'showQuickModeSelector', |
There was a problem hiding this comment.
Do I understand correctly that this isn't used in this PR, but will be used in Gantt charts?
| import { encodeSearch } from './SearchInputAdvanced.encoder' | ||
| import { propSyncValue } from './SearchInputAdvanced.sync' | ||
|
|
||
| describe('encodeSearch', () => { |
There was a problem hiding this comment.
I think it would be better to place tests in a separate __tests__ folder
| "SearchEmptyTitle": "No issues found for \"{query}\"", | ||
| "SearchEmptyActiveFilters": "Active filters: {filters}", | ||
| "SearchEmptyClearFilters": "Search without filters", | ||
| "SearchEmptyAllProjects": "Search in all projects" |
There was a problem hiding this comment.
I suggest to fix translations for this and other locales
| return '\\-' + tok.raw.slice(1).replace(/[+!(){}[\]^"~\\/:&|<>=]/g, '\\$&') | ||
| } | ||
| if (!PREFIX_VALUE_RESERVED_RE.test(tok.raw)) return tok.raw | ||
| return tok.raw.replace(/[+!(){}[\]^"~\\/:&|<>=]/g, '\\$&') |
There was a problem hiding this comment.
[minor] I suggest to move this regex to const
| // set by the fast query alone, so a stale slow-query result could skew the | ||
| // count right after a search changed. | ||
| onDestroy(() => { | ||
| resultIssueCountStore.set(-1) |
There was a problem hiding this comment.
resultIssueCountStore is a single global mutated by multiple viewlets.
List and Kanban both write it; IssuesView resets it to -1 on query/filter change. The -1 sentinel + onDestroy reset largely covers teardown races, but during a viewlet swap (List→Kanban) both can be briefly mounted and write competing counts.
Summary
Split out of #10992 following review feedback. This supersedes the closed #10872 with a clean branch based on current
developand contains only the shared search/filter work; no Gantt code.Adds
SearchInputAdvanced, match highlighting, inline filter chips with an overflow popover, a reusable zero-hit empty state inview-resources, and search-scope/highlight view options wired into List and Kanban.Known field prefixes are routed through Elasticsearch
query_string; queries without a recognized prefix retain the existingsimple_query_stringpath. Workspace and space access filtering remain unchanged.The exact head passed all required fork-CI jobs, including
uitest,uitest-pg,uitest-workspaces,uitest-qms,build,svelte-check,test,formatting, anddocker-build.The Gantt feature remains in #10992 and builds on this PR.