Skip to content

perf(metrics): keep unchanged metric panels stable when another panel changes - #128357

Draft
JoshuaKGoldberg wants to merge 2 commits into
joshgoldberg/logs-1035-reduce-lag-when-expanding-or-collapsing-metricsfrom
joshgoldberg/logs-1035-functional-metric-query-setters
Draft

JoshuaKGoldberg wants to merge 2 commits into
joshgoldberg/logs-1035-reduce-lag-when-expanding-or-collapsing-metricsfrom
joshgoldberg/logs-1035-functional-metric-query-setters

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Unchanged metric panels now keep the same query params and mutators when another panel changes, because row mutators hand updater functions to setQueries instead of closing over the rendered queries.

This is done by:

  • Switching row mutator updater functions to setQueries
  • Moving the URL-backed provider onto nuqs and its nice stable setter

Split out of #128357 so we don't have to use esoteric React hooks.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 21, 2026
@sentry

sentry Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 754 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.77% 95.77% ±0%
Typed 141,381 141,395 🟢 +14
Untyped 6,247 6,248 🔴 +1
🔍 1 new type safety issue introduced

Non-null assertions (!) (1 new)

File Line Detail
static/app/views/explore/metrics/useMetricQueriesController.tsx 196 rowMutators[i]!

This is informational only and does not block the PR.

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

LOGS-1035

… changes

Row mutators hand updater functions to setQueries instead of closing over the rendered queries, and decoded queries are cached per URL value and index, so unchanged panels keep the same query params and mutators. The URL-backed provider moves onto nuqs, whose setter is stable and composes queued writes.
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the joshgoldberg/logs-1035-functional-metric-query-setters branch from 3de35e2 to f512f71 Compare October 21, 2026 15:34
@JoshuaKGoldberg JoshuaKGoldberg changed the title ref(metrics): Replace the latest-queries ref with updater-based setters perf(metrics): Keep unchanged metric panels stable when another panel changes Oct 21, 2026
…lapsing-metrics' into joshgoldberg/logs-1035-functional-metric-query-setters
@JoshuaKGoldberg JoshuaKGoldberg changed the title perf(metrics): Keep unchanged metric panels stable when another panel changes perf(metrics): keep unchanged metric panels stable when another panel changes Oct 21, 2026

This branch was successfully deployed

1 active deployment
Preview — f41d472c Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant