-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Nyxt-native dialogs! #1465
Nyxt-native dialogs! #1465
Conversation
Keep in mind that it only works on the latest version of cl-webkit. |
f41ed94
to
b895317
Compare
Mergeable. Thing to do:
|
I've added file-chooser handing with Nyxt-native interface. It handles multiple file input elegantly, fetches an already existing value and works nice in general. I believe something can be done to color-chooser too, but for that we need to somehow add color parsing (is there any CSS-compatible library for that?). In general, lots of WebKit UI can be replaced with prompt-buffer (including permission requests and notifications). Maybe introduce a |
I think a browser based switch is a good idea! I can't think of a color picker outside of the one when you invoke open-inspector. There are many JS based ones of course... Maybe we could provide a prompt buffer that includes a few sources for different 'standard' colors? |
Nothing is to stop us for providing an emacs-like color picker experience :-D |
What we can do is compile user input to CSS, insert it to a page and fetch its color with JavaScript. Terribly hacky, but really convenient. We can even use prompt-buffer's input line as this styled element!
Yes, that could be an option too. |
I don't think most people are comfortable translating from hex to a color. I can imagine what a color would be, but I can't be certain, and I've been doing it a long time. I guess it could be the first 'raw' user input source in the prompt buffer. |
I mean, CSS supports lots of color names. You don't need to necessarily use |
That works too :-) |
e59243f
to
76e91e5
Compare
Hello Artyom, I am taking a look at this now :-) |
Be aware that there's no toggle to turn these Nyxt dialogs on/off yet! |
Hm, then I will not merge for now. |
And I also have a color-chooser somewhere in stashes :) |
Sorry for the delay, I'll have a look as soon as possible.
|
76e91e5
to
99ef351
Compare
OK, here's the Color-chooser proved to be quite complex, because getting the color of DOM element is a non-obvious task, while I need it to leverage all the power of CSS. Let's leave it for later and open an issue on it. |
It doesn't seem to break on CI :D |
Just tested: it seems to hang the current page when the user exits with `escape`
instead of confirming the dialog.
Other than that, congrats on this, it's a fantastic change :)
I'll update the cl-webkit Guix package just now.
|
All adressed! (I resorted to a suspicious |
The last suspicious thing (the |
Thanks Artyom! |
This adds handing of
script-dialog
WebKit signal and opens our pretty prompt-buffer instead of WebKit menus, and echoes JS alerts to the message-buffer instead of creating small alerts getting in the way.