diff --git a/desk/app/contacts.hoon b/desk/app/contacts.hoon index d58c90f1..51077350 100644 --- a/desk/app/contacts.hoon +++ b/desk/app/contacts.hoon @@ -18,7 +18,7 @@ -- :: %- agent:dbug -%+ verb & +%+ verb | ^- agent:gall =| state-0 =* state - diff --git a/desk/app/treaty.hoon b/desk/app/treaty.hoon index 0b040cac..cb4af4e0 100644 --- a/desk/app/treaty.hoon +++ b/desk/app/treaty.hoon @@ -4,6 +4,7 @@ ++ default-ally ~dister-dozzod-dozzod :: +$ card card:agent:gall ++$ state-1 [%1 state-0] +$ state-0 $: treaties=(map [=ship =desk] treaty) sovereign=(map desk treaty) @@ -15,7 +16,7 @@ ^- agent:gall %+ verb | %- agent:dbug -=| state-0 +=| state-1 =* state - =< |_ =bowl:gall @@ -30,8 +31,19 @@ ++ on-save !>(state) ++ on-load |= =vase + ?: =(%1 -.q.vase) + =+ !<(old=state-1 vase) + `this(state old) =+ !<(old=state-0 vase) - `this(state old) + :_ this(state [%1 old]) + %- zing + ^- (list (list card)) + %+ turn ~(tap by allies.old) + |= [=ship s=(set *)] + ^- (list card) + =* al ~(. al:cc ship) + ?^ s ~ + ~[leave:al watch:al] :: ++ on-poke |= [=mark =vase] @@ -59,7 +71,7 @@ ?< =(ship our.bowl) =* al ~(. al:cc ship.update) ?- -.update - %add [~[watch:al] this(allies (~(put by allies) ship *alliance))] + %add [~[leave:al watch:al] this(allies (~(put by allies) ship *alliance))] %del [~[leave:al] this(allies (~(del by allies) ship))] == :: @@ -111,6 +123,17 @@ ::NOTE this assumes that all treaties in sovereign are also :: present in the treaties map (fact-init:io (treaty-update:cg:cc %ini treaties))^~ + :: + [%treaties @ ~] + :_ this + =/ =ship (slav %p i.t.path) + =/ alliance (~(get ju allies) ship) + =/ allied + %- ~(gas by *(map [^ship desk] treaty)) + %+ skim ~(tap by treaties) + |= [ref=[^ship desk] =treaty] + (~(has in alliance) ref) + (fact-init:io (treaty-update:cg:ca:cc %ini allied))^~ :: [%alliance ~] :_ this @@ -307,13 +330,14 @@ ++ leave (leave:pass dock) ++ gone ^- (list card) - :~ (fact:io (treaty-update:cg %del ship desk) /treaties ~) + :~ (fact:io (treaty-update:cg %del ship desk) /treaties /treaties/[(scot %p ship)] ~) (kick-only:io our.bowl path ~) == ++ give ^- (list card) =/ t=treaty (~(got by treaties) ship desk) :~ (fact:io (treaty-update:cg %add t) /treaties ~) + (fact:io (treaty-update:cg %add t) /treaties/[(scot %p ship)] ~) (fact:io (treaty:cg t) path ~) == -- diff --git a/desk/desk.docket-0 b/desk/desk.docket-0 index d74552a3..5798d342 100644 --- a/desk/desk.docket-0 +++ b/desk/desk.docket-0 @@ -1,10 +1,10 @@ :~ title+'Landscape' info+'An app launcher for Urbit.' color+0xee.5432 - glob-http+['https://bootstrap.urbit.org/glob-0v3.0dqi8.1csij.8dv08.lhglb.45fpk.glob' 0v3.0dqi8.1csij.8dv08.lhglb.45fpk] + glob-http+['https://bootstrap.urbit.org/glob-0v2.2j09f.su13i.4sjhg.eihlk.9kn8b.glob' 0v2.2j09f.su13i.4sjhg.eihlk.9kn8b] ::glob-ames+~zod^0v0 base+'landscape' - version+[1 24 0] + version+[1 25 0] website+'https://tlon.io' license+'MIT' == diff --git a/ui/package.json b/ui/package.json index 43f1d114..9983d2bf 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "landscape", - "version": "1.11.0", + "version": "1.25.0", "private": true, "engines": { "node": "^16.0.0" diff --git a/ui/src/constants.ts b/ui/src/constants.ts index f4865c89..60690074 100644 --- a/ui/src/constants.ts +++ b/ui/src/constants.ts @@ -4,194 +4,163 @@ export const storageVersion = parseInt( ); export const SECTIONS = { - SELECTS: 'Tlon Selects', - PALS: 'Powered by Pals', - DEV: 'Develop on Urbit', - USEFUL: 'Make Urbit Useful', - FUN: 'Make Urbit Fun', + ESSENTIALS: 'Essentials', + SOCIAL: 'Social', + MEDIA: 'Media', + UTILITIES: 'Utilities', + FUN: 'Fun' }; export const APPS = [ + // ESSENTIALS { - title: 'pals', - description: 'friendlist for peer discovery', + title: 'Tlon', + description: 'Start, host, and cultivate communities.', + color: '#EFF0F4', + link: '/apps/groups', + source: '~sogryp-dister-dozzod-dozzod', + section: SECTIONS.ESSENTIALS, + desk: 'groups', + image: 'https://bootstrap.urbit.org/tlon.svg?v=1' + }, + { + title: 'Pals', + description: 'Friendlist for peer discovery.', color: '#99D3BD', link: '/pals', source: '~paldev', - section: SECTIONS.SELECTS, - desk: 'pals', + section: SECTIONS.ESSENTIALS, + desk: 'pals' }, { title: 'Terminal', - description: "A web interface to your Urbit's command line", - color: '#233D34', + description: 'A web interface to your Urbit\'s command line.', + color: '#2E4347', link: '/apps/webterm', - section: SECTIONS.SELECTS, - desk: 'webterm', source: '~mister-dister-dozzod-dozzod', + section: SECTIONS.ESSENTIALS, + desk: 'webterm' }, + // SOCIAL { - title: 'face', - description: 'see your friends', - color: '#3B5998', - link: '/face', - source: '~paldev', - section: SECTIONS.PALS, - desk: 'face', - }, - { - title: 'rumors', - description: 'Anonymous gossip from friends of friends', + title: 'Rumors', + description: 'Anonymous gossip from friends of friends.', color: '#BB77DD', link: '/rumors', source: '~paldev', - section: SECTIONS.PALS, - desk: 'rumors', + section: SECTIONS.SOCIAL, + desk: 'rumors' }, { - title: 'Contacts', - description: 'Contact book', - color: '#338899', - link: '/apps/whom', - section: SECTIONS.PALS, - source: '~holnes', - desk: 'whom', - }, - { - title: "sc'o're", - description: "leaderboard for groups' ['o']s, as seen on tv!", - color: '#FFFF00', - link: '/scooore', - source: '~paldev', - section: SECTIONS.PALS, - desk: 'scooore', + title: 'Radio', + description: 'An app for urbit disc jockeys.', + color: '#FFFFFF', + link: '/apps/radio', + section: SECTIONS.SOCIAL, + desk: 'radio', + source: '~nodmyn-dosrux', + image: 'https://bwyl.nyc3.digitaloceanspaces.com/radio/radio.png' }, { title: 'Trill', - description: 'Twitter without limits, and much more', + description: 'Twitter without limits, and much more.', color: '#FFD400', link: '/apps/trill', - section: SECTIONS.PALS, + section: SECTIONS.SOCIAL, desk: 'trill', source: '~dister-dozzod-sortug', + image: 'https://s3.sortug.com/img/trill-logo.png' }, - { - title: 'Portal', - description: - 'A tool for decentralized curation and discovery of groups, apps and content on Urbit.', - color: '#FFFFFF', - link: '/apps/portal', - section: SECTIONS.PALS, - desk: 'portal', - source: '~worpet-bildet', - image: 'https://toptyr-bilder.nyc3.cdn.digitaloceanspaces.com/tile2.svg', - }, - { - title: 'Docs', - description: 'User and developer documentation for Urbit apps', - color: '#FFCF00', - link: '/apps/docs', - section: SECTIONS.DEV, - desk: 'docs', - source: '~pocwet', - }, - { - title: 'Quorum', - description: - 'A choral explanations app (a la Stack Overflow or Quora) for Urbit', - color: '#F2F2F2', - link: '/apps/quorom', - section: SECTIONS.DEV, - desk: 'quorum', - source: '~dister-dister-sidnym-ladrut', - image: 'https://ladrut.xyz/quorum/quorum-logo.png', - }, - { - title: 'cliff', - description: 'filesystem explorer', - color: '#E39871', - link: '/cliff/view/our/base/now', - section: SECTIONS.DEV, - desk: 'cliff', - source: '~paldev', - }, - { - title: 'silo', - description: 'An S3 storage manager', - color: '#4F46E5', - link: '/apps/silo', - section: SECTIONS.USEFUL, - source: '~dister-nocsyx-lassul', - desk: 'silo', - }, - { - title: 'Grove (alpha)', - description: 'Groups file drive', - color: '#e5e7eb', - link: '/apps/grove', - section: SECTIONS.USEFUL, - source: '~dister-dozzod-dalten', - desk: 'grove', - image: 'https://freedom-club.sfo2.digitaloceanspaces.com/grove.png', - }, - { - title: 'hodl', - description: 'A portfolio for all that you hodl', - color: '#B8A3D1', - link: '/apps/hodl', - section: SECTIONS.USEFUL, - desk: 'hodl', - source: '~hodler-datder-sonnet', - image: - 'https://user-images.githubusercontent.com/16504501/194947852-8802fd63-5954-4ce8-b147-2072bd929242.png', - }, - { - title: 'Goals', - description: 'Urbit task manager.', - color: '#EEDFC9', - link: '/apps/gol-cli', - section: SECTIONS.USEFUL, - desk: 'gol-cli', - source: '~dister-dozzod-niblyx-malnus', - }, + // MEDIA { title: 'Common Blog', description: 'Self-hosted writing and publishing.', color: '#EFF0F4', link: '/apps/blog', - section: SECTIONS.USEFUL, + section: SECTIONS.MEDIA, desk: 'blog', source: '~dister-bonbud-macryg', image: 'https://raw.githubusercontent.com/thecommons-urbit/blog/main/assets/tile.png' }, { - title: 'Board', - description: 'A tapestry of boards', - color: '#9E34EB', - link: '/apps/board', - section: SECTIONS.FUN, - desk: 'board', - source: '~dister-hanfel-dovned', + title: "Feeds", + description: "Aggregate, discover, and publish web feeds.", + color: "#CCCCCC", + link: "/feeds/~/recent", + source: '~dister-migrev-dolseg', + section: SECTIONS.MEDIA, + desk: 'feeds', + image: 'https://nyc3.digitaloceanspaces.com/drain/2023.12.13..02.46.56-feeds.png' }, { - title: 'DukeBox', - description: 'Emulated DOS games on Urbit', - color: '#209AFA', - link: '/apps/dukebox', + title: 'Scratch', + description: 'For writing and sharing bits of text.', + color: '#50AAEC', + link: '/scratch', + source: '~dister-nocsyx-lassul', + section: SECTIONS.MEDIA, + desk: 'scratch', + image: 'https://nyc3.digitaloceanspaces.com/hmillerdev/nocsyx-lassul/2023.6.11..05.43.03-scratch.svg' + }, + // UTILITIES + { + title: "Eyas", + description: "Text editor.", + color: '#7F5AB6', + link: '/eyas', + source: '~dister-migrev-dolseg', + section: SECTIONS.UTILITIES, + desk: 'eyas', + image: 'https://nyc3.digitaloceanspaces.com/drain/2023.10.29..09.56.09-eyas-icon.png' + }, + { + title: 'Albums', + description: 'A photo sharing app.', + color: '#9AACBD', + link: '/apps/albums', + source: '~topdem', + section: SECTIONS.UTILITIES, + desk: 'albums', + image: 'https://files.native.computer/albums/albums.svg' + }, + { + title: 'Hits', + description: 'A leaderboard for app installs.', + color: '#1E1414', + link: '/apps/hits', + source: '~bitdeg', + section: SECTIONS.UTILITIES, + desk: 'hits', + image: 'https://storage.googleapis.com/media.urbit.org/apps/%25hits-logo.png', + }, + // FUN + { + title: 'Turf', + description: 'Build a world with your friends, explore, and hang out.', + color: '#1F843C', + link:'/apps/turf', + source: '~pandux', section: SECTIONS.FUN, - desk: 'dukebox', - source: '~tagrev-lacmur-lomped-firser', - image: - 'https://cdn.pixabay.com/photo/2012/04/13/11/41/joystick-32023_960_720.png', + desk: 'turf', + image: 'https://raw.githubusercontent.com/johnhyde/turf/main/public/logo-big.png' }, { - title: 'radio', - description: 'an app for urbit disc jockeys', - color: '#FFFFFF', - link: '/apps/radio', + title: 'Board', + description: 'A tapestry of boards.', + color: '#9E34EB', + link: '/apps/board', + source: '~ridlyd', section: SECTIONS.FUN, - desk: 'radio', - source: '~nodmyn-dosrux', - image: 'https://bwyl.nyc3.digitaloceanspaces.com/radio/radio.png', + desk: 'board' }, + { + title: 'Hydra', + description: 'Make it spin.', + color: '#D3D3D3', + link: '/apps/hydra', + source: '~tolmud-tobtud', + section: SECTIONS.FUN, + desk: 'hydra', + image: 'https://s3.tolmud-tobtud.startram.io/bucket/tolmud-tobtud/2023.12.01..16.41.53-Screenshot%202023-12-01%20at%2011.17.04.png' + } ]; diff --git a/ui/src/state/docket.ts b/ui/src/state/docket.ts index c5a51d29..90cda359 100644 --- a/ui/src/state/docket.ts +++ b/ui/src/state/docket.ts @@ -223,10 +223,15 @@ export function useAllyTreaties(ship: string) { // [ship] // ) // ); - const { data: treatyData, isLoading } = useReactQueryScry({ + + const { data: treatyData, isLoading } = useReactQuerySubscription< + TreatyUpdateIni, + TreatyUpdate + >({ queryKey: ['treaty', 'treaties', ship], app: 'treaty', path: `/treaties/${ship}`, + scry: `/treaties/${ship}`, options: { enabled: isAllied, }, @@ -238,6 +243,7 @@ export function useAllyTreaties(ship: string) { } return normalizeDockets(treatyData.ini); }, [treatyData]); + const status = getAllyTreatyStatus( treaties, isLoading,