-
Notifications
You must be signed in to change notification settings - Fork 60
Allow toggling sidebar navigator on/off, for large breakpoints #99
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
Allow toggling sidebar navigator on/off, for large breakpoints #99
Conversation
fed271a
to
6e91dcd
Compare
@swift-ci test |
This is a great start. My biggest piece of feedback is we need to enable the sidebar side by side with the content in M viewports. I know this is a pain and you'll need to rework a lot of the logic, but when I designed that behavior, the sidebar button wasn't in scope. S viewports should remain as they are. If you click on the sidebar icon it will bring up the modal with the filter on top. My other feedback are small visual things:
|
…https://github.com/dobromir-hristov/swift-docc-render into dhristov/r89564104-allow-toggling-sidebar-on-dekstop
@biamx3 I updated the PR to your specs. Let me know how it looks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, congrats! 😄
It works pretty well, I left couple of comments tho:
- I noticed that the Sidenav toggle's focus outline is wider than the hover style.
- The navigator head item's focus outline has been modified as well. It seems that in main is not working totally right either, but here is worse. Let me know if you prefer that I create another radar for this one.
Will try to fix that one.
Thats because I probably added |
…-dekstop # Conflicts: # src/components/AdjustableSidebarWidth.vue # src/styles/core/_nav.scss
@marinaaisa those should be fixed now. |
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks Dobri!
@swift-ci test |
…-dekstop # Conflicts: # src/components/DocumentationTopic/DocumentationNav.vue # src/components/NavBase.vue # src/components/Navigator.vue # src/components/Navigator/NavigatorCard.vue # src/views/DocumentationTopic.vue # tests/unit/components/AdjustableSidebarWidth.spec.js # tests/unit/components/DocumentationTopic/DocumentationNav.spec.js # tests/unit/components/NavBase.spec.js # tests/unit/views/DocumentationTopic.spec.js
@swift-ci test |
@swift-ci test |
…av toggle icon. Fix issues with hovering icon on Safari
@swift-ci test |
…https://github.com/dobromir-hristov/swift-docc-render into dhristov/r89564104-allow-toggling-sidebar-on-dekstop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design approved.
…-dekstop # Conflicts: # src/components/Navigator.vue # src/components/Navigator/NavigatorCard.vue # src/views/DocumentationTopic.vue
@swift-ci test |
@marinaaisa can you give this one more look before I merge it? |
@@ -125,12 +125,12 @@ export default { | |||
}, | |||
mounted() { | |||
// on resize, re-calculate the width of the select. | |||
const cb = debounce(async () => { | |||
const cb = throttle(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain me this change? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Bea noticed the language toggle was not getting the new screen size, when we resize the page by dragging the adjustable sidebar. Debounce can skip the last function hit, while throttle will always fire the last function invocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
I just found couple of AX improvements:
-
Focus state of the button to close the navigation should be a rectangle around the button. Now it looks like this
-
Focus state gets lost when open and close navigator buttons are triggered. As a keyboard user I would expect to keep the focus state in the same element
focus-lost-when-button-pressed.mov
@marinaaisa first issue I can probably figure something out, though its another hack 😆 I hate overflow: hidden. For the second one, what do you suggest we do? Should the focus move from one toggle to the other? |
…leSidebarWidth, when in transition. Rename `.animating` to `.sidebar-transitioning`
Yes, I understand that there is two different toggles but the user only see one. We should keep the focus in the same one. |
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great AX improvements, @dobromir-hristov , thanks for your effort on it!
Bug/issue #, if applicable: 89564104
Summary
Allows toggling the navigator ON/OFF, for large resolutions. This is done through the Nav toggle icon or by dragging.
Users can drag the navigator all the way to the minimum allowed size. Once they pass 2x the minimum, the sidebar gets hidden.
The user can expand it back out, if they have not let go of the mouse button upon dragging OR by clicking on the nav toggle. (should work similar to Mail.app)
Hidden state is persisted in localStorage, so it wont re-open for users who have closed it once.
Dependencies
NA
Testing
Steps:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test
, and it succeeded