-
Notifications
You must be signed in to change notification settings - Fork 326
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
Snippet bar items overlap when width reduced #2076
Comments
I created another branch to try a new configuration of the snippet bar. IMHO, it looks nice, and while I think it will feel odd to long time users at first, will make sense over time. And if Swappable Themes is pushed through I think it will work better with custom snippet groups; the persistent editor icons are always in the same place and snippet menus can be added into infinitum. But I may be grasping at straws to justify the time I spent on this. Link to my branch on my fork: https://github.com/Gazook89/homebrewery/tree/Reorder-SnippetBar And obviously we could go further with the scrunching of the menus...right now I limited it to two rows, but each snippet menu could break to a new line, too, but not sure the utility in such a narrow editor. And I suppose with some JS (or CSS if container queries ever happen) the entire snippet bar could be turned vertical and display only the menu icons. |
I am ok with the 2-layered thing, but I still like having a gap between the snippets and the tabs when it's in the single row. Is there any magical way you can preserve the that? |
I couldn't think of any pure CSS way of keeping that gap when it's a single row, but not having it look funny when it goes to second row. Flexbox doesn't know when it is wrapping, so I can't say "if you are flexing to another row, suddenly start doing this". I tried to think of ways using empty divs and such but as far as I can remember there were trade-offs or just didn't work. I'll ruminate on it as I make/eat dinner. |
A bit late to chime in, but another approach is to have the snippet bar items collapse to just their icons once space is cramped (with the flyout lables we use for the edit/mode buttons). |
I had thought about that too but only if it was narrowed even further after reducing to two rows. But abandoned that idea after thinking it'd be silly to shrink the editor that small and still think you were going to be doing editing. But dropping the two row idea and instead switching to just icons at a certain point would also work. My one concern though is the menus and icons don't have enough recognition among users, not enough that they are understood without their accompanying text. And this would be a much bigger problem once we start having alternate snippets as allowed by the SwappableThemes branch. |
Also, I don't think this is possible with just CSS, until Container Queries become a thing. It could be done with JS, but with my concern in my previous comment and my sketchy JS skillz, I don't think I could submit for a PR for it. And I don't want to add another thing to other people's plates until the bigger stuff is done if it can be avoided. IMO, this can get pushed through to fix an obvious graphical problem, and incremental changes can be made later as schedules allow since it's UI related, and doesn't need to be backwards compatible or 'perfect' on the first try. |
Can you use something like |
The first option I put forth in this thread (part of the original post) uses space-between, but I see I didn't include an image of what it looked like on a single line. To recap, here is that first option (my branch flexbox-snippets-bar): I just don't like it because of the weird right-alignment when it goes to the second row. And with just CSS I don't think there is a way to switch it to some other alignment only once it goes to a second row. Edit: |
@Gazook89 commented 5 hours ago
We currently have a bit of JS that runs when the snippet bar changes size. More specifically, a bit of JS that runs when the divider bar is dragged, and correspondingly sets the size of the editor pane (and thus the snippet bar). homebrewery/shared/naturalcrit/splitPane/splitPane.jsx Lines 42 to 50 in 1c2992c
Setting/removing a flag class on the snippet bar should be pretty easy there .. something like this maybe (I don't know the precise React way)
With corresponding CSS to hide the .groupName in .snippetBar ..
|
I offer a fix for this with #3635, a container query to change the flow. |
Another cosmetic thing I've noticed is that the Editor buttons in the snippet bar overlap the snippet menus when the width is reduced beyond a certain point. The main issue is that it just looks a little sloppy, and could be more responsive.
Here is a link to a branch on my fork with some adjustments, including:
.snippets
around the Snippet menus, similar to how the 'undo/redo' various editors are contained by.editors
This could be made simpler, and likely better, if the Editors portion didn't need to be right-aligned in the bar. And to that point, it might make more sense to move the Editors/Undo-Redo portion to the left side of the snippet bar, since they don't change based on context, and then followed by the snippet menus.
The text was updated successfully, but these errors were encountered: