-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Reader sidebar: toggle visibility of lists and tags #724
Conversation
As a starting point, I think I'd create a common component called something like |
b4a75c0
to
e617ccb
Compare
Hey @shaunandrews - in e617ccb I added a new That means we don't need to keep track of the open state in the sidebar itself, which should clean things up a bit. We can also use the same component to render the lists and tags menus, which should reduce duplication of logic. The new component doesn't include the 'add new list/tag' input yet, so that'd be the next step :) (Sidenote: I had to rebase the branch and force push to get the dependencies working, so it's worth doing a |
Awesome, @bluefuton. I've brought over the add button and input and things seem to mostly work for Lists, but adding a Tag is broken. Removing a tag is broken — not sure how to fix that. We also need to find a way to remember the state of the toggles for users. |
d2d8680
to
0452fb2
Compare
Ah - I think the tags were failing because of
That input is now in the MenuSidebar component, so it's not in ReaderSidebar's refs any more. This wasn't tripping up lists because we were doing a redirect to Atlas before the line above got executed :) I've added it to the SidebarMenu component now and it seems to be working well. |
Yep. If we want to remember it, we should store it in the state of the parent component, |
9368db8
to
c755c81
Compare
@bluefuton I rebased this and somewhere along the way I broke the add stuff again. Mind taking another look? |
@shaunandrews Absolutely, I'll take a look. There have been a few sidebar changes happening as part of List Management, so one of those is probably the culprit... |
There are few issues what i found inside 'menu.jsx':
|
c755c81
to
19629f7
Compare
Thanks for the feedback @ralder! I've addressed your points in 19629f7. And as a result the add input is now working again, @shaunandrews :) |
Todo:
|
19629f7
to
de2b33b
Compare
Big changes to the sidebar in #2272 made for a very tricky rebase 😑 All sorted now though. |
Well, this turned into quite the 👹 ...but includes a long overdue refactoring of the sidebar, and the first sprinkling of Redux in the Reader. |
9a1f5ff
to
6ae39ed
Compare
|
||
const SidebarMenu = ( { children } ) => ( | ||
<li className="sidebar__menu">{ children }</li> | ||
const SidebarMenu = ( { children, className } ) => ( |
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.
hmmmm... do we really need this?
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.
The component in general?
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.
The class names on the component. What are we using it for? Do we need the class name?
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.
It's the parent element inside ExpandableSidebarMenu
, which passes in classes based on the toggle state:
const classes = classNames( this.props.className, { 'is-toggle-open': !! this.props.expanded, 'is-togglable': true } );
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 we set these based on props for clarity instead of passing classnames?
I think this is good to go. Whatcha think @bluefuton ? Anything left to do? |
Are there new stats we need to track? |
I think it'd good to get it out there, then address the "scroll the picked thing into view" and open/closed state persistence as enhancements later on.
Yep, we could potentially add one for the open and close? Let me add that & then hopefully it's 🚢 time :) |
|
bb94412
to
b0f18c0
Compare
- Adding some animations and the add button for lists and tags. - Adding transitions for the add new list/tag in the Readers sidebar and a dismiss button for the add new input. - Giving the focus to the add inputs when you click the add buttons for Tags and Lists. - Adding counts and an empty state.
toggle component.
- Clear sidebar input in SidebarMenu, not Sidebar (elements have moved) - Fix add input - Cleanup old following edit link method, and rename expandable sidebar component to avoid conflict with new SidebarMenu in layout - Rename main sidebar and ditch package.json - Use SidebarHeading component - Use sidebar__menu naming rather than sidebar-menu, to match new Sidebar components - Refactored tags section into separate components - Break out lists and teams to separate components - Moved link methods out to helper, and fixed list highlighting - Preserve expandable menu open/closed state using Redux - Style cleanup - Break out expandable menu heading to new component - When visiting a tag or list page, open the appropriate expandable menu and scroll so that the selected item is in view - Rename folders for Reader sidebar components - Only focus form input when it's first opened - fixes issue with iOS keyboard not collapsing - Reader sidebar: prevent horizontal scroll - Stats: add stat when add button is clicked for list or tag in Reader sidebar - Stats: add stat for open/close of lists and tags expandable menus
103c5c8
to
d709ee9
Compare
Sorted in 384eaf0 👍 |
Just found an IE11 CSS bug when expanding the add input: |
…t it. IE users will not see the placeholder.
Reader sidebar: toggle visibility of lists and tags
Rather than showing all of the user's lists and tags in the sidebar, this PR experiments with hiding them behind a toggle.
Default state:
Expanded:
cc @shaunandrews