`mobile-tabs` - Restore feature by Copilot · Pull Request #9231 · refined-github/refined-github · GitHub
Skip to content

mobile-tabs - Restore feature#9231

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/fix-mobile-tabs-selectors
Draft

mobile-tabs - Restore feature#9231
Copilot wants to merge 7 commits intomainfrom
copilot/fix-mobile-tabs-selectors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

Description

GitHub’s repo tab DOM changed, which broke mobile-tabs on mobile widths (notably Safari). This PR restores the feature for the current repo tab markup and incorporates follow-up review feedback.

  • Selector strategy updated
    • Replace :root + :has() matching with nav[class*='LocalNavigation'] as the container selector.
    • Remove stale legacy selectors that no longer match current markup (e.g. old .UnderlineNav* / .Counter branches).
  • Mobile layout behavior
    • Keep compact grid layout for icon/title/counter, hover styling, and selected-tab underline offset.
    • Ensure li > a fills available height and bottom-aligns tab content.
  • Label adjustments
    • Keep Pull requests shortened to Pulls.
    • Shorten Security and quality to Sec.
    • Keep custom pseudo-label text non-bold.
  • Counter behavior
    • Keep icon and counter margin reset (margin: 0 !important).
    • Keep fallback layout for missing/empty/hidden counters.
    • Remove icon-missing fallback logic per review feedback.

Test URLs

Screenshot

Copilot AI linked an issue Apr 20, 2026 that may be closed by this pull request
1 task
@fregante fregante changed the title [WIP] Fix selectors in mobile-tabs.css for new DOM structure mobile-tabs - Restore feature Apr 20, 2026
@fregante fregante added the bug label Apr 20, 2026
Copilot AI changed the title mobile-tabs - Restore feature Update mobile-tabs selectors for GitHub’s new repository nav markup Apr 20, 2026
Copilot AI requested a review from fregante April 20, 2026 16:38
@fregante fregante changed the title Update mobile-tabs selectors for GitHub’s new repository nav markup mobile-tabs - Restore feature Apr 20, 2026
Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

  • li > a doesn't fill li vertically, li has this style:
    .prc-UnderlineNav-UnderlineNavItem-syRjR {
      flex-direction: column;
      align-items: center;
      display: flex;
    }
  • the contents of li > a should be bottom-aligned
  • the data-tab-item="security-and-quality" tab has a long label. shorten to "Sec" like we did for Pulls
  • the custom "Pulls" label is bold, but it shouldn't be bold anymore
  • some tabs are missing the counter, so the top-right cell is empty; refer to the previous CSS to target this format again, it will center the icon horizontally. We already have CSS that does this but the selectors are out of date.
  • Some tabs are missing the icon, the same thing should happen
  • The icon and counter should have margin:0!important
  • Don't rename the PR

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 20, 2026

Copilot AI requested a review from fregante April 20, 2026 16:49
@fregante fregante marked this pull request as ready for review April 20, 2026 16:51
Comment thread source/features/mobile-tabs.css Outdated
Comment thread source/features/mobile-tabs.css Outdated
Comment thread source/features/mobile-tabs.css Outdated
@fregante fregante marked this pull request as draft April 20, 2026 17:12
@fregante
Copy link
Copy Markdown
Member

fregante commented Apr 20, 2026

Here's what I got so far:

Screenshot 2

The icons are completely removed from the DOM via React under 609 pixels, so this is the best we can do:

Screenshot 3

@fregante
Copy link
Copy Markdown
Member

Copilot AI requested a review from fregante April 20, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

mobile-tabs broken

2 participants