64 Commits
Author SHA1 Message Date
Nic Westvoldandjoshhunt f2ec313af2 Build: Add rspack dev, prod and swagger configs (#130433)
* chore(scripts): mark scripts/cli as an ES module

* test(rspack): recurse into subdirectories in `readAssets`

* feat(rspack): emit `assets-manifest.json` via `rspack-manifest-plugin`

* feat(rspack): add dev build config

* feat(rspack): add prod build config

* docs(rspack): correct why plugin tests pin an explicit `target`

* use already-computed integrity hashes from the SRI plugin for the
manifest

* docs(rspack): trim comments to what the code needs

* feat(rspack): add swagger build and watch scripts

* docs(rspack): clarify why live reload is unsupported

* chore: ignore the rspack build dir in eslint

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
2026-08-17 08:28:25 -04:00
Nic Westvold cac5ca5b2a Chore: Resolve bundle size stats against a configurable build directory (#130804)
fix(scripts): resolve bundle-size assets against a configurable build dir
2026-08-14 17:26:37 -04:00
Nic Westvold d7c063deae Transformations: Fix inner join returning rows when a frame is dropped (#129576)
fix(transformations): return no rows when an inner join drops a frame

`joinDataFrames` drops frames with no fields, or with no field matching
`joinBy`, from the join input. For an inner join that widens the result:
the surviving frames join with each other, and a lone survivor is
returned verbatim by `joinTabular` because its merge loop never runs.

An inner join only yields rows present in every input, so a frame that
contributes no join values must produce zero rows. This holds at every
arity, including the single-frame path that returns before the join.
Outer joins keep dropping such frames so one unrelated series cannot
blank out a panel.

Fixes #88033
2026-08-10 17:41:28 -04:00
Nic Westvold d4617395c2 CI: Add scripts/rspack to frontend path filters and e2e cache key (#130410)
ci: add scripts/rspack to frontend path filters and e2e cache key
2026-08-10 12:03:22 -04:00
Nic Westvold d24289b661 Transformations: Fix field lookup failing for the Countries and USA States gazetteers (#129568)
* fix(transformers): bound `fieldLookup` gazetteer loop by frame row count

* fix(geo): build a frame from worldmap gazetteers so field lookup works

* fix(transformers): reject with a descriptive error when a gazetteer has no data

* test(gazetteer): restore spies and public path between gazetteer tests

* test(geo): reuse the cached countries gazetteer instead of a fake path
2026-08-06 14:25:14 -04:00
Nic Westvold 9fc6f228f5 Transformations: Keep Merge series/tables available with a single data series (#129569)
* fix(transformations): allow `merge` when only one frame is present

* refactor(transformations): drop unreachable `isApplicable` from `merge`
2026-08-06 12:32:51 -04:00
Nic Westvold 88f77911c6 Explore: Fix table panel never showing a loading indicator (#129767)
* fix(explore): evaluate selectIsWaitingForData with state in TableContainer

* fix(explore): show the table loading indicator while a query is running

* fix(explore): derive the table loading indicator from the query state
2026-08-06 09:54:43 -04:00
Nic WestvoldandSwetalin Rout b63c757001 Traceview: wrap long span attribute values to avoid horizontal scrolling (#129960)
* Traceview: wrap long span attribute values to avoid horizontal scrolling

Signed-off-by: Swetalin Rout <swetalinrout2006@gmail.com>

* fix(traceview): keep span attribute icons on the first line of wrapped values

* docs(traceview): note why `wordBreak` is load-bearing for attribute wrapping

---------

Signed-off-by: Swetalin Rout <swetalinrout2006@gmail.com>
Co-authored-by: Swetalin Rout <swetalinrout2006@gmail.com>
2026-08-06 08:33:13 -04:00
Nic Westvold 40c270094c DataPro (migration): Migrate explore/QueryRows.tsx (#130182)
* refactor(explore): migrate `QueryRows` to async datasource settings API

* test(explore): await render settle in content outline local storage test

* test(explore): cover default datasource fallback in `QueryRows`

* test(explore): cover `ContentOutlineContextProvider` registration ordering

`QueryRows` now returns null while datasource settings resolve, so query row
children register after their root parent instead of before it. That left the
parentless-child path in `register` uncovered — it was only ever exercised by
mount ordering in `Explore.test.tsx`.

* fix(explore): keep query editors mounted across a datasource switch

`useDataSourceInstanceSettings` keeps serving the previous settings while the
next lookup is in flight, so gating on `isLoading` unmounted every editor and
rebuilt it on each switch. Gate on the settings alone.
2026-08-05 17:15:44 -04:00
Nic Westvold 836614c8a8 Transformations: Fix field name deduplication in Extract fields (#129889)
fix(transformers): dedupe `extractFields` names against surviving fields
2026-08-05 15:29:17 -04:00
Nic Westvold 9eefbaacfe DataPro (migration): Migrate explore/hooks/useStateSync (#130201)
* refactor(explore): migrate `useStateSync` to async data source APIs

* test(explore): add unit tests for `useStateSync` internal utils
2026-08-05 14:50:57 -04:00
Nic Westvold 4886ffa1e5 DataPro (migration): Migrate correlations/Forms/ConfigureCorrelationSourceForm.tsx (#130176)
refactor(correlations): use `useDataSourceInstanceSettings` in `ConfigureCorrelationSourceForm`
2026-08-05 14:49:47 -04:00
Nic Westvold 18e099098e Gauge: Fix e2e gauge count after new overflow panels (#130204)
test(gauge): bump expected gauge count after new gdev overflow panels
2026-08-05 18:10:50 +00:00
Nic Westvold d8112c23b7 DataPro (migration): Migrate explore/SignalExplorer/SignalExplorer.tsx (#130197)
* refactor(explore): migrate `SignalExplorer` to async datasource APIs

* test(explore): seed async datasource APIs in `ContentOutline` signal explorer tests
2026-08-05 13:19:38 -04:00
Nic Westvold fa9372561c DataPro (migration): Finish explore/state/query.ts (#130173)
refactor(explore): resolve history query datasource via `getDataSourceInstance`
2026-08-05 12:26:32 -04:00
Nic Westvold e1a14e7ab1 DataPro (migration): Finish explore/state/utils.ts (#130174)
refactor(explore): use `getDataSourceInstance` in `state/utils.ts`
2026-08-05 12:25:55 -04:00
Nic Westvold 3d9da6af00 I18n: Fix key nesting conflicts that silently dropped 13 strings from the catalog (#129955)
fix(i18n): resolve key nesting conflicts dropping strings from the catalog
2026-08-05 11:40:41 -04:00
Nic Westvold e9b72fe9a4 Transformations: Fix Filter by value regex matching null values (#129572)
fix(transformations): don't match null values in regex value matcher
2026-08-05 11:39:21 -04:00
Nic Westvold 7394cd19fb Signal Explorer: Load real metrics, labels and values in the datasource explorer (#129608)
* feat(signalExplorer): add metric type definitions and derivation logic

* feat(signalExplorer): implement `detectMetricsInQueries` function

* perf(signalExplorer): optimize metric detection with tokenization; add boundary tests

* feat(signalExplorer): add `signalExplorerSlice` view-state and selectors

* fix(signalExplorer): derive selector `PaneViewState` from `signalExplorerSlice`, add selector tests

* feat(signalExplorer): add `metricResourceClient` with DS resolution, cache, single-flight

* feat(signalExplorer): add `useMetricCatalog` hook

* fix(signalExplorer): key `useMetricCatalog` refetch on type-only `dsRef` too

* feat(signalExplorer): add `useMetricDetail` lazy label-keys hook

* fix(signalExplorer): raise `loading` in the render that starts a fetch

* feat(signalExplorer): add `useLabelValues` lazy label-value hook

* feat(explore): add `MetricTypeFilter` combobox for signal explorer

* feat(signalExplorer): add MetricMetadataBlock

* feat(signalExplorer): add lazy `MetricRow` and `MetricTree` browse components

* feat(signalExplorer): add per-query `DatasourceCard`

* fix(signalExplorer): make `DatasourceCard` logo test actually observe the DOM

* feat(explore): add `SignalExplorerRail` shell with per-query datasource cards

* feat(explore): mount `SignalExplorerRail` in `ContentOutline` behind the metrics sidebar flag

* refactor(signalExplorer): move `resolveCards` out of the shell and publish it

* perf(signalExplorer): batch the metric list, memoize `MetricRow`, debounce search

* fix(signalExplorer): badge a metric only with refIds from its own datasource

* fix(signalExplorer): drop a pane's view state when Explore closes the pane

* feat(signalExplorer): show the metric type on `MetricRow`

* chore(signalExplorer): rename `showSignalExplorer`, share `dsKey`, escape metric selectors

* chore(explore): move the `no-metrics` string to the signal explorer tree

* test(signalExplorer): type the `MetricRow` probe as a memo component

* test(explore): derive the datasource fixture's `meta.id` from the ref type

* fix(signalExplorer): scope `searchText` and `typeFilter` per card, not per pane

* chore(signalExplorer): drop the producerless `MetricLabel` and `MetricRow.labels`

* fix(signalExplorer): reset metric paging when the datasource or range changes

* perf(signalExplorer): look up one metric type label instead of rebuilding all six

* test(signalExplorer): cover the accordion reset and label loading/error states

* perf(signalExplorer): sort label values once, then filter the sorted list

* test(signalExplorer): cover the closed pane and the dismissible empty metadata dock

* fix(signalExplorer): point each expand toggle at the block it opens with `aria-controls`

* docs(signalExplorer): document the shared state contract on the barrel

* fix(signalExplorer): show the metadata dock only for a selected metric, colour its type badge

* fix(signalExplorer): drop the per-card type filter and match `DatasourceCard` to the design

* chore(i18n): drop the removed metadata empty-state string

* fix(signalExplorer): derive the type badge foreground so every badge clears WCAG AA

* fix(signalExplorer): divide and tighten the expanded card body

* fix(signalExplorer): scroll the metric list so the search box stays pinned

* fix(signalExplorer): prune card view state when a query refId is recycled

* fix(signalExplorer): expire cached metric resources after `CACHE_TTL_MS`

* feat(signalExplorer): add `invalidateMetricCache` and refetch mounted hooks on it

* feat(signalExplorer): publish `getMetricTypeLabel`, `useVisibleBatch`, `LabelValuesBlock` and the cache keys

* docs(signalExplorer): say why `MetricTypeFilter` is published with no consumer

* test(signalExplorer): lock the published barrel surface in `index.test.ts`

* feat(signalExplorer): let a host supply `MetricTree`'s catalog instead of a second instance

* docs(signalExplorer): describe cache expiry without naming an unpublished constant

* refactor(signalExplorer): trim to the data layer, dropping the shell superseded by main

* refactor(signalExplorer): unpublish the translated type labels, keeping `deriveMetricType`

* feat(explore): back `MetricsList` with the real metric catalog instead of a stub

* refactor(signalExplorer): drop the used-in-query badge helpers, which belong to DPRO-219

* feat(explore): expand a metric row to its label keys and values

* fix(signalExplorer): derive the language-provider subset from `@grafana/prometheus`

* fix(signalExplorer): drop `__name__` from a metric's label keys

* fix(signalExplorer): resolve metric metadata by family name, not series name

* refactor(signalExplorer): consolidate the UI and data layers into one `SignalExplorer` folder

* refactor(signalExplorer): collapse the three data hooks onto a shared `useAsyncResource` and drop the barrel

* refactor(signalExplorer): drop the `enabled` gate no caller ever turns off

* fix(signalExplorer): name each `Show more` for the list it extends
2026-07-31 09:24:58 -04:00
Nic Westvold 82de39eb06 Explore: Fix inverted Datasource A-Z / Z-A sort in local query history (#128953)
* fix(explore): correct swapped datasource A-Z/Z-A sort in local query history

* chore: restore trailing newline in eslint-suppressions.json
2026-07-28 12:03:38 -04:00
Nic Westvold 96a671ab11 Expressions: scope SQL expression Cmd/Ctrl+Enter to its own editor (#128948)
* fix(expressions): scope SQL expression run-query shortcut to its own editor

* chore: restore trailing newline in eslint-suppressions.json
2026-07-28 12:03:20 -04:00
Nic Westvold d5e700dace Explore: Fix unreachable command-palette split-view actions (#128943)
* fix(explore): register command palette split actions using pane keys

* chore: restore trailing newline in eslint-suppressions.json
2026-07-28 12:02:54 -04:00
Nic Westvold f0c8fa57ad Explore: Fix panelsSate typo in extension context type (#128940)
fix(explore): correct `panelsSate` typo in explore extension context type
2026-07-28 12:02:19 -04:00
Nic Westvold b9a8d07efe Explore: Fix correlation editor dropping datasource change on save (#128947)
* fix(explore): dispatch `changeDatasource` when saving pending datasource change

* chore: restore trailing newline in eslint-suppressions.json
2026-07-28 12:01:22 -04:00
Nic Westvold 036967238a Explore: Fix missing paren in ExplorePage split pane calc() height (#128935)
fix(explore): close calc() paren in ExplorePage split pane height
2026-07-28 12:00:40 -04:00
Nic Westvold 2ea7075ea8 Transformations: fix formatString crash on null values (#128945)
fix(transformations): guard against null values in `formatString` transformer
2026-07-22 10:12:25 -04:00
Nic Westvold 0146dc13a0 Explore: Consolidate query history filter seeding and fix shared loading/filter bugs (#128731)
* fix(explore): consolidate query history filter seeding and fix shared loading/filter bugs

* fix(explore): sequence rich history loads to ignore stale results
2026-07-22 10:12:08 -04:00
Nic Westvold 6f61f7c947 QueryField: Deprecate Slate exports in @grafana/ui ahead of removal (#128537)
* chore(grafana-ui): deprecate Slate exports ahead of removal

* docs(grafana-ui): document QueryField Slate deprecation and CodeMirror migration

* docs(grafana-ui): soften Slate deprecation wording to "may be removed"
2026-07-16 16:05:28 -04:00
Nic Westvold b329107dc8 fix(explore): seed Starred query history filters from last-used filte… (#128541)
fix(explore): seed Starred query history filters from last-used filters, not active datasource
2026-07-16 09:20:34 -04:00
Nic Westvold 1d3a76bc09 DataPro (migration): Migrate core/utils/richHistory.ts (#127579)
* refactor(query-history): migrate `createDatasourcesList` and consumers to `useDataSourceInstanceList`

* fix(explore): drop dead `createDatasourcesList`, re-fetch ds instances when async list loads

* fix(explore): defer query-history filter seeding until datasource list loads

* test(explore): guard query-history datasource resolution against a single failing datasource
2026-07-15 15:20:43 -04:00
Nic Westvold 4065d85581 feat(editors): migrate Graphite and Jaeger query fields to CodeMirror (#127820)
* feat: migrate DataLinkInput from Slate to CodeMirror

* refactor(grafana-ui): drop unconsumed `CodeMirrorInlineInput` exports from unstable

* fix(grafana-ui): avoid duplicate `$` on explicit DataLink variable completion

* fix(grafana-ui): keep DataLink completion popup above modal and theme its info panel

* fix(grafana-ui): theme `CodeMirrorInlineInput` popup, info panel, and caret for dark surfaces

* fix(grafana-ui): align `CodeMirrorInlineInput` with native input chrome, popup, and caret

* feat(grafana-ui): add variable highlighting and autocomplete to data link title input

* fix(grafana-ui): add hover state to `CodeMirrorInlineInput` autocomplete items

* fix(grafana-ui): wrap long values in `CodeMirrorInlineInput` instead of clipping

* feat(editors): migrate Graphite and Jaeger query fields to CodeMirror

* refactor(grafana-ui): move getQueryFieldConfig out of CodeMirror dir

* fix(graphite/jaeger): drop pending debounced edits on external query changes
2026-07-15 11:07:04 -04:00
Nic Westvold 348e805685 Chore: CodeMirror migration - drop CloudWatch dependency on completion types (#128071)
* chore(cloudwatch): remove dead Slate typeahead language provider

* chore(cloudwatch): drop dead syntax exports flagged by knip
2026-07-14 13:22:53 -04:00
Nic Westvold da4bd9c43c Chore: Remove Slate from alerting rule-details expression display (#128073)
* refactor(alerting): drop Slate from rule-details expression display

* fix(alerting): preserve newlines in rule-details expression display

* test(alerting): update RuleList expression assertion for non-Slate rendering

* refactor(alerting): render highlighted expression as token elements
2026-07-14 13:22:33 -04:00
Nic Westvold 905ba980fc DataPro (migration): Migrate expressions/utils/interpolateSourceQueries.ts (#127597)
refactor(expressions): migrate interpolateSourceQueries off getDataSourceSrv
2026-07-14 10:03:09 -04:00
Nic Westvold c9dcdfacdd DataPro (migration): Migrate explore/state/query.ts (#127510)
refactor(explore): migrate query state to async `getDataSourceInstance`
2026-07-14 09:41:14 -04:00
Nic Westvold 0bb976be55 DataPro (migration): Migrate RichHistoryQueriesTab.tsx (#127505)
refactor(explore): migrate RichHistoryQueriesTab to async `getDataSourceInstance`
2026-07-13 16:46:17 -04:00
Nic Westvold ae05909611 DataPro (migration): Migrate useExplorePageContext.ts (#127507)
refactor(explore): migrate useExplorePageContext to async `getDataSourceInstanceSettings`
2026-07-13 16:46:06 -04:00
Nic Westvold 2d833f3878 DataPro (migration): Migrate useExplorePageTitle.ts (#127508)
refactor(explore): migrate useExplorePageTitle to async `getDataSourceInstance`
2026-07-13 16:45:26 -04:00
Nic Westvold 8e5a18863d DataPro (migration): Migrate explore/state/utils.ts (#127511)
refactor(explore): migrate getCorrelationsData to async `getDataSourceInstance`
2026-07-13 16:45:10 -04:00
Nic Westvold de4d365060 DataPro (migration): Migrate core/history/localStorageConverter.ts (#127568)
* refactor(query-history): migrate `localStorageConverter` to async `getDataSourceInstanceSettings`

* fix(explore): await query history writes before refreshing the list
2026-07-13 16:44:56 -04:00
Nic Westvold b40e2e8a6c DataPro (migration): Migrate correlations enrich path off getDataSourceSrv (#127593)
* refactor(correlations): migrate enrich path off getDataSourceSrv

* test(correlations): cover k8s enrich transformation, url-default, and error branches
2026-07-13 15:44:12 -04:00
Nic Westvold 5f97e60451 DataPro (migration): Migrate expressions/ExpressionDatasource.ts (#127595)
refactor(expressions): migrate ExpressionDatasource off getDataSourceSrv
2026-07-13 15:18:33 -04:00
Nic Westvold 980cef6d26 DataPro (migration): Migrate core/utils/explore.ts (re-land) (#128134)
refactor(explore): migrate `core/utils/explore` to async `getDataSourceInstance`
2026-07-09 13:52:58 -04:00
Nic Westvold b28746131c Chore: add getQueryFieldConfig CodeMirror helper (#127981)
* feat(grafana-ui): add getQueryFieldConfig CodeMirror helper

* refactor(grafana-ui): move getQueryFieldConfig out of CodeMirror dir
2026-07-09 10:11:58 -04:00
Nic Westvold 08f29fd95c Runtime: Resolve template-variable refs to concrete instance identity in getDataSourceInstance (#128035)
* fix(grafana-runtime): resolve template-variable refs to concrete identity in getDataSourceInstance

* test(grafana-runtime): cover default-interpolation and ref-object variable refs in getDataSourceInstance
2026-07-09 09:49:22 -04:00
Nic Westvold 698ccf8238 Chore: Use codemirror for data link editor (#126425)
* feat: migrate DataLinkInput from Slate to CodeMirror

* refactor(grafana-ui): drop unconsumed `CodeMirrorInlineInput` exports from unstable

* fix(grafana-ui): avoid duplicate `$` on explicit DataLink variable completion

* fix(grafana-ui): keep DataLink completion popup above modal and theme its info panel

* fix(grafana-ui): theme `CodeMirrorInlineInput` popup, info panel, and caret for dark surfaces

* fix(grafana-ui): align `CodeMirrorInlineInput` with native input chrome, popup, and caret

* feat(grafana-ui): add variable highlighting and autocomplete to data link title input

* fix(grafana-ui): add hover state to `CodeMirrorInlineInput` autocomplete items

* fix(grafana-ui): wrap long values in `CodeMirrorInlineInput` instead of clipping
2026-07-07 15:54:39 -04:00
Nic Westvold fe7ae9fda3 DataPro (migration): Migrate core/history/RichHistoryRemoteStorage.ts (#127755)
refactor(query-history): migrate `RichHistoryRemoteStorage` to async `getDataSourceInstanceSettings`
2026-07-02 10:19:39 -04:00
Nic Westvold 6be7007afc DataPro (migration): Migrate RichHistoryStarredTab.tsx (#127506)
refactor(explore): migrate RichHistoryStarredTab to async `getDataSourceInstance`
2026-07-02 09:08:42 -04:00
Nic Westvold 104ce4ef9e DataPro (migration): Migrate explore/state/correlations.ts (#127509)
refactor(explore): migrate correlations state to async `getDataSourceInstance`
2026-07-02 09:05:37 -04:00
Nic Westvold 2949f4c698 DataPro (migration): Migrate correlations/Forms/QueryEditorField.tsx (#127584)
chore(correlations): migrate QueryEditorField off getDataSourceSrv
2026-07-02 08:42:18 -04:00
Nic Westvold fa2e28ee91 DataPro (migration): Migrate expressions/components/SqlExpressions/hooks/useSQLSchemas.ts (#127596)
* refactor(expressions): migrate useSQLSchemas off getDataSourceSrv

* test(sql-expressions): mock async `getDataSourceInstanceSettings` in `SqlExpr` test
2026-07-02 08:41:37 -04:00
Nic Westvold 3103327a3f DataPro (migration): Migrate core/utils/explore.ts (#127578)
* refactor(explore): migrate `core/utils/explore` to async `getDataSourceInstance`

* test(explore): mock async `getDataSourceInstance` in `query.test.ts`
2026-07-01 09:01:36 -04:00
Nic Westvold 04f58bc92b DataPro (migration): Migrate core/history/remoteStorageConverter.ts (#127569)
refactor(query-history): migrate `remoteStorageConverter` to async `getDataSourceInstanceSettings`
2026-06-30 16:35:01 -04:00
Nic Westvold 05a95da044 DataPro (migration): Migrate core/history/indexedDBMigration.ts (#127566)
refactor(query-history): migrate `indexedDBMigration` to async `getDataSourceInstanceSettings`
2026-06-30 16:34:07 -04:00
Nic Westvold ff1a0dfe14 chore(deps): replace classnames with clsx (#125304) 2026-06-30 10:49:15 -04:00
Nic Westvold c111289f83 feat: local query history (#121375)
* feat(query-history): add IndexedDB storage with `queryHistoryLocalOnly` feature flag

* feat(query-history): add localStorage cleanup after IndexedDB migration and fallback warning

* fix: fixes all `yarn lint` errors

* feat(query-history): populate saved query description from history item `comment`

* perf(query-history): use IndexedDB indexes for reads, debounce retention cleanup, and narrow migration API

* feat: add support escape hatch to reset IndexedDB migration

* refactor: remove premature localStorage cleanup

* fix: show starred queries regardless of age in Query History drawer

* fix(query-history): include `queryType` in IndexedDB search filter

* fix: resolve docs merge conflict and fix review issues in query history

* feat(query-history): add queryHistoryRecentQueriesUIflag andRecentQueriesContext service layer

* feat(query-history): hide Query History button and rename Saved Queries button when `queryHistoryRecentQueriesUI` is enabled

* feat(query-history): fix date header format and unstar toggle in Recent Queries

* feat(query-history): add Recent Queries UI

* chore(i18n): extract new `recent-queries` translation strings

* fix: reduce fontSize to more closely match Figma

* fix: address failing typecheck items

* fix(query-history): update Cloud badge icon and fix tab suffix spacing in Recent Queries modal

* chore: Query History button should always be visible

* refactor(query-history): replace star-save tooltip with dedicated save button and remove starred filter

* fix: ran yarn i18n-extract

* fix: address failing component test

* fix(query-history): address PR feedback

* feat(query-history): add description text, starred filter, and polish recent queries UI

* fix(query-history): make item count warning threshold injectable to fix CI test timeout

* fix(query-history): correct datasource sort order, prevent migration duplication, add e2e test

* test(query-history): add e2e tests for feature flag button visibility

* fix(query-history): flatten e2e test structure for Playwright worker compatibility

* fix: add entries to CODEOWNERS for the test files

* fix(e2e): set queryLibrary: false in recent-queries tests to fix enterprise CI

* refactor(query-history): migrate feature flags to OpenFeature dotted-name convention

* test(explore): use `setTestFlags`/`OpenFeatureProvider` in `SecondaryActions` and `Explore` tests

* fix(query-history): address review feedback for local IndexedDB history

- use `generateUUID` instead of secure-context-only `crypto.randomUUID`
- abort the dedup transaction explicitly in `addToRichHistory`
- warn and leave migration incomplete after max attempts instead of marking it done
- remove dead pagination plumbing from Recent Queries (render full set)
- debounce the Recent Queries search before fetching
- add Recent Queries interaction telemetry (`grafana_explore_query_history_recent_queries`)
- default retention to 14 days and clarify the Recent Queries copy
- add `richHistoryStorageProvider` unit tests
- drop unused IndexedDB indexes and redundant comments
- run retention cleanup off the read hot path

* fix(query-history): make IndexedDB migration idempotent across tabs and retries

* fix(query-history): address recent queries review feedback

* fix(query-history): re-export sortQueries for recent queries merge

* fix(explore): keep Query history button visible when recentQueriesUI is enabled

* fix(explore): fix doubled border, header spacing, and saved-queries tooltip copy in `RecentQueriesModal`

* test(query-history): keep `Query history` button visible in recent-queries e2e

* feat(query-library): load all queries from multi-query recent entries

* feat(query-library): load all queries from multi-query recent entries

* refactor(query-library): use options object for `renderSavedQueryButtons` and show real recent-queries retention period

* fix(query-history): default IndexedDB retention to 14 days when no legacy value is set

* refactor(query-library): make `SortPicker` width configurable and drop `!important` from recent-queries filters

* fix: remove circular dep
2026-06-18 11:16:05 -04:00
Nic WestvoldandNick Richmond 84a69ab30a chore: add mise.toml for local toolchain management (#123953)
* chore: add `mise.toml` for local toolchain management

* Update mise.toml

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* fix: use valid template syntax for Go version from `go.mod`

* chore: add `mise.toml` to CODEOWNERS

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
2026-06-09 13:21:11 -04:00
Nic Westvold a4886510c3 feat: add queryHistory feature flags (#125299)
* feat(featuremgmt): add `queryHistory.localOnly` and `queryHistory.recentQueriesUI` feature flags

* chore: update owner for queryHistory feature flags

* fix: ran make gen-feature-toggles to regenerate feature flags
2026-05-29 10:58:02 -04:00
Nic Westvoldandjoshhunt 2747de3a85 chore(deps): replace glob with fs.glob node builtin (#125307)
* chore(deps): replace `glob` with `tinyglobby` in workspace packages

* use node builtin glob

* use node builtin glob in grafana-schema

* yarn.lock

* remove tinyglobby from plugin-configs

* remove comment

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
2026-05-27 15:28:07 +00:00
Nic Westvold 7585d098ca fix(grafana-ui): break circular dependency with @grafana/test-utils (#124905)
* fix(grafana-ui): break circular dependency with `@grafana/test-utils`

* fix: run `yarn install` to update yarn.lock file

* fix(grafana-ui): add ESLint rule to prevent circular `@grafana/test-utils` import
2026-05-27 12:28:57 +01:00
Nic Westvoldandjoshhunt 0d541ac710 chore: replace uuid v4 with crypto.randomUUID() (#125309)
* chore: replace `uuid` v4 with `crypto.randomUUID()`

Keep `uuid` in Loki only (v5 usage in `liveStreamsResultTransformer.ts`)

* chore(grafana-data): add generateUUID() utility with secure-context fallback

* fix: ran yarn install to re-generate yarn.lock file

* fix: add CODEOWNERS for the `uuid.ts` file and its tests

* fix: update test mocks to use generateUUID from @grafana/data

* fix(mssql): add generateUUIDmock to fix typecheck indatasource.test.ts

* feat(grafana-data): add `isUUID()` validator to `@grafana/data`

* use useID in RolePicker

* use useId in canvas elements

* use useId in loki monaco query field

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
2026-05-27 10:52:31 +01:00
Nic Westvold c59ba8fbb5 chore: update CODEOWNERS for Classic Explore (#124340) 2026-05-06 16:48:35 -04:00
Nic Westvold 414fe3cab8 Explore: fix table view type error (#119960)
fix: remove unnecessary cloneDeep from PrometheusQueryResultsContainer
2026-03-10 17:09:48 -04:00
Nic Westvold 7c8d8f63a3 Explore: Expose Prometheus query results as plugin component (#116038)
* Explore: Expose Prometheus query results component for plugins

Add grafana/prometheus-query-results/v1 exposed component to allow
plugins to display Prometheus instant query results with Table/Raw toggle.

* Explore: Rename PrometheusQueryResults directory back to RawPrometheus

Reverts the directory rename to fix the codeowners-validator CI check.
The CODEOWNERS file references /public/app/features/explore/RawPrometheus/
which must match the actual directory path.

* test: add edge case tests for PrometheusQueryResultsContainer

* fix(dashboards): add missing DashboardAPI mock methods in ImportOverviewV2 test
2026-02-10 09:07:53 -05:00