Skip to content

feat(sidebar): normalize page links and control root chevrons - #2790

Open
sy-records wants to merge 4 commits into
developfrom
feat/chevron
Open

feat(sidebar): normalize page links and control root chevrons#2790
sy-records wants to merge 4 commits into
developfrom
feat/chevron

Conversation

@sy-records

@sy-records sy-records commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Normalize link-only paragraphs in loose sidebar lists from <li><p><a> to <li><a>
  • Ensure sidebar links render consistently regardless of the Markdown list marker or list tightness
  • Preserve text-only paragraphs used as sidebar group titles
  • Add sidebar-chevron-root-hidden to hide chevrons on root-level page links and group titles
  • Simplify active, expanded, and collapsed sidebar CSS by removing loose-list compatibility selectors
  • Add regression coverage for normalized DOM, active highlighting, chevron states, and collapsing
  • AddcollapsibleSidebarGroups

Usage

<body class="sidebar-chevron-right sidebar-chevron-root-hidden">

Related issue, if any:

#2784 (comment)

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

  • Yes
  • No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docsify-preview Ready Ready Preview Aug 24, 2026 12:30pm

@paulhibbitts

paulhibbitts commented Aug 24, 2026

Copy link
Copy Markdown
Member

Hi @sy-records , your new collapsibleSidebarGroups config is awesome and works super well!

The PR preview build (with collapsibleSidebarGroups disabled by default) vs. released v5 now look identical:
https://preview.docsify-this.net/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-this-multiple-page-open-publishing-site/main&homepage=home.md&sidebar=true&loadSidebar=_sidebar.md&hide-credits=true&core-theme-styles=true#/

https://docsify-this.net/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-this-multiple-page-open-publishing-site/main&homepage=home.md&sidebar=true&loadSidebar=_sidebar.md&hide-credits=true&core-theme-styles=true#/

And now, the PR preview build with collapsibleSidebarGroups set to true: 🚀
https://preview.docsify-this.net/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-this-multiple-page-open-publishing-site/main&homepage=home.md&sidebar=true&loadSidebar=_sidebar.md&hide-credits=true&core-theme-styles=true&collapsibleSidebarGroups=true

NOTE: For an unknown reason the chevrons seem to shift a bit once collapsibleSidebarGroups is enabled - there seems to be a bit of extra padding added to the right side of the sidebar that causes the shift. Can you replicate that in your end?

I will more fully test things later today but just wanted to share initial results - great work 🙌🏼

@paulhibbitts

paulhibbitts commented Aug 24, 2026

Copy link
Copy Markdown
Member

Ok @sy-records I've updated the earlier CodeSandbox with this PR Preview Build:
https://codesandbox.io/p/sandbox/black-https-hj7935

I tested the new collapsibleSidebarGroups being not set, false and true and all worked well.

I confirmed the earlier issue of slight shifting to the right on chevrons when collapsibleSidebarGroups is enabled, and can confirm extra padding is present which looks like the cause:

2026-08-24_08-18-50

I was also able to test <body class="sidebar-chevron-right sidebar-group-box sidebar-chevron-root-hidden"> to suppress the display of chevrons.

So everything is looking good except for the shifted chevrons issue.

@sy-records

Copy link
Copy Markdown
Member Author

The link you provided seems to have a problem, but I compared all three and didn't find any issues.

https://preview.docsifyjs.org/#/?id=docsify
https://docsify.js.org/#/?id=docsify
https://docsify-preview-git-feat-chevron-docsifyjs.vercel.app/preview/#/?id=docsify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants