One thing I noticed is that some of the styling changes cause the layout to ‘jump’ when I click the button. I guess some elements are being display: none;'d? Or some font sizes are changing?
Would it be feasible to make the button purely ‘grey out’ (or visibility: hidden;) unnecessary elements, without causing any layout shift?
How about visibility: hidden;? Or opacity: 0;? So it’s still there & included in the layout, but invisible? I guess we’d need something to prevent clicks/focus on it as well? Or maybe we make it visible again on hover/focus?
One relatively safe way would be to mimic the user interaction:
if(document.body.classList.contains("has-sidebar-page")){ // Sidebar is visible
document.querySelector(".btn-sidebar-toggle").click()
}
Ok yes, sorry for the confusion. I am understanding you now. Since the reader mode isnt known to be a toggle for sidebar, it could be confusing that it’s toggled, causing the shift when you didnt want that to happen.
I guess I assumed if the sidebar toggle causes a shift, then the reader mode doing the same thing wouldnt matter.
I can try not toggling the sidebar and posting a video here to show you.
Not sure how difficult it would be, but I was thinking it would be nice if the user could hit ESC to exit reader mode. Since the button is considered part of the timeline, if you scroll to the very bottom of the topic, the button can go off screen.
As David said, I’m wondering if it’s possible not to shift the content.
Also, is there a particular reason for reducing the original width? I might not be aware of some limitations, though.
Functionality, all this appears to do is hide the timeline and notification bar, since the sidebar is already collapsible. I don’t really see the experience being changed or improved sufficiently to have another button in every topic.
It would make more sense if it changed the reading experience in some meaningful way like making it full width in Reader Mode. As it is now, I would probably never use this feature so ironically all it’s doing for me is adding more visual noise to the timeline.
Yeah, maybe I can make it a bit transparent as well. I tried hiding it with a smooth transition, but because of the way we render items in our list, sometimes this isnt visible, and trying to hide it becomes a pain.
It’s the same with all of the small post notices & time gaps. The only way I could think is to use an element observer API, but even then, the movement is slightly unpredictable and I was noticing jitteriness randomly happening.
Nice improvement, Jordan! It’s a much better experience not to see any movement shift now and some animation to smooth the transition.
I agree with Sam’s suggestions; if we hide non-essential information, having the color back would make a good compromise. That could be an option, though.
Once you’re in reader mode, you have to click to get to another page, and then, if you want reader mode, you have to click again to turn it back on. Maybe make the other nav links a tiny bit less hidden and let them work and leave it on when we get to the next topic.
Another idea, turn it off automatically when you get to the end of the topic.
Or, automatically navigate to the next topic in the last topic-list you visited!