Consider a slug for dashboard views instead of an index in the view query param
Context
Follow-up from !247361 (comment 3621858644)
!247361 (merged) added deep linking to a specific view of a multi-view analytics dashboard using a ?view=<index> query param. The index was chosen because it requires no extra configuration when setting up a dashboard, and titles are not guaranteed to be URL-safe or unique.
As raised in review, the positional index has a drawback: if views are reordered, existing bookmarks become stale and point at the wrong view.
Proposal
Discuss adding a slug property to DashboardView in the analytics_dashboard.json schema and using it in the query param instead of the index, e.g. ?view=deployment-frequency.
Trade-offs surfaced so far:
- Pro: bookmarks survive view reordering, and the URL becomes human readable.
- Pro: a slug can be renamed independently of the view title, so it can stay stable across title changes.
- Con: bookmarks still break if the slug itself changes, so this moves the bookmark dependency from reordering to renaming rather than removing it.
- Con: more configuration required when defining a dashboard.
Notes
- The work already done in !247361 (merged) supports the slug approach, so this is an additive change.
- This should be decided before the
explore_analytics_dashboardsfeature flag is rolled out, while the URL format is not yet relied upon by users.
Proposal for resolution
- Agree on whether to move from index to slug.
- If yes: add
slugto theDashboardViewschema, decide whether it is required or optional (with a fallback to index), and update the deep linking to read/write slugs.
Edited by 🤖 GitLab Bot 🤖