Resolve "EI Dashboard: Add tab query param for deep linking to a dashboard view"

What does this MR do and why?

Adds deep linking to a specific view (tab) of a multi-view analytics dashboard on the Explore analytics dashboards page, as proposed in the follow-up to the MR that introduced dashboard views (see References).

  • Switching views now updates the URL with a ?view=<index> query param without a page reload, by enabling GlTabs' built-in syncActiveTabWithQueryParams with query-param-name="view" (which also syncs the active view on browser back/forward). The view index is used rather than the title, since titles are not guaranteed to be URL-safe or unique.
  • Loading a dashboard with ?view=<index> opens the corresponding view. The view is restored from the query param before the first panel render (via the dashboard loader's loaded event), so the wrong view's panels never mount or fire queries.
  • An invalid or out-of-range param falls back to the first view. The stray param is intentionally left in the URL until the next view switch, matching the behavior of every other syncActiveTabWithQueryParams consumer.
  • Navigating to a different dashboard resets to the first view, since router navigation drops the query string.

No changelog entry: the page is behind the default-off explore_analytics_dashboards feature flag.

Screenshots or screen recordings

How to set up and validate locally

  1. Enable the feature flag in the rails console: Feature.enable(:explore_analytics_dashboards)
  2. From Explore > Analytics dashboards, open the Engineering Intelligence dashboard (it defines multiple views).
  3. Switch views — the URL updates with ?view=<index> without a reload; browser back/forward walks through the views.
  4. Reload the page with ?view=1 in the URL — the second view is active.
  5. Try ?view=99 or ?view=abc — the dashboard falls back to the first view.
  6. Navigate to a different dashboard — the selection resets to the first view.

References

Edited by Brandon Labuschagne

Merge request reports

Loading
Loading