Commit Graph
11045 Commits
Author SHA1 Message Date
Ashley Harrison 483e8c3fd7 Merge branch 'main' into ash/remove-react19-flag 2026-08-03 15:46:03 +01:00
Adela Almasan 789eac36b7 Tooltip: Send data point to Assistant (#128435) 2026-08-03 09:33:22 -05:00
Adela Almasan 8135d1103a Text: Toggle toolbar items (#129754) 2026-08-03 10:22:17 -04:00
Matt Cowley 1cc6679b40 Chore: Fix out-of-sync lockfile + package.json (#129939)
Fix out-of-sync lockfile + package.json
2026-08-03 14:25:29 +01:00
Adela Almasan 032e1dfcca Text: Markdown toolbar (#129636) 2026-08-03 09:24:55 -04:00
Ashley Harrison 6818d0c3f4 update @types/react @types/react-dom 2026-08-03 13:16:18 +01:00
Nathan Vērzemnieks 333d8646bb Chore: Finish decoupling cloudwatch (frontend) (#129585)
* Chore: Finish decoupling cloudwatch (frontend)

* Lint & test fixes
2026-08-03 14:12:39 +02:00
Ashley Harrison 4747ecde8e Merge branch 'main' into ash/remove-react19-flag 2026-08-03 12:54:58 +01:00
Galen Kistler dbcabca643 TestData: Exemplars scenario (#129881)
* chore(test-data-source): add exemplars scenario
2026-08-03 05:58:45 -05:00
Ashley Harrison 9d7285aad8 Merge branch 'main' into ash/remove-react19-flag 2026-08-03 09:59:35 +01:00
5417094cb0 Navigation: Inject orgId into all navigations (#120978)
* Frontend: inject orgId into all SPA navigations via LocationService

Append ?orgId=<N> to every SPA navigation at the history layer in
LocationService (push/replace), gated on multi-org, so URLs stay
shareable across orgs. Wires the orgId getter at startup in app.ts and
covers the behaviour in LocationService tests.

Fixes #105040

Signed-off-by: QuentinBisson <quentin@giantswarm.io>

* refactor: fix test

Signed-off-by: QuentinBisson <quentin@giantswarm.io>

* prune suppressions

Signed-off-by: QuentinBisson <quentin@giantswarm.io>

* Frontend: keep current path for query/hash-only orgId navigations

appendOrgId resolved query-only ('?tab=x') and hash-only ('#h') strings
against a dummy base and always returned url.pathname, forcing relative
navigations to '/'. Omit pathname for those so the router keeps the
current path, and cover both cases in tests.

Signed-off-by: QuentinBisson <quentin@giantswarm.io>

* Frontend: register orgId getter before post-login redirect

---------

Signed-off-by: QuentinBisson <quentin@giantswarm.io>
Co-authored-by: Laura Benz <laura.benz@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh.hunt@grafana.com>
2026-08-02 12:09:44 +01:00
Cody Confer 3546d0ffef fix: graphite tags parsing error (#129779)
Signed-off-by: Cody Confer <cody.confer@grafana.com>
2026-07-31 16:11:52 -06:00
97e3f40cba docs(skills): add panel-testing-strategy skill (#129154)
* docs(skills): add panel-testing-strategy skill

Add a Claude skill capturing how the DataViz squad wants unit and E2E tests
written for Grafana visualization panels and DataViz-owned code, distilled from
the April–July 2026 test-coverage effort, its PR review discussions, and the
DataViz + DataPro frontend testing strategy manifesto.

The skill encodes:
- the (inverted) testing diamond and how to pick the right layer
- assert-real-behavior conventions (no bare toBeDefined / not.toThrow)
- honest test descriptions that match their assertions
- verifying tests actually reach the target branch
- the repo's data-frame and panel-props builders, with common gotchas
- the canvas draw-call snapshot harness for chart panels
- E2E: selectors-first, an a11y check for every panel, and interaction snapshots
- no-AI-slop authoring guidance (AI speeds up a test you already intend)
- SDLC-phase expectations for when to add which tests
- 10 anti-flake rules, each mapped to a real stabilization PR

Wire it (and the existing add-e2e-selectors skill) into AGENTS.md under a new
"Project skills" pointer, and un-ignore the skill directory in .gitignore to
match the add-e2e-selectors convention.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* Update SKILL.md

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* docs(skills): trim panel-testing-strategy rules checklist and exemplars

Make the rules checklist pure pointers into the sections above instead of
restating every rule, and drop the two exemplar bullets already cited inline
(panel-props builder in Step 1, canvas harness in Step 4). Removes duplicated
maintenance surface so a rule change no longer has to be edited in two places.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): tighten panel-testing-strategy description

Trim the frontmatter description from ~184 to ~124 tokens by dropping the
redundant "Encodes ..." summary sentence (that content is in the body) and
thinning the panel/component enumerations, while keeping every distinctive
trigger phrase. The description is loaded into every session's skill listing,
so this is an always-on saving regardless of whether the skill is invoked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): correct canvas harness example and waitFor idiom

The Step 4 import example named createGrafanaUiMeasureTextJestMock but
attributed it to TimeSeriesPanel.canvasTestUtils.tsx, which actually imports
applyDefaultUPlotAxisMeasureTextMock. They are two different helpers: the
harness file imports applyDefaultUPlotAxisMeasureTextMock / installCanvasPath2DShim /
removeCanvasTransforms, while each *.canvas.test.tsx mocks
@grafana/ui/src/utils/measureText via createGrafanaUiMeasureTextJestMock in a
jest.mock factory. Show both halves so the example matches the exemplar.

Also fix the renderer-ready wait: waitFor(() => uPlotInstance?.status === 1)
never retries because a falsy return does not throw. Use
waitFor(() => expect(uPlotInstance?.status).toBe(1)), consistent with
anti-flake rule #4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* build: make the .claude skill un-ignore actually take effect

!.claude/skills/panel-testing-strategy could not re-include files because its
parent .claude/ was excluded as a directory and git never descends into an
excluded dir, so new files in the skill dir still required a force-add. Ignore
directory contents with /* and re-include each parent step by step so the two
tracked skill dirs work without -f, while the rest of .claude/ stays ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): prefer jest.mocked over as jest.MockedFunction casts

Add Step 3 guidance to type mocked functions/modules with jest.mocked(fn)
rather than `fn as jest.MockedFunction<typeof fn>`. jest.mocked is the
type-safe repo convention (256 test files use it vs 52 using the cast) and
avoids a common review nit, so agent-generated tests should follow it. Also
note it in the rules-checklist Step 3 pointer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(codeowners): assign panel-testing-strategy skill to dataviz-squad

The .claude/skills/panel-testing-strategy/ dir had no CODEOWNERS entry (no
global * owner exists), so it had no owner and review routing. Assign it to
@grafana/dataviz-squad, who maintain the skill's conventions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): scope skill pointers to directory-level AGENTS.md

Move the panel-testing-strategy and add-e2e-selectors pointers out of the
root AGENTS.md, where they cost tokens on every agent session repo-wide, and
into directory-scoped AGENTS.md files that only load when working in the
relevant frontend trees:

- public/app/plugins/panel/
- public/app/features/
- packages/grafana-ui/

The pointers only advertise the skills and nudge their use in-tree; each
skill's own trigger description (already in every session's skills manifest)
decides when it actually applies, so the AGENTS.md files avoid any ownership
lookup and do not duplicate the CODEOWNERS mapping.

This follows the directory-scoped context recommendation for large codebases
and avoids adding frontend-specific guidance to the repo-wide default, keeping
context lean for backend work and for contributors without a large LLM budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(skills): satisfy codeowners + prettier for un-ignored skill files

The .gitignore fix in this branch makes .claude/skills/add-e2e-selectors/
genuinely tracked for the first time, which exposed two CI checks that had
never seen the file:

- codeowners-validator flagged add-e2e-selectors/SKILL.md and the new
  public/app/features/AGENTS.md as not-owned. Assign the e2e-selectors skill
  to @grafana/grafana-frontend-platform (owns the e2e-selectors package) and
  the features agent guide to @grafana/dataviz-squad.
- prettier flagged emphasis style in add-e2e-selectors/SKILL.md; normalize
  *text* to _text_.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): add rule against circular test expectations

Extend Principle 2 of panel-testing-strategy: expected values must be
frozen literals, never derived from the code under test, a collaborator
it calls internally, or a copy of the production formula (comparing a
value to itself asserts nothing). Promote mutate-then-confirm-red from a
Verify step to a first-class habit.

Prompted by review feedback on geomap test coverage (#129607).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): require regression tests to fail on main

A test accompanying a bug fix must fail in the absence of the fix and
pass in its presence — otherwise it pins nothing and won't catch the
regression coming back. Spell out the check (revert the fix → red,
restore → green) and reference it from the SDLC checklist item.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): drop squad reference from skill pointers

An agent reading the AGENTS.md pointer has no way to know who the
"DataViz squad" is, so phrase the panel-testing-strategy pointer by what
it does — how panel/visualization tests should be written — instead of
who wants them. Applies to the three directory-level AGENTS.md files.

Addresses review feedback from @joshhunt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): phrase skill by what it does, not who owns it

Drop the "DataViz squad" framing from the skill description and intro so
an agent decides relevance by the work (writing/reviewing viz tests),
not by knowing who the squad is. Keeps the coverage-gate fact, reworded
to reference the codeowner paths rather than the team.

The one remaining slug is the literal argument to
`test:coverage:by-codeowner`, left as-is so the command still runs.

Addresses review feedback from @joshhunt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): drop the run-tests-by-codeowner recommendation

Remove the `test:coverage:by-codeowner` Verify step and its checklist
entry — the codeowner coverage gate runs in CI and isn't something an
agent needs to run locally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): prettier-format add-e2e-selectors SKILL.md

Un-ignoring .claude/skills brings its files under the repo prettier:check.
main's copy of the add-e2e-selectors skill predates that gate and wasn't
formatted, so the branch-merged-with-main lint failed. Run Prettier on it
(emphasis markers + list-item indentation only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(skills): prefer deletion over inflation

Add a Step 2 rule that deleting a redundant assertion (e.g. a toBeDefined()
prelude before a concrete check) or a duplicate test is a preferred fix over
inflating a weak assertion into a contrived value check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>

* Update .claude/skills/panel-testing-strategy/SKILL.md

Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
2026-07-31 21:20:56 +00:00
Paul MarbachandClaude Opus 4.8 d7a2a852e2 DataViz: Replace circular unit-test expectations with hardcoded literals (#129751)
* DataViz: Replace circular test expectations with hardcoded literals

Several DataViz-owned unit tests computed their expected value the same
way the code under test does — via a sibling production function, a copy
of the production formula, or (in one case) by comparing a value to
itself. A shared bug passes such a test, so it raises coverage without
verifying behavior.

Freeze the expected values as literals (or, for projected coordinates,
an independent WGS84 readback of the input), so a regression in the
resolver/formula/geometry now fails the test. Each was mutation-checked.
Surfaced in review of #129607.

Test-only; no product code changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Revert theme-color and gazetteer test changes per review

fastfrwrd pushed back on these: hardcoding a theme color hex (or a
gazetteer coordinate) couples the test to palette/geometry internals and
breaks on a legitimate theme change without catching a real bug —
resolving a named color via getColorByName is trusted lower-layer
behavior worth asserting against directly. Restore the original
assertions in color, gazetteer, barchart, and xychart.

Keeps the non-color literal fixes that weren't contested: getLayersExtent
extents, TableNG row height, the RadialGauge self-comparison no-op fix,
and the UPlotScaleBuilder range.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-31 12:13:16 -04:00
Ashley Harrison 128cc20b18 fix build and fix some tests 2026-07-31 16:29:26 +01:00
Ashley Harrison 3fa9ca77d7 Merge branch 'main' into ash/remove-react19-flag 2026-07-31 16:08:30 +01:00
Ashley Harrison 1e4492f7f7 Timeseries: use useTheme2 to get theme (#129755)
* use useTheme2 to get theme

* fix contrast checker on (by series name) matchers

* replace config.theme2 with hooks

* keep config.theme2 in sync

* fix review finding

* add theme to dep array

* remove unused export
2026-07-31 16:06:31 +01:00
Ashley Harrison 4fedeb0f38 restore dep 2026-07-31 15:39:07 +01:00
Ashley Harrison 721aff66f3 Merge branch 'main' into ash/remove-react19-flag 2026-07-31 15:25:28 +01:00
Ashley Harrison 6f8890a50f fix @types/react dep 2026-07-31 14:47:18 +01:00
Paul MarbachandClaude Opus 4.8 edddc12373 DataViz: Tidy xychart SeriesEditor test casts and mocks (#128955)
* test(SeriesEditor): remove config casts and thin grafana/ui mocks

Two readability cleanups to the xychart SeriesEditor tests:

- Drop the `onChange.mock.calls[n][0] as XYSeriesConfig[]` casts. A typed
  `renderEditor()` helper returns a `jest.MockedFunction` onChange spy plus
  `configAt(n)` / `lastConfig()` accessors, so tests read emitted configs
  without indexing or casting. The typing also surfaced that onChange's
  argument is genuinely optional, which the cast had hidden — the accessors
  now guard for it explicitly.
- Delete the `@grafana/ui` `Select` mock entirely; the frame field now
  exercises the real Select via the `selectOptionInTest` helper and the real
  clear control.
- Keep a thin `FieldNamePicker` stub but remove the `mockPickerItems` module
  global. Picker settings (`filter`, `baseNameMode`) are read back through
  the typed `jest.mocked(FieldNamePicker)` calls via a `pickerSettings` helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* XYChart: consolidate SeriesEditor test Options cast into one helper

Route every context mapping through a single mappingOptions() helper so the
narrowing 'as Options' cast lives in exactly one place.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-31 09:15:40 -04:00
Ashley Harrison b07e700460 changes needed for react19 proper 2026-07-31 13:57:45 +01:00
Jack Westbrook 6ff2f377f2 TestData: Add e2e-selectors data-testid key and wiring for series count (#129768)
* test(e2e-selectors): add data-testid key for TestData series count

* test(testdata): wire series count selector in random walk editor
2026-07-31 12:58:48 +02:00
grafana-pr-automation[bot]andgrafana-pr-automation[bot] <140550294+grafana-pr-automation[bot]@users.noreply.github.com> 38a7b9a368 I18n: Download translations from Crowdin (#129834)
New Crowdin translations by GitHub Action

Co-authored-by: grafana-pr-automation[bot] <140550294+grafana-pr-automation[bot]@users.noreply.github.com>
2026-07-31 10:58:03 +00:00
Jack Westbrook b7f5816d32 InfluxDB: Add e2e selectors for config page pathfinder guides (#129814)
* E2E Selectors: Add InfluxDB config page selectors

Promotes the existing influxdb-v2-config url/product/query-language
literals into versioned entries (legacy literals preserved under
MIN_GRAFANA_VERSION) and adds organization, default bucket and token
inputs for the InfluxDB v2 config editor.

* InfluxDB: Wire config page e2e selectors

Replaces hardcoded influxdb-v2-config testid literals with the
versioned selectors and tags the organization, default bucket and
token inputs (both Flux and SQL connection variants).
2026-07-31 11:57:48 +02:00
Paul MarbachandClaude Opus 4.8 97775111c9 Prettier: anchor build and data ignore patterns to repo root (#129781)
* Prettier: anchor `build` and `data` ignore patterns to repo root

The bare `build` and `data` entries in .prettierignore use gitignore-style
matching, so they match any directory of that name at any depth — not just
the repo-root output/runtime dirs they target. This silently hid real source
from prettier, notably public/app/plugins/panel/geomap/layers/data.

Anchor both with a leading slash so they match only the root dirs (mirroring
.gitignore's `/data/*`), and format the source files that were exposed as a
result so `prettier:check` stays green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Prettier: format devenv data.js files exposed by anchoring

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-31 09:34:41 +01:00
cursor[bot]andCursor Agent 1bab284d33 Chore: fix eslint suppressions — no-locale-compare in grafana-testdata QueryEditor (#129813)
Replace String.prototype.localeCompare with a module-scope Intl.Collator
in the scenario select sort. Spec-equivalent (default locale/options), so
sort order is unchanged. Removes the @grafana/no-locale-compare suppression
for this file.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-07-31 09:26:28 +02:00
Jack Westbrook 54d5ee0eb9 E2E Selectors: Add selectors for gauge effects editor switches (#129725)
* test(e2e-selectors): add selectors for gauge effects editor switches

* test(gauge): wire pathfinder selectors for gauge effects editor switches

* test(e2e-selectors): nest gauge effects switches under PanelEditor group
2026-07-30 20:46:40 +02:00
Ryan Morris d1841a55e2 MySQL: Remove from core plugins (#129439)
* MySQL: Remove from core plugins

* Chore: Remove sqlmacro package

* Chore: Remove sqlmacro from codeowners file
2026-07-30 08:37:03 -05:00
6cc99a7ec1 TestData: wire scenarioSelect and labelsInput onto QueryEditor (#128759)
* TestData: wire scenario select and labels input e2e selectors

Wires the existing-but-unused scenarioSelect aria-label onto the
Scenario <Select>, and adds+wires a new templated labelsInput(refId)
selector onto the per-query Labels input.

Split out of grafana/grafana#128750 per the MT service compatibility
check, since this touches an independently-deployed data source
plugin (public/app/plugins/datasource/*).

* Revert QueryEditor.tsx wiring, moved to a stacked follow-up PR

check-separation flags any PR touching both packages/grafana-e2e-selectors
and public/app/plugins/datasource/*, regardless of what else is in the
diff. Keeping this PR to just the new labelsInput selector definition;
the QueryEditor.tsx wiring (this + the pre-existing scenarioSelect) moves
to a PR stacked on top of this one.

* Fix version key on labelsInput to computed main version

Per the add-e2e-selectors skill: new selectors use the current main
version (13.2.0), not MIN_GRAFANA_VERSION.

* TestData: wire scenarioSelect and labelsInput onto QueryEditor

Stacked on jayclifford/first-dashboard-testdata-e2e-selectors, which
adds the labelsInput selector definition. This PR only touches the
datasource plugin file itself, so check-separation passes.

* chore: revert change

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2026-07-30 09:07:30 +00:00
Drew Slobodnjak 2228fe25c9 TimeComparison: Fix high cardinality mismatches (#128566)
* TimeComparison: Fix high cardinality mismatches

* Add functional test coverage

* Rework getCompareSeriesIdentityKey slightly

* TimeComparison: Add testing to verify color labels (#128840)

* Fix random walk test data use case

* Update tests
2026-07-29 16:44:55 -07:00
Paul MarbachandClaude Opus 5 1ac6e917a1 Stat: Improve unit test coverage (#129018)
* Stat: Improve unit test coverage

Adds a common.test.ts (the option builders had no coverage), and expands
the migration and panel render tests to exercise previously-untested
branches: angular colorValue/lineColor migration paths, the
grafana-singlestat-panel plugin id, textMode None, the Area sparkline
path, percent change, and all-values rendering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* improve tests in my imo

* missed snapshot in commit

* fix import

* updates from review

* clarify assertion

* Stat: strengthen migration/panel/common tests per panel-testing-strategy

Replace a .not.toThrow() assertion with concrete field-config checks, extract a
single time-series frame builder, and swap no-op toBeDefined() checks for exact
value/path assertions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Stat: tighten migration test names and gates

Apply the panel-testing-strategy conventions to the Stat migration tests:

- Collapse the topic-named graphMode/colorMode/textMode cases into three
  it.each tables whose names state the asserted value.
- Add a single makePanel() builder instead of per-test PanelModel casts.
- Cover the colorBackground-over-colorValue precedence and the case where a
  sparkline lineColor must not become a fixed field color because the value
  was already colored.
- Drop the duplicated colorBackground case.
- The non-singlestat test passed for the wrong reason: with empty prevOptions
  the missing `angular` key short-circuited the migration, so the assertion
  held for any plugin id. Pass migratable angular options so the plugin id is
  the only gate.
- Remove format/decimals setup that no assertion used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 22:14:02 +00:00
Paul MarbachandClaude Opus 4.8 1ec0c8c8cf Geomap: Add unit tests for gazetteer, layer registry, esri, and style dimensions (#129607)
* Geomap: Add unit tests for gazetteer, layer registry, esri, style dims

Focused unit-first coverage for geomap/geo pure logic, following the
panel-testing-strategy conventions (real ol as data constructors,
concrete-value assertions, it.each for variants).

- frameAsGazetter: lat/lng detection (incl. LATITUTE/LONGITUE aliases),
  geohash and existing-Point derivation, non-point centroid, key detection
  (*_CODE/UID/first-string fallback), case-insensitive lookup, count/examples
- getLayersOptions: basemap vs overlay sets, current selection, alpha gating
  (label/bolt/ordering) and the beta fall-through, via deterministic layer mocks
- esri basemap create(): service->ArcGIS slug URL, default fallback, custom
  passthrough, TileLayer/XYZ shape
- getStyleDimension: custom-config vs style.fields branches and the text gate

Test-only; no product code changed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Geomap: Fix typecheck and prettier issues from CI

- Cast pointFieldFrom*().values[0] to Point before getCoordinates()
  (Field values are typed as the Geometry base class)
- StyleConfigFields values are driving field-name strings, not booleans
- Apply prettier formatting

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Geomap: Add stretch unit tests for lastPointTracker, maplibre, marker fallbacks

Covers three previously-untested alpha/basemap paths:
- lastPointTracker create().init() + update() tracking the last row coordinate
- maplibre init() LayerGroup/opacity and style-URL fetch selection
- getMarkerMaker text-label and error-marker fallbacks

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-29 17:10:05 -04:00
Adela Almasan 16dc9c7988 Text: New editor (#129499) 2026-07-29 15:31:47 -05:00
Victor Marin feea3042ea AnnotationsTooltip: Fix k8s annos not being editable (#129379)
* fix k8s annos not being editable

* tests

* fix

* fix
2026-07-29 06:00:53 -05:00
ismail simsek fbdd82fde3 Prometheus: Remove from core plugins (#129332)
* remove prometheus frontend

* remove prometheus backend

* remove prometheus from more places

* remove prometheus datasource from backend

* remove from more places

* mroe removal

* move logos

* fix proxy_test

* fix unit tests maybe

* prettier

* remove

* update with alertlist

* update tests
2026-07-29 12:16:22 +02:00
Paul MarbachandClaude Opus 4.8 24e12c0221 test(dataviz): fix no-op waitFor readiness gate in canvas tests (#129467)
waitFor(() => uPlotInstance?.status === 1) never retries: a waitFor callback
must throw to trigger a retry, and a falsy return does not, so the uPlot
readiness gate resolved immediately without actually waiting. Use
waitFor(() => expect(uPlotInstance?.status).toBe(1)), matching the idiom
already used in TimelineChart.canvas.test.tsx.

Affects the HeatmapPanel, XYChartPanel, and SparklineCell canvas suites. No
snapshot changes: each suite's follow-up .u-over waitFor already gated actual
render, so this only hardens the readiness wait.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 23:54:14 +00:00
Paul MarbachandClaude Opus 4.8 0139ecce13 Table: Add unit tests for cell editors, module, and suggestions (#129441)
* Table: Add unit tests for cell editors, module, and suggestions

Backfills coverage for the previously untested custom cell-option editors,
the panel module wiring, and the suggestions supplier in the table panel.

Follows the panel-testing-strategy conventions: concrete-value and exact
call-argument assertions, behaviour-specific test names, it.each for
enumerable variants, and boundary cases for the suggestion scoring.

- suggestions: score thresholds (Best/Good/OK) incl. strict boundaries and
  the preview card modifier
- module: plugin wiring plus the "Cell value inspect" and "Tooltip
  placement" showIf branches
- TableCellOptionEditor: cell-type switching, sub-editor swapping, and the
  settings cache restore-on-switch-back
- cell editors: each editor's onChange output and showIf filtering

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Table: Address self-review feedback on editor/module tests

- Cover multiple cell-type sub-editors (not just gauge) via it.each
- Rework the type-change test to start from a configured gauge and
  affirmatively assert the previous settings are discarded
- Combine the "Cell value inspect" showIf cases into a single tagged
  it.each table
- Reword the suggestions-supplier test name

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Table: Initialize standard editors registry in module test

Building the plugin's fieldConfigRegistry runs the table useCustomConfig
path, which resolves the 'stats-picker' standard editor. Without calling
standardEditorsRegistry.setInit(getAllOptionEditors) the registry access is
order-dependent and can throw when the file runs alone. Matches the setup in
bargauge/module.test.ts and SparklineCellOptionsEditor.test.tsx.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Table: Make sparkline showIf test assert real behavior

The previous assertion queried the bar-alignment option with getByLabelText,
but a wrapped radiogroup option editor has no label association, so that query
was null whether the option was shown or hidden — the test was vacuous.

Query by the field's label text instead and cover both states: shown for the
Bars draw style, hidden otherwise. The positive case proves the query is not
always-null.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Table: assert suggestions supplier delegation instead of duplicating output test

The module test now checks that the plugin delegates to tableSuggestionsSupplier
(scores flow through); the supplier's own count/score semantics stay in
suggestions.test.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Table: guard suggestion supplier/plugin results for void return type

tableSuggestionsSupplier and PanelPlugin.getSuggestions are typed to return
void as well as an array; narrow both before mapping so the test typechecks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 19:34:58 -04:00
Paul Marbach 09a088f843 Revert "Text: New editor (#129150)" (#129493)
This reverts commit bfe238b458.
2026-07-28 18:01:43 -04:00
Adela Almasan bfe238b458 Text: New editor (#129150) 2026-07-28 13:47:32 +00:00
Torkel ÖdegaardandPaul Marbach d15804f693 Gauges: Fix color for unfilled bars (#129259)
* Gauges: Fix color for unfilled bars

* switch to action hover

* update

* Fix

* BarGauge: Refactor to function component and access theme via context

* remove update config.theme2

* remove suppression for function components for BarGaugePanel

---------

Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
2026-07-28 09:46:20 -04:00
Paul MarbachandClaude Opus 4.8 08512853d2 Panels: Stop persisting default values for new graph panel options (#129116)
Newly added timeseries/graph panel options were declared with an explicit
`defaultValue` in their options-builder entries. PanelPlugin collects every
builder `defaultValue` into `plugin.defaults`, and `getPanelOptionsWithDefaults`
merges those into the saved panel options. As a result, opening and saving any
dashboard with graph panels (without making changes) wrote these fields into
every panel's JSON, producing noisy diffs:

  - legend.enableFacetedFilter
  - legend.overflow
  - annotations.multiLane
  - annotations.clustering

Remove the `defaultValue` from these builder entries so the options are only
serialized when a user actually sets them. Runtime behavior is unchanged: all
consumers already fall back to the previous defaults when the value is
undefined (faceted filter off, ellipsis overflow, multi-lane off, clustering
disabled).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 14:55:56 -04:00
Kristina a6669187df XYChart: Add color is undefined as a scenario to use the fallback color (#129322)
add undefined as fallback scenario
2026-07-27 13:44:26 -05:00
Matt Cowley 4b7d723d46 Home: Show news card when incident card unavailable (#129220)
* Move incident card gate to parent

* Add news card when no incident card

* Tweak dashboard tab list padding

* Don't show error while loading

* Don't full-width news images for mobile
2026-07-27 16:04:06 +01:00
ismail simsek 36985cec18 Loki: Remove from core plugins (#129092)
* remove loki backend

* remove loki frontend

* remove loki from various places

* remove loki from more places

* copy/paste loki stuff for the sake of the rest

* prettier

* go work sync

* update wire

* retrigger

* fix unit tests

* update

* fix adhoc e2e tests

* gen jsonnet

* remove loki tests

* update CODEOWNERS

* copy unit tests

* put loki devenv back

* make gen-jsonnet

* update yarn.lock

* put loki-promtail back
2026-07-27 16:54:25 +02:00
Torkel Ödegaard 0fedc2dcda AlertList: Fixes link color in visual refresh (#129203)
Update
2026-07-26 10:39:37 +02:00
Dominik ProkopandClaude Fable 5 bdcd0c6aae Dashboards: Fix duplicate timeCompare series on streaming queries, drop processor fork (#128796)
* Dashboards: Fix duplicate timeCompare series on streaming queries, drop processor fork

timeShiftAlignmentProcessor mutated refId/meta in place on frames owned
by Loki's split-query accumulator, so every re-emitted chunk appeared
as a new series to the merge layer and comparison series duplicated per
chunk. The processor now lives in @grafana/scenes (exported there) and
returns new frame objects; dashboard-scene's private fork is deleted.

alignTimeRangeCompareData in @grafana/data had the same in-place
mutation hazard at render time - it now returns a copied frame without
breaking its public signature.

Depends on the @grafana/scenes canary from grafana/scenes#1583; the pin
moves to stable once that releases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Bump @grafana/scenes canary to 29911997371 (idempotent getCompareSeriesRefId)

Main pre-suffixes compare target refIds at request time (#128132), so
the scenes processor must not double-suffix them - the guard landed in
grafana/scenes#1583.

@grafana/scenes-react stays on the previous canary because its publish
kept failing on npm provenance tlog 409s; a resolutions entry forces its
nested @grafana/scenes to the new canary so a single copy is installed.
Both the pin and the resolution go away when scenes#1583 ships stable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Bump @grafana/scenes to stable 8.13.4

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 20:30:27 +00:00
173a27e1bb Explore Logs: fix infinite scroll do not rely on loading only (#129058)
---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Matias Chomicki <matias.chomicki@grafana.com>
2026-07-24 19:45:18 +00:00
Tom Ratcliffe c2d56a58d1 Testing: Migrate navigation squad tests to MSW and add auth handlers to test-utils (#128607) 2026-07-24 16:40:02 +01:00
bf4d3c600a Azure monitor: Azure Metrics Batch API Implementation frontend (#123697)
* Add Azure Monitor Batch API frontend implementation

* Add tests and refactor

* Update config toggles UI

* Address PR comments

* address cursorbot

* Another fix

* Fix lint

* Fix api version

* Exclude unsupported namespaces

* Prettier

* add tracking

---------

Co-authored-by: alyssajoyner <alyssa.bull@grafana.com>
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2026-07-24 07:56:43 -06:00