Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Conversation

@imbhargav5
Copy link
Contributor

Description

This PR is about adding a right rail of TOC on desktops only. I am trying to minimise the number of divs I add for the sake of layout purposes. Please provide feedback to this draft PR.

Related Issues

This PR attempts to fix #192

@sagirk
Copy link
Contributor

sagirk commented Mar 27, 2019

@imbhargav5 See if you find the notifyWhenStickyHeadersChange utility useful.

It has been used here: https://github.com/nodejs/nodejs.dev/blob/master/src/components/layout.tsx#L31-L55.

@imbhargav5
Copy link
Contributor Author

Sorry this is taking a touch longer. I fell sick last week. Will put in time this weekend. Thanks!!

@imbhargav5
Copy link
Contributor Author

imbhargav5 commented Apr 4, 2019

Here is a preview of what it looks like right now.

Image from Gyazo

Image from Gyazo

I had to go for a different TOC component because structurally, it needs to be an immediate child of the main element in layout.

I feel like there is some duplication, so if you have any ideas on how I can restructure this, I would love to hear them very much.

@imbhargav5 imbhargav5 marked this pull request as ready for review April 4, 2019 16:35
@sagirk
Copy link
Contributor

sagirk commented Apr 6, 2019

/gcbrun

@github-actions
Copy link

github-actions bot commented Apr 6, 2019

@ahmadawais
Copy link
Member

ahmadawais commented Apr 6, 2019

@imbhargav5 Nice.

Some issues I see.

  1. Try to keep the styling consistent → https://on.ahmda.ws/02eaa5
  2. Don't load the heading or TOC if there is not TOC → https://storage.googleapis.com/staging.nodejs.dev/8adb53a/differences-between-nodejs-and-the-browser
  3. Make the font size extra small. So that this doesn't feel like part of the content.

@ahmadawais
Copy link
Member

/gcbrun

@nodejs nodejs deleted a comment from codecov-io Apr 10, 2019
@github-actions
Copy link

@ahmadawais
Copy link
Member

ahmadawais commented Apr 10, 2019

Just tested the live demo. Styling doesn't look well thought out.

  • Line height is too much. Could be just 1
  • Different padding on the heading and the links.
  • Reduce the padding to be only at the bottom

Happy to answer any questions you have. Thanks for your work on this.
Peace! ✌️

@ahmadawais
Copy link
Member

Take a look at this document's right side navigation for inspiration → https://docs.microsoft.com/en-us/teamblog/announcing-open-specifications-migration#redirection-for-msdn

The links change visually when clicked and selected.

@LaRuaNa
Copy link
Contributor

LaRuaNa commented Apr 11, 2019

Lovely, quite excited about this PR :] Just noticed in isSmallScreen are both mobile TOC and rigth rail shown. So we should remove the mobile TOC if isSmallScreen.

@imbhargav5 For inspiration see also: https://docs.gitlab.com/ee/README.html

@imbhargav5
Copy link
Contributor Author

@LaRuaNa It seems like I made a typo. I put in display: hidden haha. So it was showing on slightly smaller screens. I personally feel we should show TOCDesktop on only large screens, since, on some small screens, TOC on the right shrinks the content visibly.

@imbhargav5
Copy link
Contributor Author

@ahmadawais How do you think I can do visual changes on click? 🤔

TOC ul and li items are mainly from the html string set with dangerouslySetInnerHTML. Is there a css only solution for this?

@ahmadawais
Copy link
Member

Yes, you can target all sorts of stuff with CSS. Right now there's no interaction when you hover the links. Use the same hover animations as used in the content. Find them in the layout.css file.

@amiller-gh
Copy link
Member

/gcbrun

@MylesBorins
Copy link
Contributor

/gcbrun

eventual staging example will be on https://storage.googleapis.com/staging.nodejs.dev/f849ca9/index.html

@MylesBorins
Copy link
Contributor

What's the status of this?

/gcbrun again so we can preview

eventual staging example will be on https://storage.googleapis.com/staging.nodejs.dev/$SHA/index.html

@alexandrtovmach alexandrtovmach added the enhancement New feature or request label Apr 25, 2020
@MylesBorins
Copy link
Contributor

Should this be closed?

@MylesBorins
Copy link
Contributor

/preview

@github-actions
Copy link

Please find a preview at: https://staging.nodejs.dev/199/

@MylesBorins
Copy link
Contributor

/preview

@github-actions
Copy link

Please find a preview at: https://staging.nodejs.dev/199/

@MylesBorins
Copy link
Contributor

Ok the preview is working!

I think this is a great addition but it definitely looks weird on the smaller view on desktop. Picture below

Screen Shot 2020-04-28 at 12 42 53 AM

Should this content potentially be hidden at that size?

@imbhargav5
Copy link
Contributor Author

Hi 👋 Sorry I lost track of this. Struggling for time for a while now.

@designMoreWeb
Copy link
Contributor

Was using old design therefore closing PR

@nschonni nschonni deleted the feat/right-rail branch September 10, 2022 15:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display TOC in a right rail on wide-enough screens

9 participants