Skip to content

Re-add query parameters for tabs

Sarah German requested to merge sarahg/tabs-query-params-on into main

What does this MR do and why?

Adds a URL query parameter for tabs, giving each tab a URL that can be used to open a tab by default on page load.

We removed these query parameters in !3067 (comment 1085608893) to prevent folks from using these in links to docs content because we don't have a way to test for outdated/broken tab references; however, without the query params, tabs can collide with anchor links. This collision causes undesirable scrolling behavior in some conditions (see #1312 (closed)).

Since we still probably do not want tabs query parameters to be used in links, I also opened an MR to add a Vale rule to warn for that: gitlab!107500 (merged)

Closes #1312 (closed)

Screenshots, screen recordings, or links to review app

Before After
image image

Example page with tabs: https://sarahg-tabs-query-params-on.docs.gitlab-review.app/ee/ci/pipelines/downstream_pipelines.html

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Verify the bug is gone:

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Visit a page that has tabs a link that includes an anchor, like this: http://127.0.0.1:3000/ee/ci/pipelines/downstream_pipelines.html#mirror-the-status-of-a-downstream-pipeline-in-the-trigger-job
  3. Scroll down the page a bit and click on tabs further down the page. You should not be scrolled back up to the anchor you arrived with.

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah German

Merge request reports