Skip to content

Conversation

@flarnie
Copy link
Contributor

@flarnie flarnie commented Sep 14, 2017

what is the change?:

  • Adds media queries and JS to make sidebar collapse/expand from a
    sticky bottom bar on small screen sizes
  • This is very much a WIP! Tons of stuff is not finished or working as I'd like.

Let's either use this as a discussion starter or continue work on top of it. 🏗🙌

why make this change?:
Moving closer to Joe's fantastic design. :)

test plan:
Manual testing -

short_sidebar_gif_9_14

issue:
Various items under the Sidebar Component on this checklist;
https://github.com/bvaughn/react/wiki/Gatsby-check-list

@flarnie
Copy link
Contributor Author

flarnie commented Sep 14, 2017

Major concerns here:

  • We want to make this maximally accessible, even in cases where JS could be disabled and/or folks are using screen readers or AX tech.
  • It doesn't quite work yet. I just implemented a version of the small-screen mock.

@flarnie
Copy link
Contributor Author

flarnie commented Sep 18, 2017

At this point if nobody has blockers I'm inclined to land this, so that anyone can work on top of it. Will do that tomorrow unless I get changes requested. 😁

**what is the change?:**
- Adds media queries and JS to make sidebar collapse/expand from a
  sticky bottom bar on small screen sizes
- Many TODOs still open! This is just an initial version.

**why make this change?:**
Moving closer to Joe's fantastic design. :)

**test plan:**
Manual testing - Flarnie will insert a gif

**issue:**
Various items under the `Sidebar Component` on this checklist;
https://github.com/bvaughn/react/wiki/Gatsby-check-list
**what is the change?:**
We skim the items in the 'defaultActiveSection' to find the currently
active one, and display it's title in the sticky responsive bottom
navbar.

Before I had just plugged in the section title as a placeholder.

**why make this change?:**
It's better this way. One step closer to Joe's shiny new design. :)

**test plan:**
Manually tested (Flarnie will insert a screenshot)

**issue:**
Sidebar items on this checklist;
https://github.com/bvaughn/react/wiki/Gatsby-check-list
@flarnie flarnie force-pushed the responsiveSidebarGatsbyDocsUpdate branch from 21096d3 to 547f651 Compare September 18, 2017 07:32
@flarnie
Copy link
Contributor Author

flarnie commented Sep 18, 2017

Just pushed an update the fixes the title in the bottom navbar:
screen shot 2017-09-18 at 5 29 35 pm

@flarnie flarnie changed the title [Gatsby Docs Update] WIP/Initial version of new sidebar [Gatsby Docs Update] Initial version of new sidebar Sep 18, 2017
@bvaughn
Copy link
Contributor

bvaughn commented Sep 18, 2017

Picking this up for the moment.

// TODO: memoize to save doing O(n) on the active section items + subitems every
// time.
function findActiveItemTitle(location, defaultActiveSection) {
const {items} = defaultActiveSection;
Copy link
Contributor

@bvaughn bvaughn Sep 18, 2017

Choose a reason for hiding this comment

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

This line causes errors for me.

yarn build fails with:

WebpackError: Cannot read property 'items' of null

yarn dev shows a runtime redbox with:

TypeError: Cannot read property 'items' of undefined

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that I happened to have this page open when running yarn dev:
http://localhost:8000/blog/2013/06/12/community-roundup.html

@bvaughn
Copy link
Contributor

bvaughn commented Sep 18, 2017

Seems a little busted? 😁

loopty-scrolling

@joecritch
Copy link
Contributor

@flarnie @bvaughn Hi folks, I've merged these changes into #10707. Is someone okay to close this? (Also, the above should be fixed on mine, but it's still WIP)

@Mathspy
Copy link

Mathspy commented Sep 19, 2017

@joecritch I think you meant #10735

@bvaughn bvaughn closed this Sep 19, 2017
@bvaughn
Copy link
Contributor

bvaughn commented Sep 19, 2017

Done!

@flarnie flarnie deleted the responsiveSidebarGatsbyDocsUpdate branch May 25, 2018 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants