News for hackers. Stuff that matters.
Re:Nice GUI by indispuesto on Monday November 21, 2022 @01:43PM (#33696223)
Amazing python to website framework. It is just what I was looking for!
Re:Nice GUI by reddit_clone on Monday November 21, 2022 @04:25PM (#33698147)
Nice!.

Is it intentionally slowed down? The reaction (for example when I click the checkbox) seem very slow in the demo page.

Re:Nice GUI by heisenzombie on Monday November 21, 2022 @05:34PM (#33699077)
Nope, it's doing a round-trip to the server on each interaction. You can inspect the websocket and see the messages. The notifications are generated by a Python function running on the server, there's no client-side logic.
Re:Nice GUI by batmansmom1 on Monday November 21, 2022 @06:09PM (#33699495)
Seems like it could be improved by having instant client side reactions, while letting the notifications come in with the response from the server so it seems more snappy to the user
Re:Nice GUI by indispuesto on Monday November 21, 2022 @07:42PM (#33700326)
Yes, you are right
Re:Nice GUI by DangitBobby on Monday November 21, 2022 @05:35PM (#33699089)
I was noticing this as well. I believe it's because each ui element must do a request to perform actions server-side (notice how the on_click handlers are python lambda functions).

This is probably the main drawback; you need your server to be located physically close to where the UI is open or there will be a very noticable delay. It's probably pretty snappy when the server and browser are on the same machine, though.

Re:Nice GUI by steve_adams_86 on Monday November 21, 2022 @11:12PM (#33701777)
Another choice would be optimistic UI updates (assume the checkbox will end up checked. If not, revert to unchecked and display feedback about an error).

I’ve tended to use this in UIs which rely on server state, and it usually makes things feel much snappier. In my experience it’s rare that an optimistic update isn’t fulfilled as expected, so the user experience is improved overall.

I’d hesitate to do it absolutely everywhere, though. In large forms it would be preferable to do batch updates rather than updating on every field interaction, for example.

Re:Nice GUI by solardev on Tuesday November 22, 2022 @11:57AM (#33707898)
That causes rubberbanding, doesn't it, where the checkbox looks checked at first and then unchecks itself a few seconds later when the server says "nope"?
Re:Nice GUI by steve_adams_86 on Tuesday November 22, 2022 @08:31PM (#33713954)
It can, yes, but the snap back should always be accompanied by feedback to allow the user to understand what happened.

There are pitfalls (what if the user thinks a setting saved and closes their browser, but it failed after they closed the tab?) which are addressable but it takes work and complexity. I think optimistic UI can be helpful. Generally speaking it’s a layer of complexity I’d tend to try to avoid, though.

Tools like Relay for graphql come with excellent implementations of this which I’d say are worth using if you’ve adopted the library, for example.

Re:Nice GUI by tomcam on Monday November 21, 2022 @07:47PM (#33700363)
I searched a couple minutes and couldn't see a list of supported platforms. Should I assume that since it's HTML based it would work on all of them, including iOS and Android?
Re:Nice GUI by clonhero on Monday November 21, 2022 @08:35PM (#33700696)
Pretty GUI, feels awful to use. Maybe client side reactions with corrections would be better?
Re:Nice GUI by solardev on Monday November 21, 2022 @09:24PM (#33700985)
It's so slow. Why does it take seconds to update a toggle? And it seems to keep overriding itself (not debounced? racing the input?)
Re:Nice GUI by pqyzwbq on Monday November 21, 2022 @11:58PM (#33702143)
To write web gui in Python, there are some other open source alternatives.

If just want to port simple shell interactive interface to web gui, can check https://github.com/pywebio/PyWebIO

If want to get a production level dashboard by using Python, https://wave.h2o.ai/ <<Realtime Web Apps and Dashboards for Python and R>>

Re:Nice GUI by aitchnyu on Tuesday November 22, 2022 @04:37AM (#33703857)
Is there a version of this that doesn't need server state? I've been thinking of making something like that.
Re:Nice GUI by rixed on Tuesday November 22, 2022 @02:44AM (#33703151)
What does this tell about this industry when after several decades of web programming a tool to display the most basics UI elements can still be featured on HN?
Re:Nice GUI by hulitu on Tuesday November 22, 2022 @04:39AM (#33703873)
SW enginering is about reinventing the wheel every couple of years.

This looks like a copy of Google's material design.

Re:Nice GUI by smcleod on Tuesday November 22, 2022 @05:38AM (#33704260)
Really ugly imo - it's that very early 2010s style - way-too-flat, not enough hinting and too many animations.
Re:Nice GUI by sgt on Tuesday November 22, 2022 @08:50AM (#33705727)
It's just Material design. The style looks a bit old, but it's literally just 2-3 years ago since this was the latest from Google.
Re:Nice GUI by smcleod on Tuesday November 22, 2022 @05:38PM (#33712560)
Oh yeah that makes sense Material design is both ugly and dorky to use.