Skip to content

Upgrade sidenav search to include sub-section titles#2151

Merged
chandlerprall merged 6 commits intoelastic:masterfrom
chandlerprall:feature/docs-search-subroutes
Jul 22, 2019
Merged

Upgrade sidenav search to include sub-section titles#2151
chandlerprall merged 6 commits intoelastic:masterfrom
chandlerprall:feature/docs-search-subroutes

Conversation

@chandlerprall
Copy link
Copy Markdown
Contributor

Summary

This has bugged me for a long time, also closes #2095. Enhances the docs' sidenav search to include subsections.

subsection searching

Checklist

- [ ] This was checked in mobile
- [ ] This was checked in IE11
- [ ] This was checked in dark mode
- [ ] Any props added have proper autodocs
- [ ] Documentation examples were added
- [ ] A changelog entry exists and is marked appropriately
- [ ] This was checked for breaking changes and labeled appropriately
- [ ] Jest tests were updated or added to match the most common scenarios
- [ ] This was checked against keyboard-only and screenreader scenarios
- [ ] This required updates to Framer X components

@chandlerprall chandlerprall added the documentation Issues or PRs that only affect documentation - will not need changelog entries label Jul 22, 2019
@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Jul 22, 2019

Yaaas!!!

Is it also possible to add to this PR an auto-scroll of the sidebar content? So when you navigate to a new section it tries to scroll sidebar to have that section at the top?

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

🙌
Manual testing locally works as expected. Just one case that I wanted to ask about:
Searching for a category like "Navigation" returns no results. Is it possible (or helpful) to filter at that level?

import { GuideThemeSelector } from '../guide_theme_selector';

const scrollTo = position => {
$('html, body').animate(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh my it's been a while since I've seen $

@ryankeairns
Copy link
Copy Markdown
Contributor

tenor-5263544

@chandlerprall
Copy link
Copy Markdown
Contributor Author

Is it also possible to add to this PR an auto-scroll of the sidebar content? So when you navigate to a new section it tries to scroll sidebar to have that section at the top?

done and pushed @cchaos !

@chandlerprall
Copy link
Copy Markdown
Contributor Author

Searching for a category like "Navigation" returns no results. Is it possible (or helpful) to filter at that level?

I don't think so? Open to other opinions though

@thompsongl
Copy link
Copy Markdown
Contributor

I don't think so?

It's not a big deal at all. This is already a huge improvement

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Changes LGTM. Works great as tested locallly

@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Jul 22, 2019

Saweet!

The only other thing is that because the sections are "open" they're indicated via the color blue which I find very distraction when you're just searching. Is it possible to only add isSelected=true when it's actually the current page?

The following enhancement is not necessary, but it could be nice to also use the EuiHighlight component to highlight the matched text.

@chandlerprall
Copy link
Copy Markdown
Contributor Author

@cchaos done and done!

@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Jul 22, 2019

Awesome!

Sorry, I just still see one oddity. When searching there seems to be a difference in the way level 2 section titles appear if when they have sub-sections versus those that don't.

I think they all need to stay that lighter shade of gray.

@chandlerprall
Copy link
Copy Markdown
Contributor Author

Updated again! Give scss change a look over, I feel like I abused it a bit.

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Just a thing about the class naming. But this is rad!

@chandlerprall chandlerprall requested a review from cchaos July 22, 2019 21:56
@chandlerprall chandlerprall merged commit 399f30e into elastic:master Jul 22, 2019
@chandlerprall chandlerprall deleted the feature/docs-search-subroutes branch July 22, 2019 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues or PRs that only affect documentation - will not need changelog entries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter Bar in docs is missing items

4 participants