diff --git a/desks/realm/app/bazaar.hoon b/desks/realm/app/bazaar.hoon index cef4560fc0..aeb5653af8 100644 --- a/desks/realm/app/bazaar.hoon +++ b/desks/realm/app/bazaar.hoon @@ -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 @@ -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) @@ -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+"{}: [add-catalog-entry] {}" ~) + =. 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] diff --git a/desks/realm/lib/bazaar.hoon b/desks/realm/lib/bazaar.hoon index a998179e63..399a685025 100644 --- a/desks/realm/lib/bazaar.hoon +++ b/desks/realm/lib/bazaar.hoon @@ -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 @@ -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] + == -- -- :: diff --git a/desks/realm/sur/bazaar/store.hoon b/desks/realm/sur/bazaar/store.hoon index 9231429c9c..f74a2f186a 100644 --- a/desks/realm/sur/bazaar/store.hoon +++ b/desks/realm/sur/bazaar/store.hoon @@ -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