Skip to content

Conversation

@RobertJoonas
Copy link
Contributor

@RobertJoonas RobertJoonas commented Feb 10, 2026

Changes

This PR is a pure refactor dealing only with renaming. The diff is quite enormous so I decided to open a separate PR just for that.

Renaming query -> dashboardState globally in the frontend makes sense because:

  • the "dashboard state" that is derived from url search params, doesn't yet represent a query. In order to actually define a "query" dimensions and metrics need to be provided
  • dashboardState also includes fields that are irrelevant when "querying". E.g. resolvedFilters (used for flattening segment filters so the FE could be aware of what filters are applied), and labels (for rendering country, city, region, segment names in filter labels)
  • An actual StatsQuery object is about to be introduced with [WIP] New internal stats endpoint #6035, so this is to avoid a naming clash.

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@RobertJoonas RobertJoonas requested a review from a team February 10, 2026 14:46
@RobertJoonas RobertJoonas force-pushed the fe-query-to-dashboardstate branch from 90de553 to 8d84d45 Compare February 10, 2026 14:48
Comment on lines +95 to +98
* @param {string} config.interval - The interval of the dashboardState, e.g. `minute`, `hour`
* @param {boolean} config.longForm - Whether the formatted result should be in long or
* short form.
* @param {string} config.period - The period of the query, e.g. `12mo`, `day`
* @param {string} config.period - The period of the dashboardState, e.g. `12mo`, `day`
Copy link
Contributor

Choose a reason for hiding this comment

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

meganitpick, non-blocking: in this context, the original is more appropriate I think

// Returns a combination of date and hour. This is because
// small intervals like hour may return multiple days
// depending on the query period.
// depending on the dashboardState period.
Copy link
Contributor

Choose a reason for hiding this comment

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

meganitpick, non-blocking: the original one is more appropriate inside the comment

@apata apata added the preview label Feb 10, 2026
@github-actions
Copy link

Preview environment👷🏼‍♀️🏗️
PR-6059

Copy link
Contributor

@apata apata left a comment

Choose a reason for hiding this comment

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

Wow, we do use the word query in a lot of places. Great job getting them all replaced successfully!

Regarding the new name, I can't think of a better one, but I think internally we should be careful with it for future features. Everything the user sees on the dashboard is part of its state, but not everything should be part of DashboardState and DashboardStateContext. Otherwise, we may trigger unnecessary re-renders that in turn make the page slow for the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants