One idea I've been thinking a lot about is the GUI...
# thinking-together
s
One idea I've been thinking a lot about is the GUI layout engine being an interactive system in itself and self-organising. GUI elements should be self-assembling machines trying to find the right placement for themselves. Can't really be done in React, because React makes decisions about layout
c
I'd be interested in what you come up with. As someone who has dabbled in GUI layout code, it's never easy... just writing a rectangle manager with a set of constraints that work for all use cases can be surprisingly difficult to get right.
👍 1
s
I've got a system that takes statements like this:
Copy code
todoField above todosList
todosList above todoFilters
submitTodo rightOf todoField
And turns it into a bootstrap layout using React
This idea of a self-organising system that is running at all times is one I want to discuss more about
The GUI subsystem is an online system - not some thing you write templates for and things are hardcoded in place
s
this is maybe a stupid question … but do we need React at all here? What’s preventing us (in the broader sense) from collapsing layers of abstraction and just rendering GUI elements more natively
s
I don't know how a layout system can use react elegantly
I use react for additive guis as a way of getting the grid onto the screen ( I use the React. createElement API directly )
i
Something like masonry - a self arranging grid which you can resize
in XYZ
s
I love Jquery Masonry
I want some thing that give the layout flexibility of an IDE
j
I want my whole desktop environment to behave this way. I think part of what drives people to cmd line-only work flows is that they have a consistent interface to everything, and they can lay things out in arbitrarily complex ways. I want that for the GUI. I want to drag my queue out of spotify and pin it to my slack window, and I want it to work without spotify or slack adding support for it. I want it to just work because everything is a GUI component in a sane environment. I think some difficulties in getting here are that it implies a level of customization that is very difficult to design for, but also breaks the status quo of a company shipping an application and knowing how it will look (I’ve found designers very fond of knowing how things will look).
❤️ 6
s
If the GUI composition is just a set of rules of what appears to next eachother, then that feature (splitting out a playlist and attaching it next to slack) would be effortless
j
I think you’re right, so long as the desktop environment, slack, and spotify were all being composed by the same system. I think it changes what it means to package an application. Rather than shipping a pane of glass, you’d be shipping a collection of components, with a suggested layout, knowing that the user can change it.
i
I haven't seen it mentioned, but I figure it's worth asking: how does this approach compare with something like AutoLayout in Xcode, or the GSS prototype from the (failed?) auto-website-builder startup The Grid? They both use the cassowary constraint solver, and allow you to specify layouts in terms of approximate relationships between elements. I've heard complaints about AutoLayout being finicky to get right, that by the time you provide enough constraints to guide the layout to be mostly what you want, it's difficult to fix cases where it isn't. GSS was tremendously slow, so I think that stopped it from being viable. How would the self-assembling machines approach compared to the global constraint solver approach?
💡 1
s
I use a simple inequality solving algorithm to arrange items on the screen to an x,y coordinate
But not absolutely positioned
It's not cassowary
c
Interesting. I immediately thought of GSS as well, but it sounds like what you’re doing might be a lot simpler — sounds like you’re using some layout rules to generate CSS grid layout rules. Does that sound about right?
s
Correct. I generate HTML <div class="col"> elements to match the x,ys
c
That’s a neat idea. What frustrates me still is that there is no direct manipulation interface. I hate Apple’s Interface Builder, but I think there’s a happy middle ground where you have a UI for manipulating layout and getting immediate feedback, meanwhile that generates readable code/layout rules so you aren’t blind/locked in to the tool
s
For additive-guis, the project I'm working on, the interface for customizing the GUI is to change the layout rules
c
Pretty sweet!
s
But i'd like to see context menus have things in them
Like right click > Insert left of, rightof, above
a
I haven't followed up on this line of research in a while, so I recommend seeing what's come since, but check out Supple: http://iis.seas.harvard.edu/projects/supple/
s
Thanks for that Tom, interesting