Open upsiflu opened 1 year ago
In the long term, Url stores all Ui/Ux state while an offline-first and/or remote store is the definite source for the model. -> No more volatile state (The app is practically a stateless definition of the model and the possible interaction patterns)
The trajectory goes towards reducing the number of Msg that the user application needs to handle -- down to only those that actually modify the domain model.
One by one, concerns are offloaded to the less-ui library:
Cohesive views
Typical State-in-Url patterns
[x] Ui fragment Progressive Disclosure --
Toggle
[x] Ui fragment Ad-hoc page paths --
GoTo
andBounce
[x] Contingent Ui fragments --
Filter
,Search
Ui state that doesn't map perfectly to the Url but shouldn't be handled by the app
[ ] Focus and Viewport position
Url
, akin to?xy=0,20879
?atLocation : (Location -> Ui ) -> Ui
interface and create something likebyViewportOverlap : (Float -> Ui) -> Ui
where the float represents the overlap (if the element is just out of the screen, the float is 0; the further it moves away, it becomes less than zero. The magnitute 1 matches the size of the element; the closer the element is to the screen center, the larger the float grows above 1. For example, on a screen with dimensions 3x3, an element of 1x1 tucked to the left border yields1
, centered2
, outside of the screen with a distance of 1,-1
, half-visible0.5
).28
8
[ ] Pointer and keyboard interactivity
Auto-deriving a View from a Model
[x] Model Subtype preconfigurations
List
ofActions
where each Action compounds a state and certain states prohibit certain actionselm-store
iirc?) for these Actions, which you read on eachview
Restrictive.Model
then derives:Maybe String
. You set it toJust "xy"
, then toNothing
. What you want is a button/switch to bring you back toJust "xy"
(instead ofJust ""
which would be really lame). This functionality can either be provided by storing a tree of already-populated constructors for the author's Model, or to derive this tree from the previous Actions.elm-any-type-forms
solves this:22
28