on main help sign in
bump version and fix some weird bug
commit1e69bbd67bfd176e1bd7b396b9eb295b5007911a authorJohn Hyde <johnhydefour@gmail.com> dateWed 14 Dec 2022, 14:17 (4 years ago) parent0eeff2c
8 files changed+55−33
desk/desk.docket-0+2−2 ui/src/actions/tooltip.ts+2−2 ui/src/components/CollapsibleContent.svelte+4−5 ui/src/components/StarChart.svelte+15−2 ui/src/components/ship_view/AzimuthDetails.svelte+2−4 ui/src/components/ship_view/ShipView.svelte+6−18 ui/src/routes/Home.svelte+11 ui/src/styles/tailwind-output.css+13
desk/desk.docket-0+2−2
@@ -2,9 +2,9 @@
22 info+'Your guide to the Urbit constellations'
33 color+0x1f.243c
44 image+'https://raw.githubusercontent.com/johnhyde/astrolabe/main/ui/src/assets/astrolabe-tile.svg'
5− glob-http+['https://s3.us-east-2.amazonaws.com/warkgnall.com/urbit/astrolabe/globs/glob-0v4.pblr2.22g1n.glg47.p9i8t.2n33l.glob' 0v4.pblr2.22g1n.glg47.p9i8t.2n33l]
5+ glob-http+['https://s3.us-east-2.amazonaws.com/warkgnall.com/urbit/astrolabe/globs/glob-0v6.g0rdr.d6ja2.qomtg.hqt4o.i0i83.glob' 0v6.g0rdr.d6ja2.qomtg.hqt4o.i0i83]
66 base+'astrolabe'
7− version+[0 3 7]
7+ version+[0 3 8]
88 website+'https://github.com/johnhyde/astrolabe'
99 license+'MIT'
1010==
ui/src/actions/tooltip.ts+2−2
@@ -23,11 +23,11 @@ function getParams(paramsOrContent:any = {}, overrides = {}) {
2323
2424export default function tooltip(node, paramsOrContent: any = {}) {
2525 const onTrigger = () => {
26− console.log('triggered');
26+ // console.log('triggered');
2727 node.dispatchEvent(new CustomEvent("tooltipTriggered"));
2828 };
2929 const onUntrigger = () => {
30− console.log('untriggered');
30+ // console.log('untriggered');
3131 node.dispatchEvent(new CustomEvent("tooltipUntriggered"));
3232 };
3333 const onClickOutside = (_, e) => {
ui/src/components/CollapsibleContent.svelte+4−5
@@ -1,18 +1,17 @@
11<script lang="ts">
2− import { slide } from 'svelte/transition';
3− import { quintOut } from 'svelte/easing';
4−
2+ import { slide } from 'svelte/transition';
53 export let open: boolean = true;
64</script>
75
86<div class="mt-2">
97 <button on:click={() => (open = !open)}>
10− <span class="font-mono">{open ? '▼' : '▶'}</span>
8+ <span class="font-mono inline-block transition duration-150 {open ? 'rotate-90' : ''}">▶</span>
119 &nbsp;
1210 <slot name="title"></slot>
1311 </button>
1412 {#if open}
15− <div class="ml-[22px]" transition:slide="{{duration: 50 }}">
13+ <!-- turns out it's important not to put an await in the content -->
14+ <div class="ml-[22px]" transition:slide|local="{{duration: 150 }}">
1615 <slot name="content"></slot>
1716 </div>
1817 {/if}
ui/src/components/StarChart.svelte+15−2
@@ -1,7 +1,8 @@
11<script lang="ts">
22 import LoadingSpinner from '@/common/LoadingSpinner.svelte';
33
4− import { push } from 'svelte-spa-router'
4+ import { push } from 'svelte-spa-router';
5+ import { onDestroy } from 'svelte';
56
67 import Sigma from 'sigma-jh';
78 import Graph from 'graphology';
@@ -9,7 +10,7 @@
910 import { clan } from 'urbit-ob';
1011 import DocLink from './docs/DocLink.svelte';
1112 import store from 'stores/store';
12− import { cite, normalizeId } from 'lib/id';
13+ import keys from 'stores/keys';
1314 import { parseChartData, populateGraph } from 'lib/graph';
1415 import { getChartData } from 'lib/api';
1516 import { linkToShip } from 'lib/link';
@@ -150,6 +151,18 @@
150151 let filterSet: Set<string> = null;
151152 $: peersSet = new Set($store.peers);
152153 $: palsSet = new Set(Object.keys($store.pals.outgoing));
154+
155+ function closeChart() {
156+ push('/');
157+ }
158+
159+ $: {
160+ $keys.keyup.get('escape').set('starChart', closeChart);
161+ }
162+
163+ onDestroy(() => {
164+ $keys.keyup.get('escape').delete('starChart');
165+ });
153166</script>
154167
155168<div class="border border-gold bg-navy w-full grow flex flex-col relative">
ui/src/components/ship_view/AzimuthDetails.svelte+2−4
@@ -1,7 +1,5 @@
11<script lang="ts">
2− import { clan, patp2dec } from 'urbit-ob';
3− import { getPoint, getSpawnedPoints } from 'lib/api';
4− import { generateParentChain, processPointInfo } from 'lib/ship';
2+ import { clan } from 'urbit-ob';
53 import TooltipAndDocLink from '@/common/TooltipAndDocLink.svelte';
64 import EthAddressLink from '@/common/EthAddressLink.svelte';
75 import ShipChain from './ShipChain.svelte';
@@ -14,7 +12,7 @@
1412 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
1513</script>
1614
17−{#if azPoint}
15+{#if azPoint && pointInfo.life !== undefined}
1816 {#if shipClass !== 'galaxy'}
1917 <p>
2018 {#if pointInfo.sponsorChain && pointInfo.sponsorChain.length > 0}
ui/src/components/ship_view/ShipView.svelte+6−18
@@ -69,12 +69,7 @@
6969 <h3 class="text-lg text-center text-gray-700">{patp}</h3>
7070 {/if}
7171 <h4 class="text-center text-gray-700 break-words">
72− <!-- <TooltipAndDocLink
73− text="The integer representation of this ID"
74− doc="patpee" class="inline"
75− > -->
7672 {patp2dec(patp)}
77− <!-- </TooltipAndDocLink> -->
7873 </h4>
7974 <div class="flex flex-wrap justify-center gap-1.5 my-1.5">
8075 <GoldBadge title={"it's a " + shipClass} doc={shipClass}>{shipClass}</GoldBadge>
@@ -108,22 +103,16 @@
108103 </p>
109104 {/if}
110105 {#if azPoint}
106+ {#await rawPointInfoPromise}
107+ <LoadingSpinner spinnerClass="text-black" />
108+ {:then}
111109 <CollapsibleContent>
112110 <b slot="title">Azimuth Details</b>
113111 <div slot="content">
114− {#await rawPointInfoPromise}
115− <LoadingSpinner spinnerClass="text-black" />
116− {:then}
117112 <AzimuthDetails {patp} {pointInfo}></AzimuthDetails>
118−
119− <!-- {#if value && value.point}
120− <pre class="text-sm overflow-scroll">
121− Raw Info:{JSON.stringify(rawPointInfo, null, 2)}
122− </pre>
123− {/if} -->
124− {/await}
125− </div>
126− </CollapsibleContent>
113+ </div>
114+ </CollapsibleContent>
115+ {/await}
127116 {/if}
128117 </div>
129118 </div>
@@ -132,7 +121,6 @@
132121 <ProfileShipViewExtension {patp} />
133122 <PalsShipViewExtension {patp} />
134123 <AppsShipViewExtension {patp} />
135− <!-- <GroupsShipViewExtension {patp} /> -->
136124 </div>
137125 {#if azPoint}
138126 <div class="mt-5 border-t">
ui/src/routes/Home.svelte+11
@@ -35,27 +35,35 @@
3535 urlSearchMode = getUrlSearchMode(searchParams);
3636 urlChangedSinceShipQuery = true;
3737 navigating = false;
38+ // console.log('url changed');
3839 }
3940 }
4041 $: {
4142 urlChangedSinceShipQuery = (search || true) && searchMode && false;
43+ // console.log('search changed');
4244 }
4345 function autoNav() {
46+ // console.log('autonav');
4447 if ((search !== urlSearch || searchMode !== urlSearchMode)) {
4548 if (urlChangedSinceShipQuery) {
4649 search = urlSearch;
4750 searchMode = urlSearchMode;
51+ // console.log('url wins');
4852 } else {
4953 navigating = true;
54+ // console.log('search wins');
5055 // create a temp one because the real one doesn't always update in time!
5156 let tempAnalysis = new SearchAnalysis(search);
5257 if (params.mode === 'chart') {
58+ // console.log('to chart');
5359 navToChart(tempAnalysis.patpIsValid);
5460 } else {
5561 if (tempAnalysis.patpIsValid) {
62+ // console.log('to ship view');
5663 navToShipView(tempAnalysis.patp, true);
5764 } else {
5865 const fromShipMode = params.mode === 'ship';
66+ // console.log('to search');
5967 navToSearch(fromShipMode);
6068 }
6169 }
@@ -156,6 +164,9 @@
156164 allowSigilSearch={params.mode !== 'chart'}
157165 />
158166 <!-- <div class="bg-white">
167+ <p>
168+ Mode: {params.mode}
169+ </p>
159170 <p>
160171 Search: {search}
161172 </p>
ui/src/styles/tailwind-output.css+13
@@ -1040,6 +1040,10 @@ Ensure the default browser behavior of the `hidden` attribute.
10401040 --tw-rotate: -45deg;
10411041 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
10421042}
1043+.rotate-90 {
1044+ --tw-rotate: 90deg;
1045+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1046+}
10431047.scale-150 {
10441048 --tw-scale-x: 1.5;
10451049 --tw-scale-y: 1.5;
@@ -1780,6 +1784,12 @@ Ensure the default browser behavior of the `hidden` attribute.
17801784.leading-3 {
17811785 line-height: .75rem;
17821786}
1787+.leading-5 {
1788+ line-height: 1.25rem;
1789+}
1790+.leading-8 {
1791+ line-height: 2rem;
1792+}
17831793.text-gray-600 {
17841794 --tw-text-opacity: 1;
17851795 color: rgb(75 85 99 / var(--tw-text-opacity));
@@ -1908,6 +1918,9 @@ Ensure the default browser behavior of the `hidden` attribute.
19081918 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
19091919 transition-duration: 150ms;
19101920}
1921+.duration-150 {
1922+ transition-duration: 150ms;
1923+}
19111924.hover\:bg-gray-200:hover {
19121925 --tw-bg-opacity: 1;
19131926 background-color: rgb(229 231 235 / var(--tw-bg-opacity));