on main help sign in
bump version and fix some weird bug
1e69bbdJohn Hyde
desk/desk.docket-0+2−2
@@ -2,9 +2,9 @@
2 info+'Your guide to the Urbit constellations'
2 info+'Your guide to the Urbit constellations'
3 color+0x1f.243c
3 color+0x1f.243c
4 image+'https://raw.githubusercontent.com/johnhyde/astrolabe/main/ui/src/assets/astrolabe-tile.svg'
4 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]
6 base+'astrolabe'
6 base+'astrolabe'
7− version+[0 3 7]
7+ version+[0 3 8]
8 website+'https://github.com/johnhyde/astrolabe'
8 website+'https://github.com/johnhyde/astrolabe'
9 license+'MIT'
9 license+'MIT'
10==
10==
ui/src/actions/tooltip.ts+2−2
@@ -23,11 +23,11 @@ function getParams(paramsOrContent:any = {}, overrides = {}) {
23
23
24export default function tooltip(node, paramsOrContent: any = {}) {
24export default function tooltip(node, paramsOrContent: any = {}) {
25 const onTrigger = () => {
25 const onTrigger = () => {
26− console.log('triggered');
26+ // console.log('triggered');
27 node.dispatchEvent(new CustomEvent("tooltipTriggered"));
27 node.dispatchEvent(new CustomEvent("tooltipTriggered"));
28 };
28 };
29 const onUntrigger = () => {
29 const onUntrigger = () => {
30− console.log('untriggered');
30+ // console.log('untriggered');
31 node.dispatchEvent(new CustomEvent("tooltipUntriggered"));
31 node.dispatchEvent(new CustomEvent("tooltipUntriggered"));
32 };
32 };
33 const onClickOutside = (_, e) => {
33 const onClickOutside = (_, e) => {
ui/src/components/CollapsibleContent.svelte+4−5
@@ -1,18 +1,17 @@
1<script lang="ts">
1<script lang="ts">
2− import { slide } from 'svelte/transition';
2+ import { slide } from 'svelte/transition';
3− import { quintOut } from 'svelte/easing';
4−
5 export let open: boolean = true;
3 export let open: boolean = true;
6</script>
4</script>
7
5
8<div class="mt-2">
6<div class="mt-2">
9 <button on:click={() => (open = !open)}>
7 <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>
11 &nbsp;
9 &nbsp;
12 <slot name="title"></slot>
10 <slot name="title"></slot>
13 </button>
11 </button>
14 {#if open}
12 {#if open}
13+ <!-- turns out it's important not to put an await in the content -->
15− <div class="ml-[22px]" transition:slide="{{duration: 50 }}">
14+ <div class="ml-[22px]" transition:slide|local="{{duration: 150 }}">
16 <slot name="content"></slot>
15 <slot name="content"></slot>
17 </div>
16 </div>
18 {/if}
17 {/if}
ui/src/components/StarChart.svelte+15−2
@@ -1,7 +1,8 @@
1<script lang="ts">
1<script lang="ts">
2 import LoadingSpinner from '@/common/LoadingSpinner.svelte';
2 import LoadingSpinner from '@/common/LoadingSpinner.svelte';
3
3
4− import { push } from 'svelte-spa-router'
4+ import { push } from 'svelte-spa-router';
5+ import { onDestroy } from 'svelte';
5
6
6 import Sigma from 'sigma-jh';
7 import Sigma from 'sigma-jh';
7 import Graph from 'graphology';
8 import Graph from 'graphology';
@@ -9,7 +10,7 @@
9 import { clan } from 'urbit-ob';
10 import { clan } from 'urbit-ob';
10 import DocLink from './docs/DocLink.svelte';
11 import DocLink from './docs/DocLink.svelte';
11 import store from 'stores/store';
12 import store from 'stores/store';
12− import { cite, normalizeId } from 'lib/id';
13+ import keys from 'stores/keys';
13 import { parseChartData, populateGraph } from 'lib/graph';
14 import { parseChartData, populateGraph } from 'lib/graph';
14 import { getChartData } from 'lib/api';
15 import { getChartData } from 'lib/api';
15 import { linkToShip } from 'lib/link';
16 import { linkToShip } from 'lib/link';
@@ -150,6 +151,18 @@
150 let filterSet: Set<string> = null;
151 let filterSet: Set<string> = null;
151 $: peersSet = new Set($store.peers);
152 $: peersSet = new Set($store.peers);
152 $: palsSet = new Set(Object.keys($store.pals.outgoing));
153 $: 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+ });
153</script>
166</script>
154
167
155<div class="border border-gold bg-navy w-full grow flex flex-col relative">
168<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 @@
1<script lang="ts">
1<script lang="ts">
2− import { clan, patp2dec } from 'urbit-ob';
2+ import { clan } from 'urbit-ob';
3− import { getPoint, getSpawnedPoints } from 'lib/api';
4− import { generateParentChain, processPointInfo } from 'lib/ship';
5 import TooltipAndDocLink from '@/common/TooltipAndDocLink.svelte';
3 import TooltipAndDocLink from '@/common/TooltipAndDocLink.svelte';
6 import EthAddressLink from '@/common/EthAddressLink.svelte';
4 import EthAddressLink from '@/common/EthAddressLink.svelte';
7 import ShipChain from './ShipChain.svelte';
5 import ShipChain from './ShipChain.svelte';
@@ -14,7 +12,7 @@
14 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
12 $: azPoint = ['galaxy', 'star', 'planet'].includes(shipClass);
15</script>
13</script>
16
14
17−{#if azPoint}
15+{#if azPoint && pointInfo.life !== undefined}
18 {#if shipClass !== 'galaxy'}
16 {#if shipClass !== 'galaxy'}
19 <p>
17 <p>
20 {#if pointInfo.sponsorChain && pointInfo.sponsorChain.length > 0}
18 {#if pointInfo.sponsorChain && pointInfo.sponsorChain.length > 0}
ui/src/components/ship_view/ShipView.svelte+6−18
@@ -69,12 +69,7 @@
69 <h3 class="text-lg text-center text-gray-700">{patp}</h3>
69 <h3 class="text-lg text-center text-gray-700">{patp}</h3>
70 {/if}
70 {/if}
71 <h4 class="text-center text-gray-700 break-words">
71 <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− > -->
76 {patp2dec(patp)}
72 {patp2dec(patp)}
77− <!-- </TooltipAndDocLink> -->
78 </h4>
73 </h4>
79 <div class="flex flex-wrap justify-center gap-1.5 my-1.5">
74 <div class="flex flex-wrap justify-center gap-1.5 my-1.5">
80 <GoldBadge title={"it's a " + shipClass} doc={shipClass}>{shipClass}</GoldBadge>
75 <GoldBadge title={"it's a " + shipClass} doc={shipClass}>{shipClass}</GoldBadge>
@@ -108,22 +103,16 @@
108 </p>
103 </p>
109 {/if}
104 {/if}
110 {#if azPoint}
105 {#if azPoint}
106+ {#await rawPointInfoPromise}
107+ <LoadingSpinner spinnerClass="text-black" />
108+ {:then}
111 <CollapsibleContent>
109 <CollapsibleContent>
112 <b slot="title">Azimuth Details</b>
110 <b slot="title">Azimuth Details</b>
113 <div slot="content">
111 <div slot="content">
114− {#await rawPointInfoPromise}
115− <LoadingSpinner spinnerClass="text-black" />
116− {:then}
117 <AzimuthDetails {patp} {pointInfo}></AzimuthDetails>
112 <AzimuthDetails {patp} {pointInfo}></AzimuthDetails>
118−
113+ </div>
119− <!-- {#if value && value.point}
114+ </CollapsibleContent>
120− <pre class="text-sm overflow-scroll">
115+ {/await}
121− Raw Info:{JSON.stringify(rawPointInfo, null, 2)}
122− </pre>
123− {/if} -->
124− {/await}
125− </div>
126− </CollapsibleContent>
127 {/if}
116 {/if}
128 </div>
117 </div>
129 </div>
118 </div>
@@ -132,7 +121,6 @@
132 <ProfileShipViewExtension {patp} />
121 <ProfileShipViewExtension {patp} />
133 <PalsShipViewExtension {patp} />
122 <PalsShipViewExtension {patp} />
134 <AppsShipViewExtension {patp} />
123 <AppsShipViewExtension {patp} />
135− <!-- <GroupsShipViewExtension {patp} /> -->
136 </div>
124 </div>
137 {#if azPoint}
125 {#if azPoint}
138 <div class="mt-5 border-t">
126 <div class="mt-5 border-t">
ui/src/routes/Home.svelte+11
@@ -35,27 +35,35 @@
35 urlSearchMode = getUrlSearchMode(searchParams);
35 urlSearchMode = getUrlSearchMode(searchParams);
36 urlChangedSinceShipQuery = true;
36 urlChangedSinceShipQuery = true;
37 navigating = false;
37 navigating = false;
38+ // console.log('url changed');
38 }
39 }
39 }
40 }
40 $: {
41 $: {
41 urlChangedSinceShipQuery = (search || true) && searchMode && false;
42 urlChangedSinceShipQuery = (search || true) && searchMode && false;
43+ // console.log('search changed');
42 }
44 }
43 function autoNav() {
45 function autoNav() {
46+ // console.log('autonav');
44 if ((search !== urlSearch || searchMode !== urlSearchMode)) {
47 if ((search !== urlSearch || searchMode !== urlSearchMode)) {
45 if (urlChangedSinceShipQuery) {
48 if (urlChangedSinceShipQuery) {
46 search = urlSearch;
49 search = urlSearch;
47 searchMode = urlSearchMode;
50 searchMode = urlSearchMode;
51+ // console.log('url wins');
48 } else {
52 } else {
49 navigating = true;
53 navigating = true;
54+ // console.log('search wins');
50 // create a temp one because the real one doesn't always update in time!
55 // create a temp one because the real one doesn't always update in time!
51 let tempAnalysis = new SearchAnalysis(search);
56 let tempAnalysis = new SearchAnalysis(search);
52 if (params.mode === 'chart') {
57 if (params.mode === 'chart') {
58+ // console.log('to chart');
53 navToChart(tempAnalysis.patpIsValid);
59 navToChart(tempAnalysis.patpIsValid);
54 } else {
60 } else {
55 if (tempAnalysis.patpIsValid) {
61 if (tempAnalysis.patpIsValid) {
62+ // console.log('to ship view');
56 navToShipView(tempAnalysis.patp, true);
63 navToShipView(tempAnalysis.patp, true);
57 } else {
64 } else {
58 const fromShipMode = params.mode === 'ship';
65 const fromShipMode = params.mode === 'ship';
66+ // console.log('to search');
59 navToSearch(fromShipMode);
67 navToSearch(fromShipMode);
60 }
68 }
61 }
69 }
@@ -156,6 +164,9 @@
156 allowSigilSearch={params.mode !== 'chart'}
164 allowSigilSearch={params.mode !== 'chart'}
157 />
165 />
158 <!-- <div class="bg-white">
166 <!-- <div class="bg-white">
167+ <p>
168+ Mode: {params.mode}
169+ </p>
159 <p>
170 <p>
160 Search: {search}
171 Search: {search}
161 </p>
172 </p>
ui/src/styles/tailwind-output.css+13
@@ -1040,6 +1040,10 @@ Ensure the default browser behavior of the `hidden` attribute.
1040 --tw-rotate: -45deg;
1040 --tw-rotate: -45deg;
1041 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));
1041 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));
1042}
1042}
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+}
1043.scale-150 {
1047.scale-150 {
1044 --tw-scale-x: 1.5;
1048 --tw-scale-x: 1.5;
1045 --tw-scale-y: 1.5;
1049 --tw-scale-y: 1.5;
@@ -1780,6 +1784,12 @@ Ensure the default browser behavior of the `hidden` attribute.
1780.leading-3 {
1784.leading-3 {
1781 line-height: .75rem;
1785 line-height: .75rem;
1782}
1786}
1787+.leading-5 {
1788+ line-height: 1.25rem;
1789+}
1790+.leading-8 {
1791+ line-height: 2rem;
1792+}
1783.text-gray-600 {
1793.text-gray-600 {
1784 --tw-text-opacity: 1;
1794 --tw-text-opacity: 1;
1785 color: rgb(75 85 99 / var(--tw-text-opacity));
1795 color: rgb(75 85 99 / var(--tw-text-opacity));
@@ -1908,6 +1918,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1908 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1918 transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1909 transition-duration: 150ms;
1919 transition-duration: 150ms;
1910}
1920}
1921+.duration-150 {
1922+ transition-duration: 150ms;
1923+}
1911.hover\:bg-gray-200:hover {
1924.hover\:bg-gray-200:hover {
1912 --tw-bg-opacity: 1;
1925 --tw-bg-opacity: 1;
1913 background-color: rgb(229 231 235 / var(--tw-bg-opacity));
1926 background-color: rgb(229 231 235 / var(--tw-bg-opacity));