Skip to content

Commit

Permalink
Merge pull request #1906 from holium/native-apps-fix
Browse files Browse the repository at this point in the history
trove / lexicon deployment fixes w/ new poke
  • Loading branch information
drunkplato authored Jul 14, 2023
2 parents a861e2f + 604d761 commit bccdaa4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
40 changes: 36 additions & 4 deletions desks/realm/app/bazaar.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,26 @@
^- (quip card:agent:gall agent:gall)
=/ old=(unit state-0)
(mole |.(!<(state-0 vase)))
?^ old
`this(state u.old)
?^ old :: `this(state u.old)
=| lexicon-app=native-app:store
=. title.lexicon-app 'Lexicon'
=. color.lexicon-app '#EEDFC9'
=. icon.lexicon-app 'AppIconLexicon'
=. config.lexicon-app [size=[3 7] titlebar-border=%.n show-titlebar=%.y]
=| trove-app=native-app:store
=. title.trove-app 'Trove'
=. color.trove-app '#DCDCDC'
=. icon.trove-app 'AppIconTrove'
=. config.trove-app [size=[7 8] titlebar-border=%.n show-titlebar=%.y]
=. catalog.u.old (~(del by catalog.u.old) %lexicon)
=. catalog.u.old (~(del by catalog.u.old) %trove)
:_ this(state u.old)
:: add two new app entries for Realm's new "native" apps: %trove and %lexicon
:~ ::[%pass / %agent [our.bowl %bazaar] %poke bazaar-action+!>([%delete-catalog-entry [%lexicon]]])]
[%pass / %agent [our.bowl %bazaar] %poke bazaar-action+!>([%add-catalog-entry [%os-lexicon lexicon-app]])]
::[%pass / %agent [our.bowl %bazaar] %poke bazaar-action+!>([%delete-catalog-entry [%trove]]])]
[%pass / %agent [our.bowl %bazaar] %poke bazaar-action+!>([%add-catalog-entry [%os-trove trove-app]])]
==
%- (slog leaf+"nuking old %bazaar state" ~) :: temporarily doing this for making development easier
=^ cards this on-init
:_ this
Expand Down Expand Up @@ -428,6 +446,7 @@
%set-host (set-host +.action)
:: testing helper. remove an app from the ship catalog w/o producing any effects
%delete-catalog-entry (delete-catalog-entry +.action)
%add-catalog-entry (add-catalog-entry +.action)
== :: +pre: prefix for scries to hood
::
++ pre /(scot %p our.bowl)/hood/(scot %da now.bowl)
Expand Down Expand Up @@ -732,8 +751,21 @@
++ delete-catalog-entry
|= [=app-id:store]
^- (quip card _state)
=. catalog.state (~(del by catalog.state) app-id)
[~ state]
?: (~(has by catalog.state) app-id)
=. catalog.state (~(del by catalog.state) app-id)
`state
`state
::
::
:: $add-catalog-entry
:: add a new native-app to the catalog. does not currently support %urbit or %web apps.
++ add-catalog-entry
|= [=app-id:store =native-app:store]
^- (quip card _state)
:: %- (slog leaf+"{<dap.bowl>}: [add-catalog-entry] {<app-id>}" ~)
=. catalog.state (~(put by catalog.state) app-id [%native native-app])
=. grid-index.state (set-grid-index:helpers:bazaar:core app-id grid-index.state)
`state
--
++ reaction
|= [rct=reaction:store]
Expand Down
28 changes: 28 additions & 0 deletions desks/realm/lib/bazaar.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
[%clear-stall clear-stall]
[%set-host set-host]
[%delete-catalog-entry del-cat-entry]
[%add-catalog-entry add-cat-entry]
==
::
++ install-app
Expand Down Expand Up @@ -120,6 +121,33 @@
%- ot
:~ [%app-id so]
==
::
++ add-cat-entry
%- ot
:~ [%app-id so]
[%native-app native-app]
==
:: %- of
:: :~ [%native native-app]
:: [%web ~] :: currently not supported
:: [%urbit ~] :: currently not supported
:: ==
::
++ native-app
%- ot
:~ [%title so]
[%info so]
[%color so]
[%icon so]
[%config cfg]
==
::
++ cfg
%- ot
:~ [%size (at ~[ni ni])]
[%titlebar-border bo]
[%show-titlebar bo]
==
--
--
::
Expand Down
1 change: 1 addition & 0 deletions desks/realm/sur/bazaar/store.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
[%clear-stall path=space-path:spaces args=(map cord cord)]
[%set-host app-id=desk host=ship]
[%delete-catalog-entry =app-id]
[%add-catalog-entry =app-id =native-app]
==
::
+$ interaction
Expand Down

0 comments on commit bccdaa4

Please sign in to comment.