Skip to content
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 preferred modal position to be device-specific #5

Open
joekrill opened this issue Feb 21, 2024 · 3 comments
Open

Allow preferred modal position to be device-specific #5

joekrill opened this issue Feb 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@joekrill
Copy link
Owner

On mobile it might make more sense to open it on the bottom or as a modal. On desktop that preference might be different.

@joekrill joekrill added the enhancement New feature or request label Feb 21, 2024
@civilblur
Copy link

civilblur commented Apr 9, 2024

For me at least, Treeview is crucial part of making the switch to Silverbullet, so I too am interested in having this behavior. As I've only deployed Silverbullet the other day, I'm still evaluating it before making the switch. For now, I've done a quick workaround using the new space-style to get this behavior (see video below).

If/once I'm committed, I'd be interested in perhaps tackling this. Just in case, do you have a syntax in mind for how the options should be arranged, considering the various dynamic/responsive behavior?

treeview-style.mp4

@joekrill
Copy link
Owner Author

I was thinking of adding a button to the treeview toolbar: either a single button that cycles through the various positions, or a button that shows a dropdown of options.

We could also add functions for each position to the treeview.plug.yaml file (i.e. showLeft, showRight, showBottom, showModal, or something like that). That would allow folks to assign a command to specific location if they want. It would also allow showing a button to open in one location on desktop, and a different location on mobile (using the mobile: true option).

There could also be an "auto" mode that takes into account screen width, I guess. I think that would be possible.

Either way, I think we'd need to remove the main setting entirely. I suppose it could be kept and used as the "default" option, but I think that would be too confusing.

But definitely open to alternative ways to handle it!

@civilblur
Copy link

That's an interesting approach. So one would define when each of the positions (showLeft, showRight, etc.) is valid, and whichever state is valid, the treeview shows up on that position? I think this approach would give a lot of flexibility.

If I understood this correctly, one limitation would be that you would only be able to define each position once? For example, if I've setup showLeft with mobile: true (to display on both desktop and mobile), I would not be able to set two separate size value for each of the device type?

The other ideas that crossed my mind so far are only some conventional approaches, like setting the default behavior in treeview.plug.yaml, but allowing mobile-specific overrides. Or simply having to define two objects: treeview_mobile and treeview_desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants