accel poke routing

This commit is contained in:
Will Hanlen 2024-06-13 17:39:32 +02:00
parent a3785c8311
commit 72e08780c3
12 changed files with 178 additions and 42 deletions

View File

@ -7,21 +7,19 @@
|^
;div.accel-cell.wf.hf.fc
;+ controls
;div.tabs.fc.grow
;div.tabs.fc.grow.scroll-y
;div.tab.in.p2.fc.grow
=morph-retain "class"
;+ in
==
;div.tab.poke.p2.hidden.hf
=morph-retain "class"
=ok-ok "poke"
;+ poke
==
;div.tab.ref.p2.hidden.hf
=morph-retain "class"
=ok-ok "ref"
;+ ref
==
;div.tab.poke.p2.hidden.hf
=morph-retain "class"
;+ poke
==
==
;+ script
==
@ -31,22 +29,22 @@
|= =iota
?@(iota (trip iota) (scow iota))
++ controls
;div.p-1.fr.g2.ac.js
;div.p-1.fr.g2.ac.je
;button.p-1.br1.bd1.b1.hover.toggled
=onclick "accelSwitchTab(this, 'in');"
=morph-retain "class"
; in
==
;button.p-1.br1.bd1.b1.hover
=onclick "accelSwitchTab(this, 'poke');"
=morph-retain "class"
; poke
==
;button.p-1.br1.bd1.b1.hover
=onclick "accelSwitchTab(this, 'ref');"
=morph-retain "class"
; ref
==
;button.p-1.br1.bd1.b1.hover
=onclick "accelSwitchTab(this, 'poke');"
=morph-retain "class"
; poke
==
==
++ in
;form.fc.grow
@ -67,7 +65,8 @@
==
++ poke
;div
; XX poke
;+ add-poke
;+ pokes
==
++ ref
;div
@ -80,12 +79,13 @@
^- manx
?: =(~ crew.conf)
;div.fr.p2.f3: no deps
;div.fc.g2.p2
;div.fc.g2.p2.scroll-y
;*
%+ turn ~(tap by crew.conf)
|= [=term =pith:neo]
=/ tap (trip term)
;div.fr.g3.ac
=id "conf-dep-{tap}"
;button.bd1.br1.p-1.b1.hover.loader
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=del-dep"
=hx-swap "outerHTML"
@ -103,28 +103,32 @@
==
==
++ add-dep
;form.fr.js.hf.g2
;form.frw.js.g2
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-dep"
=hx-swap "outerHTML"
=hx-target "find .loading"
=morph-no-swap ""
=hx-on-htmx-after-request "$(this).find('input').attr('value', '');this.reset();"
=row (scow %ud +:x)
=col (scow %ud +:y)
;input.p-1.br1.bd1
;input.p-1.br1.bd1.fr.wfc
=style "min-width: 0; flex: 1;"
=type "text"
=placeholder "name"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=morph-no-swap ""
=name "name"
=required ""
;
==
;input.p-1.br1.bd1.grow
;input.p-1.br1.bd1.fr.grow.wfc
=style "min-width: 0; flex: 1;"
=type "text"
=placeholder "/{(scow %p our.bowl)}/demo/cell/5"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=required ""
=morph-no-swap ""
=name "pith"
;
==
@ -136,6 +140,82 @@
==
==
==
++ pokes
^- manx
?: =(0 ~(wyt by poke.conf))
;div.fr.p2.f3: no pokes
;div.fc.g2.p2.scroll-y
;*
%+ turn ~(tap by poke.conf)
|= [=pith:neo =stud:neo]
=/ pit (en-tape:pith:neo pith)
=/ tap (en-tape:pith:neo (snip (snip (snip here.bowl))))
;div.frw.g2.ac
;button.bd1.br1.p-1.b1.hover.loader
=hx-post "/neo/hawk{tap}?stud=send-poke"
=hx-swap "none"
=pith pit
=x (scow %ud +:x)
=y (scow %ud +:y)
;span.loaded: send
;span.loading
;+ loading.feather-icons
==
==
;button.bd1.br1.p-1.b1.hover.loader
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=del-poke"
=hx-swap "outerHTML"
=hx-target "find .loading"
=pith pit
;span.loaded: delete
;span.loading
;+ loading.feather-icons
==
==
;div.f3
; {<stud>}
==
;div.mono: {pit}
==
==
++ add-poke
;form.fr.js.hf.g2
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-poke"
=hx-swap "outerHTML"
=hx-target "find .loading"
=hx-on-htmx-after-request "$(this).find('input').attr('value', '');this.reset();"
=row (scow %ud +:x)
=col (scow %ud +:y)
;input.p-1.br1.bd1
=style "min-width: 0; flex: 1;"
=type "text"
=placeholder "%stud"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=morph-no-swap ""
=name "stud"
=required ""
;
==
;input.p-1.br1.bd1.grow
=style "min-width: 0; flex: 1;"
=type "text"
=placeholder "/{(scow %p our.bowl)}/poke/target"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=required ""
=morph-no-swap ""
=name "pith"
;
==
;button.br1.bd1.b1.hover.p-1.loader
=type "submit"
;span.loaded: add poke
;span.loading
;+ loading.feather-icons
==
==
==
++ script
;script
;+ ;/ %- trip

View File

@ -16,7 +16,7 @@
overflow: hidden;
grid-template-areas:
"table"
"dashboard";
"dashboards";
"""
;+ table
;+ dashboards
@ -55,7 +55,7 @@
++ table
;div.scroll-x.scroll-y
=style "grid-area: table"
;+ resizer
::;+ resizer
;+ grid
==
++ rows 10
@ -126,8 +126,8 @@
?: =(0 n) ;div;
;div.fc.jc.ac.b0.p2.f3.s-2: {<n>}
++ dashboards
;div.b0.fc.relative
=style "border-top: 1px solid var(--f2); max-height: 200px;"
;div.b0.fc.relative.scroll-x.scroll-y
=style "grid-area: dashboards; border-top: 1px solid var(--f2); max-height: 200px;"
;+ refresher
;*
%+ turn (gulf 0 (dec (mul rows cols)))
@ -145,12 +145,12 @@
==
++ dashboard
|= [x=@ y=@]
;div.grow.fr.af.js.hidden
=style "max-height: 200px; max-width: 100%;"
;div.grow.frw.af.js.hidden
=style ""
=cell "{<x>}-{<y>}"
=morph-retain "class"
;+ (out x y)
;+ (in x y)
;+ (out x y)
==
++ in
|= [x=@ y=@]
@ -159,8 +159,8 @@
=. kids.kid [~ ~]
=. here.kid :(welp here.bowl pax /in)
=. deps.kid ~
;div.basis-half.shrink-0.bd1
=style "min-width: 350px;"
;div.basis-half.shrink-0.grow.bd1
=style "min-width: 350px; min-height: 150px;"
;+
?~ res=(~(get of:neo kids.bowl) (snoc pax %in))
;div: none - in {<[x y]>}
@ -173,8 +173,8 @@
=. kids.kid [~ ~]
=. here.kid (welp here.bowl pax)
=. deps.kid ~
;div.basis-half.shrink-0.bd1.fc.g2
=style "min-width: 350px; max-width:50%;"
;div.basis-half.shrink-0.bd1.fc.g2.grow
=style "min-width: 350px; min-height: 150px;"
;div.b0.fr.g2.ac.je.p-1.bd1
;div.s-1: {(en-tape:pith:neo (snip pax))}
;button.p-1.b1.hover.br1.bd1.s-2

View File

@ -1,12 +1,13 @@
/@ add-dep
/- feather-icons
:- [%add-dep %$ %htmx]
|= dep=add-dep
|= =bowl:neo
;div
;div.loading
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;
;+ loading.feather-icons
==

View File

@ -0,0 +1,13 @@
/@ add-poke
/- feather-icons
:- [%add-poke %$ %htmx]
|= add=add-poke
|= =bowl:neo
;div.loading
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;+ loading.feather-icons
==

View File

@ -1,12 +1,13 @@
/@ del-dep
/- feather-icons
:- [%del-dep %$ %htmx]
|= dep=del-dep
|= =bowl:neo
;div
;div.loading
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;
;+ loading.feather-icons
==

View File

@ -0,0 +1,13 @@
/@ del-poke
/- feather-icons
:- [%del-poke %$ %htmx]
|= del=del-poke
|= =bowl:neo
;div.loading
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;+ loading.feather-icons
==

View File

@ -3,10 +3,7 @@
/- manx-utils
:- [%node %$ %add-poke]
|= nod=node
~& nod/nod
^- add-poke
=/ mu ~(. manx-utils nod)
:- (pave:neo (rash (vol:mu "pith") stap))
`@tas`(rash (vol:mu "stud") ;~(pfix cen sym)) :: XX fix

View File

@ -5,5 +5,4 @@
|= nod=node
^- del-poke
=/ mu ~(. manx-utils nod)
(pave:neo (rash (vol:mu "pith") stap))
(pave:neo (rash (got:mu %pith) stap))

View File

@ -4,4 +4,10 @@
:- [%node %$ %hoon]
|= nod=node
^- hoon
(~(vol manx-utils nod) "text")
=/ text (need (~(val manx-utils nod) "text"))
?: ?&
(gth (lent text) 0)
=((rear text) '\0a')
==
(crip (snip (text)))
(crip text)

View File

@ -0,0 +1,10 @@
/@ node
/@ send-poke
/- manx-utils
:- [%node %$ %send-poke]
|= nod=node
^- send-poke
=/ mu ~(. manx-utils nod)
:+ (slav %ud (got:mu %x))
(slav %ud (got:mu %y))
(pave:neo (rash (got:mu %pith) stap))

View File

@ -1,6 +1,7 @@
/@ accel
/@ accel-diff
/@ accel-conf
/@ send-poke
::
=>
|%
@ -22,7 +23,7 @@
|= [=bowl:neo row=@ud col=@ud conf=accel-conf =kind]
^- (list card:neo)
=/ =pith:neo (welp here.bowl #/[ud/col]/[ud/row])
=/ =stud:neo
=/ =stud:neo
`@tas`(cat 3 'accel-' (scot %t (spat (pout pith))))
=; caz=(list card:neo)
?- kind
@ -39,7 +40,7 @@
^- kook:neo
|%
++ state pro/%accel
++ poke (sy %accel-diff %gift ~)
++ poke (sy %accel-diff %gift %send-poke ~)
++ kids
:- ~
:- %y
@ -71,6 +72,7 @@
?+ stud !!
%accel-diff (on-diff !<(accel-diff vax))
%gift (on-gift !<(gift:neo vax))
%send-poke (on-route-poke !<(send-poke vax))
==
[cards accel/!>(state)]
++ on-diff
@ -108,6 +110,19 @@
?. ready.conf
~
(make-cell bowl row.road col.road conf %out)
++ on-route-poke
|= s=send-poke
^- (quip card:neo _state)
=/ in (~(got of:neo kids.bowl) #/[ud/x.s]/[ud/y.s]/in)
=+ !<(conf=accel-conf q.pail.in)
=/ out (~(got of:neo kids.bowl) #/[ud/x.s]/[ud/y.s]/out)
?> =(%vase p.pail.out)
::
=/ pit pith.s
=/ sud (~(got by poke.conf) pit)
=/ =card:neo [pit %poke sud q.pail.out]
~& card
[~[card] state]
--
--
--

View File

@ -0,0 +1 @@
,[x=@ud y=@ud =pith:neo]