Skip to content

AI mode: global search (⌘K) - #38564

Merged
Rohit0301 merged 15 commits into
mainfrom
Rohit0301/collateai-global-search
Nov 26, 2026
Merged

Rohit0301 merged 15 commits into
mainfrom
Rohit0301/collateai-global-search

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What changes

AI mode gets a global search modal (⌘K), built from the design prototype:

  • Open: ⌘K from anywhere, the new sidebar Search button, or the rail search icon. ⌘K does nothing while it is open.
  • Before typing: no filter bar; Recent searches (removable), Recently viewed (3), plus a plugin's recent rows (Collate: recent chats).
  • While typing: a tab per type that matched (data assets, tasks, glossary, people, domains, data products, Context Center, plus plugin types), ordered by hit count, up to 5 and a "+N more" menu. A tab that drops to zero falls back to All.
  • Data assets: all 10 facets with counts, sort and reverse, an asset summary panel (first Enter previews, second opens), and "Open N results in Explore", which carries the query, facets and sort.
  • Tasks: Status and Type filters, rows open the inbox task.
  • Keyboard: ⌘K / Ctrl+K opens it (and does nothing while open). ↑↓ move (the first result is highlighted; ↑ reaches a plugin's action row), ↵ opens the highlighted result, ⌘↵ / Ctrl+↵ runs the plugin's query action (a plain ↵ never does), Tab/⇧Tab switch tabs, Backspace on an empty input widens a type tab to All (never closes), Esc closes search from anywhere in the dialog (the Clear button clears). Enter and Esc are left to an IME while it composes.
  • States: skeleton tabs and rows until a query's first results arrive; typing more shows only the spinner and loading line; a tab, filter or sort change shows skeleton rows; error card with retry whenever a request failed and the view is empty; empty states; active domain chip. Each type tab's filters stay on one line and scroll sideways.

Extension points (utils/extensionPoints.ts):

  • app-mode.globalSearch.sources: a plugin adds a result type (search, recent rows, footer link).
  • app-mode.globalSearch.queryAction: a plugin adds an action row on the typed query (Collate: "Ask Collate AI") and where it opens.

Plugins pass their own i18n keys for that text, so OpenMetadata ships no assistant or chat wording. Without contributions, the search covers OpenMetadata's types only. Contract recorded in ADR:2026-11-24-global-search-sources-and-query-action-extension-points.

Design-system notes

  • AssetSummaryPanel is not Explore's EntitySummaryPanel. Reusing Explore's section components (DomainsSection, TagsSection, GlossaryTermsSection) brought their own padding and dividers, which broke the modal's compact layout in design review. The panel keeps its label-and-value layout but renders Explore's own pieces inside it: core Owner avatars, DomainTags, GlossaryTag and ClassificationTag.
  • The sidebar search trigger is a react-aria Button, not core Button. It opens the search (a real button, so focus returns to it when the modal closes), but it has to look like the prototype's search field: a field border that darkens on hover, a leading icon, and a filled shortcut key. Core Button has no field shape and core Input is a text field, so neither draws it without overriding core styles.

Tests

  • GlobalSearch.utils.test.ts: tab ordering and overflow, highlighting, quickFilter, sort and order carried to Explore.

  • GlobalSearchModal.test.tsx: ⌘K open with recents only, tabs only for matched types, Explore hand-off, Ask row with ⌘↵ and contributed labels, ⌥⌘K chats-only mode, Esc and Backspace behaviour.

  • AI-shell and Explore header suites pass. ESLint, Prettier, tw-audit and yarn i18n are clean.

  • playwright/e2e/Features/AIMode/GlobalSearch.spec.ts (5 user flows against a real server): data asset preview then open, glossary term and domain routing, Explore hand-off with query and sort, recent searches after a reload, recently viewed reopening a page. 5/5 passed locally (--no-deps, no retries).

Screen recording

Recorded at OpenMetadata d769010d4c6 (this branch's head) against the local Docker stack: collate_server_gs (server 2.0.0-SNAPSHOT, revision bb2eb6ee327), openmetadata_mysql and openmetadata_elasticsearch, all up and healthy. This PR changes only the UI; the UI was served by Vite from the PR commit and proxied to that server, so the backend image was not rebuilt.

Data: the stack's existing sample data, plus a small fixture created through the API:

  • snowflake_demo.SALES_DB.PUBLIC.dim_customer: owner Riya Kapoor, PII.Sensitive, glossary term BusinessGlossary.Customer, domain Customer 360.
  • Tasks TASK-00001 and TASK-00002 that match "customer".
omd-global-search.webm

Shown, in order:

  1. A visited table appears under Recently viewed; the sidebar Search field opens the search with recents only and no tab bar. Esc closes it.
  2. ⌘K opens it; typing shows skeleton tabs and rows, then tabs for the matched types by count, with All grouped and "See all N".
  3. ↑/↓, Tab/⇧Tab across tabs; typing more refines in place (spinner and progress line only).
  4. Data assets tab: its filters on one line, scrolled sideways; sort by name (skeleton rows); first pick opens the preview (stats, owner avatar, domain, glossary term and tag chips).
  5. "Open 16 results in Explore" lands on Explore with the query, filters and sort.
  6. A recent search reruns from the empty state; the Tasks tab with its Status filter.
  7. Clear resets everything; a no-match query shows the empty state; Esc closes. (The recording predates ff01898062f and shows the earlier clear-then-close Esc; Esc now closes in one press.)
  8. ↵ opens the highlighted first result's page.

The recording browser is not detected as a Mac, so key labels read "Ctrl" where a Mac shows "⌘".

Screenshots
Before typing: recents, no tab bar Skeleton tabs and rows while the first results load
Tabs by count, All grouped with See all Data assets filters on one line, sort
Asset preview: stats, owners, domain, glossary term, tag Explore opened with the query, filters and sort
Recent searches Tasks tab with its filters
No results

Playwright run

playwright/e2e/Features/AIMode/GlobalSearch.spec.ts against the same stack (--no-deps, no retries): 5 passed, 0 failed, 0 flaky.

Playwright HTML report: 5 passed

🤖 Generated with Claude Code

Adds the AI-mode global search modal: results across data assets, tasks,
glossary, people, domains, data products and Context Center, with per-type
tabs ordered by hit count, asset facets and sort, an asset summary panel,
and an Explore hand-off that carries the query, filters and sort.

Plugins add result types and the assistant hand-off through the new
app-mode.globalSearch.sources and app-mode.globalSearch.askAi extension
points, and supply their own wording.
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

UI browser tests

Ran: all test files (changed translation keys not found in any test footprint)

Result: ✅ 1099 passed · 154 skipped

Changed code executed by these browser tests: 3 / 3 lines (100%)

File Changed lines Executed %
src/components/Explore/ExploreQuickFilters.tsx 2 2 100%
src/rest/tasksAPI.ts 1 1 100%
Changed files no browser test loads
  • src/components/Explore/ExploreQuickFilters.interface.ts
  • src/components/discovery/personal-space/InboxPage/taskDetail.utils.ts
  • src/components/discovery/personal-space/InboxPage/taskLabel.utils.ts
  • src/components/discovery/personal-space/InboxPage/taskResolution.utils.ts
  • src/components/platform/ai-shell/AppShell.tsx
  • src/components/platform/ai-shell/GlobalSearch/AssetSummaryPanel.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearch.constants.ts
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearch.types.ts
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearch.utils.ts
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchFilterBar.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchFilterBar.utils.ts
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchFooter.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchInput.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchModal.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchMoreTabs.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchPanel.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchResultList.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchResultRow.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchTabBar.tsx
  • src/components/platform/ai-shell/GlobalSearch/GlobalSearchTaskBar.tsx
  • src/components/platform/ai-shell/GlobalSearch/useAssetSummaryStats.ts
  • src/components/platform/ai-shell/GlobalSearch/useGlobalSearchItems.tsx
  • src/components/platform/ai-shell/GlobalSearch/useGlobalSearchResults.tsx
  • src/components/platform/ai-shell/GlobalSearch/useGlobalSearchStore.ts
  • src/components/platform/ai-shell/GlobalSearch/useSourceRecents.ts
  • src/components/platform/ai-shell/Sidebar/MainPanel.tsx
  • src/components/platform/ai-shell/Sidebar/Rail.tsx
  • src/components/platform/ai-shell/Sidebar/SidebarSearchButton.tsx
  • src/components/platform/ai-shell/appModeExtensions.ts

- Tabs for every matched type from the search API, overflow slot for +N more
- Per-type quick filters, sort carried to Explore, Clear resets everything
- Typing shows spinner + line loader; tab/filter/sort changes show skeletons
- Rows only close the modal when they navigate
- Query action replaces the Ask AI extension point; plugins own the copy
- Decision record for the global search extension points
- Unit tests for every new file
- A tab emptied by the user's own filter stays selected so the filter can be undone
- Facets apply to the data asset query only on the assets tab
- Fix the modal test suite failing to load on a DomainUtils import cycle
- Data asset preview then open, glossary term and domain routing
- Explore hand-off keeps the query and sort
- Recent searches survive a reload, recently viewed reopens a page
- Show Ctrl+K / Ctrl+Alt+K / Ctrl+Enter off Apple devices; the handler already accepted both
- Shared OPEN_SEARCH_SHORTCUT and OPEN_SCOPED_SEARCH_SHORTCUT constants for plugins
- Scoped tab counts its source's recent rows before typing
- Rows can carry an addon (e.g. participant avatars) and their own Enter label
- Search everything link is gray with a trailing arrow
- Summary panel shows owners, domains, glossary terms and tags like Explore, without counts; lighter stat values
- Task filters and sort reset on tab change and only apply on their own tab
- Show the error state when any request failed and the view is empty
- Ignore Enter/Esc while an IME is composing
- Tab bar on core Tabs; +N more and footer link on core Button
- Sidebar search is a real button matching the prototype field
- Translated task filter labels via a light taskLabel.utils shared with the Inbox
- Interpolated shortcut labels; formatted entity type; no lowercased type names
- Quick filters can ignore the host page's deleted/NLP state
- Refetch only the active type on tab, filter or sort change; abort counts and tasks
- Incident count from the server total, as in Explore's summary
- Summary panel keeps its compact layout with Explore's chips and avatars
- Backspace never closes search
- Enforce unique source keys and complete the decision record
- Tests for key actions, active option, IME, preview-then-open and filters
…nter

- Skeleton tabs and rows until a query's first results arrive
- Filters stay on one line and scroll horizontally
- Plain Enter never runs the query action; only Cmd/Ctrl+Enter does
- First result is highlighted by default; ArrowUp reaches the action row
- Drop the duplicate Ask AI enter hint from the footer
@Rohit0301
Rohit0301 marked this pull request as ready for review November 26, 2026 05:21
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 26, 2026 05:21
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

Rohit0301 and others added 5 commits November 26, 2026 10:54
A tab change used to refetch only the new tab, so the tab just left kept the
count its own filters narrowed: wrong totals, and a tab narrowed to zero
dropped out of the bar. Leaving a tab whose filters narrowed it now reloads
all types.
Browsers render <kbd> in a monospace font where the command glyph is tiny.
Not in the design, and before typing it only switched a hidden tab, so the
click changed nothing. Chats stay reachable through Option+Cmd+K and the
Recent Chat search button.
- Report loading on the render a query or filter changes, so the empty-tab
  fallback never acts on stale results
- A failed asset or per-type search is a failure, not an empty result
- Call plugin sources inside a promise so a synchronous throw is a failed
  source instead of a stuck spinner
- Esc works when focus has left the input
- No highlighted row (and no Enter) while the list reloads behind skeletons
- Combobox pattern: the input controls one listbox per section, headings and
  their controls sit outside, the query action has its own listbox
- Show the preview description as plain text (stripMarkdown)
- Curated impact-map group runs GlobalSearch.spec.ts for every global search file
- Record source failure behaviour in the decision record
- Esc always closes search (footer hint reads Close); Clear still clears
- Clicking a row keeps focus in the input, and closing the preview returns
  it there, so the arrows and Enter keep working
@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 4 closed / 4 findings

Adding global search across entity types, tasks, and plugin actions changes app-wide discovery and navigation; incorrect results or routing could misdirect users.

Adds a global search modal (⌘K) to AI mode with type tabs, data-asset facets and preview, tasks filters, and plugin extension points for result sources and query actions. Three findings were resolved: the extension points now have a decision record, zero-hit filters no longer jump to All or leave hidden facets applied, and data-asset queries no longer pick up facets from another type's tab. No open issues remain.

✅ 4 closed
✅ Quality: New global-search extension points ship without a decision record

📄 openmetadata-ui/src/main/resources/ui/src/utils/extensionPoints.ts 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearch.types.ts:54-68 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/appModeExtensions.ts:124-138
This PR adds two extension points that Collate has to match: app-mode.globalSearch.sources and app-mode.globalSearch.askAi. Nothing in docs/decisions/ records them. Their contract lives only in GlobalSearch.types.ts and the PR description. That contract is GlobalSearchSourceContribution (key must be a GlobalSearchCategory, search(query, signal), optional recent/placeholderKey/footer) and GlobalSearchAskAiContribution, where the last contribution wins. The repo already records extension points this way (2026-10-12-platform-settings-pages-extension-point.md). Renaming either id, or changing a contribution's shape, would break the Collate build without any error. The description also states a rule that exists nowhere in the tree: "Plugins pass their own i18n keys for that text, so OpenMetadata ships no assistant or chat wording." The record would assert: "Downstream builds add global-search result types through app-mode.globalSearch.sources (one contribution per GlobalSearchCategory key) and the Ask row through app-mode.globalSearch.askAi (last contribution wins). Contributors supply every assistant/chat i18n key, and OSS ships no such copy."

✅ Bug: Zero-hit filter kicks user to All and leaves hidden facets applied

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearchPanel.tsx:197-211 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/useGlobalSearchResults.tsx:193-204
This commit adds a filter bar for every type that has filters (getCategoryFilterConfig). If a user on a type tab (assets, a glossary term, a domain, …) picks a facet value that matches nothing, results[filter].count comes back 0. The stranded effect at GlobalSearchPanel.tsx:197-203 then calls setFilter('all') directly instead of going through changeFilter, so facets is never cleared.

The user is moved off the tab they were filtering and the filter bar disappears, so there is no way to undo the selection. The leftover facets also keep filtering the asset query on All, because fetchAssets always applies params.facets (see the companion finding). The Data assets section and the All count then come back silently narrowed or empty.

Fix: don't treat a facet-driven zero as stranded, so the user stays on the tab and sees the empty state for their filter. Failing that, clear the facets when falling back.

✅ Bug: Data-asset query applies facets picked on another type's tab

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/useGlobalSearchResults.tsx:193-204
fetchEntityType only applies facets when params.filter === entityType (line 225-228). fetchAssets, however, always passes getFacetQueryFilter(params.facets) (line 200). Facets are now per-type: on the glossary-term or domain tab, GlobalSearchFilterBar writes that type's fields (glossary, owners, tags, …) into facets. Those fields then also filter the dataAsset query that runs in the same fetch.

The Data assets count in the tab bar and the All total change according to a filter the user applied to a different type. They often drop to 0, which also removes the Data assets tab.

Fix: apply facets to the asset query only when the assets tab is active, mirroring fetchEntityType.

Closed: Bug: Tab switch keeps the previous tab's filtered count; zero-count tab vanishes

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/useGlobalSearchResults.tsx:455-469 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearchPanel.tsx:219-226 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearch.utils.ts:49-50
On a type tab, isRefine refetches only the newly active category and merges it into previous. When the user leaves a filtered tab, changeFilter clears its facets, task filters and sort, but that tab's section is never refetched unfiltered. Example: on Data assets, an owner facet narrows the count to 0 (or 5). Switching to Tasks fetches only tasks, so results.assets.count keeps the filtered value. The Data assets tab then shows the wrong count and the All total is wrong. When the stale count is 0, getVisibleTabs drops the tab completely, because it is no longer the active tab. The counts are corrected only after going back to All. Fix: when the filter changes, refetch the tab you just left along with the new one. Or use the full fetchAll path when the previous tab had its own filters or sort, so every tab's count matches the unfiltered query again.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. I checked all eight from my earlier review against this head, and each is fixed with a test.

@Rohit0301
Rohit0301 merged commit f8e3c8e into main Nov 26, 2026
54 of 56 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/collateai-global-search branch November 26, 2026 12:52
Rohit0301 added a commit that referenced this pull request Nov 27, 2026
* AI mode: global search (Cmd+K)

Adds the AI-mode global search modal: results across data assets, tasks,
glossary, people, domains, data products and Context Center, with per-type
tabs ordered by hit count, asset facets and sort, an asset summary panel,
and an Explore hand-off that carries the query, filters and sort.

Plugins add result types and the assistant hand-off through the new
app-mode.globalSearch.sources and app-mode.globalSearch.askAi extension
points, and supply their own wording.

* AI mode global search: core-ui rework, per-type filters, loaders, tests

- Tabs for every matched type from the search API, overflow slot for +N more
- Per-type quick filters, sort carried to Explore, Clear resets everything
- Typing shows spinner + line loader; tab/filter/sort changes show skeletons
- Rows only close the modal when they navigate
- Query action replaces the Ask AI extension point; plugins own the copy
- Decision record for the global search extension points
- Unit tests for every new file

* Global search: keep facets scoped to their own tab

- A tab emptied by the user's own filter stays selected so the filter can be undone
- Facets apply to the data asset query only on the assets tab
- Fix the modal test suite failing to load on a DomainUtils import cycle

* Global search: Playwright user flows

- Data asset preview then open, glossary term and domain routing
- Explore hand-off keeps the query and sort
- Recent searches survive a reload, recently viewed reopens a page

* Global search: platform-aware shortcut labels

- Show Ctrl+K / Ctrl+Alt+K / Ctrl+Enter off Apple devices; the handler already accepted both
- Shared OPEN_SEARCH_SHORTCUT and OPEN_SCOPED_SEARCH_SHORTCUT constants for plugins

* Global search: chats scoped view and Explore-style summary details

- Scoped tab counts its source's recent rows before typing
- Rows can carry an addon (e.g. participant avatars) and their own Enter label
- Search everything link is gray with a trailing arrow
- Summary panel shows owners, domains, glossary terms and tags like Explore, without counts; lighter stat values

* Global search: address review feedback

- Task filters and sort reset on tab change and only apply on their own tab
- Show the error state when any request failed and the view is empty
- Ignore Enter/Esc while an IME is composing
- Tab bar on core Tabs; +N more and footer link on core Button
- Sidebar search is a real button matching the prototype field
- Translated task filter labels via a light taskLabel.utils shared with the Inbox
- Interpolated shortcut labels; formatted entity type; no lowercased type names
- Quick filters can ignore the host page's deleted/NLP state
- Refetch only the active type on tab, filter or sort change; abort counts and tasks
- Incident count from the server total, as in Explore's summary
- Summary panel keeps its compact layout with Explore's chips and avatars
- Backspace never closes search
- Enforce unique source keys and complete the decision record
- Tests for key actions, active option, IME, preview-then-open and filters

* Global search: loading skeletons, single-line filters, Enter vs Cmd+Enter

- Skeleton tabs and rows until a query's first results arrive
- Filters stay on one line and scroll horizontally
- Plain Enter never runs the query action; only Cmd/Ctrl+Enter does
- First result is highlighted by default; ArrowUp reaches the action row
- Drop the duplicate Ask AI enter hint from the footer

* Global search: reload every type when leaving a filtered tab

A tab change used to refetch only the new tab, so the tab just left kept the
count its own filters narrowed: wrong totals, and a tab narrowed to zero
dropped out of the bar. Leaving a tab whose filters narrowed it now reloads
all types.

* Global search: draw the sidebar shortcut key in the app font

Browsers render <kbd> in a monospace font where the command glyph is tiny.

* Regenerate the Playwright impact map for the global search spec

* Global search: drop the View all link on recent source rows

Not in the design, and before typing it only switched a hidden tab, so the
click changed nothing. Chats stay reachable through Option+Cmd+K and the
Recent Chat search button.

* Global search: address review feedback

- Report loading on the render a query or filter changes, so the empty-tab
  fallback never acts on stale results
- A failed asset or per-type search is a failure, not an empty result
- Call plugin sources inside a promise so a synchronous throw is a failed
  source instead of a stuck spinner
- Esc works when focus has left the input
- No highlighted row (and no Enter) while the list reloads behind skeletons
- Combobox pattern: the input controls one listbox per section, headings and
  their controls sit outside, the query action has its own listbox
- Show the preview description as plain text (stripMarkdown)
- Curated impact-map group runs GlobalSearch.spec.ts for every global search file
- Record source failure behaviour in the decision record

* Global search: Esc closes, arrows keep working with the preview open

- Esc always closes search (footer hint reads Close); Clear still clears
- Clicking a row keeps focus in the input, and closing the preview returns
  it there, so the arrows and Enter keep working

(cherry picked from commit f8e3c8e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants