-
Investigation (issue #2969 / sticky tabs on PRs)
Validation of current code
Pull request detail already uses the same sticky-row markup as issue detail:
<div class="sticky-tabs-sentinel …"></div> <div class="sticky-tabs-row d-flex align-items-center mb-5"> <ul … class="tabs nav nav-tabs nav-tabs-line …"></ul> <a … class="more-info side-info more-info-dock …"></a> </div>And
base.cssalready sets sticky on that row:.sticky-tabs-row { position: sticky; top: 0; z-index: 990; … }So adding Bootstrap
.position-stickyis not filling a missing sticky declaration on PR pages..sticky-tabs-rowalready hasposition: sticky. Bootstrap.position-stickyisposition: sticky !important, which mainly changes cascade priority.Likely root cause of “works on issues, not on PRs”
There is an intentional exception from issue #2954 / issue #2969:
html:has(.revision-diff) .sticky-tabs-row { position: static; }- Issue detail pages rarely contain
.revision-diff, so.sticky-tabs-rowstays sticky. - PR File Changes embeds
RevisionDiffPanel(.revision-diff). That rule forces the tab row back toposition: static. .revision-diff > .headis itself sticky attop: 0(diff toolbar / path filter). Sticky nav tabs were disabled so they would not compete with that sticky diff head.
That also explains why adding
.position-stickycan “fix” File Changes:!importantoverrides theposition: staticexception and re-enables sticky tabs even when a revision diff is present.On PR tabs without
.revision-diff(Activities, Commits, Builds, Code Comments), sticky should already match issue detail. If those tabs also fail to stick, that would be a different bug than the revision-diff exception.Alternatives (if File Changes sticky is desired)
Approach Pros Cons A. Add .position-sticky/!importanton.sticky-tabs-row(proposed)Minimal markup change; overrides the static exception Reintroduces sticky-on-Changes; two sticky bars at top: 0(nav row +.revision-diff > .head) can overlap / fight; hides intent of the existing CSS exceptionB. Keep exception; document as intentional Preserves revision-diff sticky toolbar UX from issue #2954 File Changes tab bar still scrolls away C. Re-enable sticky tabs on Changes, offset revision-diff head ( top≈ sticky-tabs-row height; sync on resize/wrap)Both bars stay reachable; no !importanthackMore CSS/JS; must handle wrap / docked more-info height; easy to drift D. Narrow the exception (e.g. only disable when .revision-diffis in view / only onPullRequestChangesPagewith a clearer page-scoped rule)Clearer intent than global html:has(...)Does not by itself make Changes sticky; still need B or C for product behavior Recommendation (pending Q1–Q2): Prefer B if the observed failure is File Changes only (current design). Prefer C if sticky primary tabs on File Changes are a product requirement. Avoid A as the long-term fix because it only wins via
!importantand does not solve sticky stacking with the diff toolbar.Clarifying questions
1. On which pull request tabs is the sticky tab row failing?
Option Meaning A File Changes only B All PR tabs (Activities / Commits / Builds / Code Comments / File Changes) C Some non-Changes tabs as well (please name them) Pros / Cons A matches the html:has(.revision-diff)explanation and keeps scope small. B/C imply a separate layout/scroll bug (not fixed by.position-stickyalone).Recommendation A, based on code review — please confirm against a live PR. 2. If File Changes is in scope, should primary tabs stick while the revision-diff toolbar is also sticky?
Option Meaning A No — keep today’s exception (tabs scroll away on File Changes) B Yes — both sticky; offset .revision-diff > .headunder the tab row (approach C above)C Yes — force sticky tabs only (approach A); accept overlap risk with the diff head Pros / Cons A safest for diff UX. B best product outcome if both bars must stay visible. C cheapest but fragile. Recommendation A unless you explicitly want sticky primary tabs on File Changes; then B. 3. Should the follow-up implementation issue also cover Build detail parity / regression checks?
Option Meaning A PR detail only B PR + Build + Issue smoke checks for sticky row + more-info dock Pros / Cons A smaller. B safer because sticky row / dock logic is shared in base.css+side-info.js.Recommendation B.
Provisional implementation plan (after answers)
- Confirm failing tabs (Q1) on a live PR.
- If Q1=A and Q2=A: no code change; document exception; close with Related link only if needed.
- If Q2=B: open an Improvement to re-enable sticky tabs on Changes and offset
.revision-diff > .headby sticky-row height; updatehtml:has(.revision-diff)rules; verify more-info dock + wrap. - If Q1=B/C: investigate scroll/overflow ancestors on PR detail (separate from
.position-sticky); do not treat Bootstrap.position-stickyas the fix. - After direction is locked: create the implementation issue, link it as Related, and close this Question.
@zaakiy please answer 1 / 2 / 3 with letter choices so we can open the implementation issue with the correct scope.
- Issue detail pages rarely contain
-
- a
- I need some more specific clarification on what you mean. Try to give examples of exactly what text content I should look for.
- a
-
@zaakiy Thanks — noted 1=A (File Changes only) and 3=A (PR detail only).
Clarifying question 2 with concrete UI text
On a pull request File Changes page, after you scroll down far enough that the PR title / merge buttons are off-screen, there are two separate toolbars involved:
Bar 1 — primary PR tabs (the row with these tab labels):
ActivitiesFile ChangesCommits/Builds(whichever appear for that PR)Code Comments- plus the
⋯(More info) control on the right
Bar 2 — revision-diff toolbar (directly above the file diffs; look for this controls text):
- placeholder / field:
Filter by path - tooltips / controls:
Diff options(gear),Download patch,Toggle navigation - optionally:
Batched suggestions, and a review progress percentage label
Today’s intentional CSS exception keeps Bar 2 sticky at the top of the viewport while you scroll the diffs, and lets Bar 1 scroll away so the two bars do not compete for
top: 0.2. When scrolling File Changes, what should stick?
Option What you should observe after scrolling deep into the diffs A Keep current behavior. Filter by path/ Diff options (Bar 2) stays pinned at the top. TheActivities/File Changes/Code Commentstab labels (Bar 1) scroll off-screen.B Both sticky, stacked. Tab labels (Bar 1) stay pinned at the very top; Filter by path/ Diff options (Bar 2) stay pinned immediately under those tabs. Neither covers the other.C Force sticky tabs only. Tab labels (Bar 1) stay pinned, but may overlap or fight with Filter by path/ Diff options (Bar 2) because both try to sit at the top.Pros / Cons A safest for the diff toolbar UX (current design). B best if you want to switch tabs without scrolling back up. C cheapest but can hide/overlap the path filter. Recommendation A unless sticky primary tabs on File Changes are a product requirement; then B. Please reply with 2=A, 2=B, or 2=C. After that we can close this Question and open the implementation issue with the correct scope (or close with no code change if 2=A).
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
OD-2969 was intended to change the navigation tabs to be sticky for both issues and pull requests. It was successful for issues but not for pull requests. Perhaps this is because the DOM for pull requests is slightly different.
After investigating, I found that the solution is to add
.position-stickyto the same div that contains.sticky-tabs-rowfor pull requests.Please
Don't assume. Ask high-level clarifying questions if needed.