Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧭 Move collapsed top-bar to primary sidebar on small screens #444

Merged
merged 17 commits into from
Aug 23, 2024

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Aug 5, 2024

This PR reworks our TableOfContents as a PrimarySidebar. In doing so, it adds a new navigation section that is visible below the lg selector (the breakpoint at which the top-nav disappears).

  • >lg: image
  • <lg: image

This uses the same Radix components as the TOC, so it feels on brand.

Fixes #402

Copy link

changeset-bot bot commented Aug 5, 2024

🦋 Changeset detected

Latest commit: 0c735a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@myst-theme/frontmatter Minor
@myst-theme/site Minor
@myst-theme/book Minor
@myst-theme/common Minor
@myst-theme/article Minor
@myst-theme/providers Minor
@myst-theme/diagrams Minor
@myst-theme/jupyter Minor
@myst-theme/styles Minor
@myst-theme/icons Minor
myst-to-react Minor
myst-demo Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@choldgraf
Copy link
Contributor

From a UX perspective I think this is an improvement over what we've got right now (which is that they just disappear). It also matches what the pydata theme does:

CleanShot 2024-08-06 at 11 12 28

The PST takes it a step further and puts all header items into the top section of the primary sidebar (except for a dedicated search button). But I think that's a decision that could be made in the future (e.g. whether to put them all in the sidebar, or have them split between primary and secondary sidebars, or have some other way to access header items on narrow screens).

@agoose77
Copy link
Collaborator Author

agoose77 commented Aug 6, 2024

@choldgraf Yes, PST is a really good prior-art reference for what we might want to happen here. With all of the open PRs merged we should be in a reasonably good spot for small viewports. Folding in other components like the logo and/or logo_text might be something to think about too. But, I also feel that the best practices there also mean it's less of an issue; small logos with text, or big logos without text seem like the best approach in the top bar.

I'm hopeful we'll get all this in, and then do another round of UX evaluations.

@stevejpurves
Copy link
Contributor

@agoose77 made some initial changes here with the intent of keeping the components reusable in other themes including composed themes like mystmd.org which doesn't yet work out of the box with these changes. Basically this is lifting props and letting components higher up the render tree (ideally in the themes) deal with getting the right SiteManifest etc...

This PR is looking good but I'd like to get a parallel PR up on mystmd.org consuming these before merging. Doing that next.

@stevejpurves
Copy link
Contributor

We've also lost alignment after this PR

BEFORE:
alignment-book-current

AFTER:
alignment-book-new

@agoose77
Copy link
Collaborator Author

@stevejpurves I don't think it's this PR that broke alignment; I think something else that merged into main already did this.

@stevejpurves
Copy link
Contributor

@agoose77 I've fixed alignment here in any case as doing so requires moving between this repo and other dependent repos - so to avoid duplicating work, and as the changes required are in the PrimarySidebar as well as a couple of other places, doing it in this pass.

@stevejpurves
Copy link
Contributor

OK this is good to go!!!

Made some changes to scroll behaviour as the 2 independent scrolling units in the sidebar does not work well.

book-theme-nav.mp4

Intending to bring this in ASAP to unblock PR's elsewhere

@stevejpurves stevejpurves self-requested a review August 23, 2024 13:11
@rowanc1 rowanc1 merged commit f0b5251 into main Aug 23, 2024
2 checks passed
@rowanc1 rowanc1 deleted the agoose77/fix-toc-to-sidebar branch August 23, 2024 14:05
@rowanc1 rowanc1 changed the title 🧭 Move collapsed top-bar to primary sidebar on small screens 🧭 Move collapsed top-bar to primary sidebar on small screens Aug 23, 2024
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.

Top header navigation falls out of top bar in thin views
4 participants