-
Notifications
You must be signed in to change notification settings - Fork 271
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
Make the help dialog draggable and resizable using jQuery UI #70
base: main
Are you sure you want to change the base?
Conversation
We want the modal dialog to be draggable and resizable, but this breaks the menu bar unless we separate them.
These are not installed using `npm`, because it's documented as not working with Browserify: > If you're using browserify: The UMD headers we have aren't supported > by browserify natively, and the deamdify plugin has a blocking bug. If > you depend on that combination, please help fix that bug! From https://jqueryui.com/upgrade-guide/1.12/ Instead, we embed a custom version of jQuery UI 1.12.1 containing only the 'draggable', 'resizable', and 'dialog' widgets, and we link to a publically hosted version of jQuery.
This makes the window more useful for viewing inline documentation, as planned in https://github.com/ojack/hydra/issues/58.
Pleeeease! Don't add JQuery to this piece of software! :) |
Can you recommend a different way to make the dialogs draggable and resizable? |
First of all I'd suggest to focus on how much the synth gain in value from a single modal that can be dragged and moved around. Then I'd evaluate how much value adds to have JQuery as dependecy just for drag a thing around. I think that this software should focus more on: code editor, rendering, new features; something more focused on its main scope like:
To talk about how to move modal around without adding new deps here are a couple of links: There is for example a simple pen that showcase this functionality without using JQuery: Or an article that suggests how to do it: |
@ojack suggested this approach for inline documentation. See https://github.com/ojack/hydra/pull/62 for the original discussion.
The upside of using a 3rd party dependency is that implementing this feature is easy, and it adds very little code that the project would need to test and maintain. One downside I can see is that it adds 84KB of code to the frontend. The frontend |
Hi @ssssam sorry for the delay! I view the documentation as an integral part of the software, and working on the way the documentation is integrated with the editor is important to me. I think it is also a a place to be creative in terms of thinking of how people learn and experiment / creative forms of documenting with live and editable examples, etc. I agree with @esnho am pretty against adding jquery for something this small. Almost all of hydra is written from scratch, except for very specific things such as the codemirror editor and regl... Jquery is a whole framework that adds a lot of overhead and specific ways of working with code. I think we should start by just making it draggable using css (personally i am not that concerned about resizable). Dockable to me is just that when it is dragged to a certain part of the screen, it snaps to fit that size.. gonna look for some examples. It might be interesting to also have the option to pop it out into its own window. That said you make a good point about size-- i have no idea why the hydra bundle is 4.8 GB!! The app folder is only 55kb...gonna start by looking into that. Again I am sorry for the delay in responding. I think it has been hard because I have a lot of specific ideas for many aspects of hydra, but not a lot of time to implement them. I want to have a sort of developer meeting (virtually) soon to outline more longer term ideas for hydra and start working towards them, and hope you can both be involved. |
Hi :) I feel like resizing the docs/help window will be pretty important, sometimes you want to focus more on the visuals, sometimes more on the docs... anyway it's all possible without jQuery, i don't have time to rewrite this PR right now, but maybe @esnho can do it :) :) |
This is hopefully a step towards having inline docs in the hydra editor.
It adds a new dependency on jQuery UI, and it uses the
.draggable()
and.resizable()
helpers from that library to make the modal dialog draggable and resizable. It doesn't make the dialog dockable as I didn't find any library that supports that.After this PR, it should be simple to insert text from
docs/funcs.md
into the dialog, and get basic inline documentation in a draggable window.