on main help sign in
bug fixes and improvements
ee2f1d7John Hyde
README.md+3−2
@@ -33,7 +33,8 @@ Regardless of what you run to develop, Vite will hot-reload code changes as you
33 2. `|mount %work` to mount it.
33 2. `|mount %work` to mount it.
343. Install the desk
343. Install the desk
35 1. From the root of the project: `./install.sh path/to/pier/astrolabe`
35 1. From the root of the project: `./install.sh path/to/pier/astrolabe`
36+ 2. From the distribution ship's dojo: `:treaty|unpublish %astrolabe`
36− 2. From the ship's dojo: `|commit %astrolabe`
37+ 2. From middleman or distribution ship's dojo: `|commit %astrolabe`
37 3. (if using a comet as a middleman) `|public %astrolabe`
38 3. (if using a comet as a middleman) `|public %astrolabe`
38 4. (if using a comet as a middleman) from the actual distribution ship: `|install ~comet-name %astrolabe`
39 4. (if using a comet as a middleman) from the actual distribution ship: `|install ~comet-name %astrolabe`
39 5. (if using a comet as a middleman) from the actual distribution ship: `|pause %astrolabe`
40 5. (if using a comet as a middleman) from the actual distribution ship: `|pause %astrolabe`
@@ -57,7 +58,7 @@ To deploy, run `npm run build` in the `ui` directory which will bundle all the c
5710. Once you've uploaded the glob, you should then update the corresponding entry in the docket file at `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
5810. Once you've uploaded the glob, you should then update the corresponding entry in the docket file at `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
58
59
59```hoon
60```hoon
60− glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
61+ glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
61```
62```
62
63
6311. This can now be safely committed and deployed.
6411. This can now be safely committed and deployed.
desk/desk.docket-0+1−1
@@ -4,7 +4,7 @@
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-ames+[~dister-midlev-mindyr 0v0]
5 glob-ames+[~dister-midlev-mindyr 0v0]
6 base+'astrolabe'
6 base+'astrolabe'
7− version+[0 0 1]
7+ version+[0 0 2]
8 website+'https://github.com/johnhyde/astrolabe'
8 website+'https://github.com/johnhyde/astrolabe'
9 license+'MIT'
9 license+'MIT'
10==
10==
desk/doc.cluedeleted−33
@@ -1,33 +0,0 @@
1−:-
2−:: User docs
3−::
4−:~ [/urbit-id/udon 'What is an Urbit ID?']
5− [/galaxy/udon 'Galaxies']
6− [/star/udon 'Stars']
7− [/planet/udon 'Planets']
8− [/moon/udon 'Moons']
9− [/comet/udon 'Comets']
10− [/patpee/udon 'What is a @p?']
11− [/phonemes/udon 'Phonemes - Prefixes & Suffixes']
12− [/azimuth/udon 'What is Azimuth?']
13− [/l2/udon 'Layer 1 and Layer 2']
14− [/keys/udon 'Networking Keys']
15− :: [/baz/udon 'baz docs']
16−==
17−:: Developer docs
18−::
19−:: :~ :- %$
20−:: :~ [/foo/udon 'Some whole-desk docs']
21−:: [/bar/udon 'More whole-desk docs']
22−:: ==
23−:: :- %my-agent
24−:: :~ [/blah/udon 'blah blah']
25−:: [/etc/udon 'another doc']
26−:: ==
27−:: :- %another-agent
28−:: :~ [/foo/udon 'Foo title']
29−:: [/bar/udon 'Bar title']
30−:: [/baz/udon 'Baz title']
31−:: ==
32−:: ==
33−~
desk/doc.tocnew file+13
@@ -0,0 +1,13 @@
1+/overview/udon About Astrolabe
2+/usr User
3+ /urbit-id/udon What is an Urbit ID?
4+ /galaxy/udon Galaxies
5+ /star/udon Stars
6+ /planet/udon Planets
7+ /moon/udon Moons
8+ /comet/udon Comets
9+ /patpee/udon What is a @p?
10+ /phonemes/udon Phonemes - Prefixes & Suffixes
11+ /azimuth/udon What is Azimuth?
12+ /l2/udon Layer 1 and Layer 2
13+ /keys/udon Networking Keys
desk/doc/overview.udonnew file+24
@@ -0,0 +1,24 @@
1+;>
2+# Astrolabe
3+
4+Currently Astrolabe lets you type in `@p`s or Azimuth point numbers
5+to look up ships on the network. There's also Help Documentation if
6+you want to learn more about how Urbit IDs work.
7+
8+## Info
9+
10+- Developer: ~midlev-mindyr
11+- License: MIT
12+- App link: [~dister-midlev-mindyr/astrolabe](web+urbitgraph://~dister-midlev-mindyr/astrolabe)
13+- Source repo: [https://github.com/johnhyde/astrolabe](https://github.com/johnhyde/astrolabe)
14+- Bug reports: [https://github.com/johnhyde/astrolabe/issues](https://github.com/johnhyde/astrolabe/issues)
15+
16+## Feedback
17+
18+If you run into issues with the app, or want to voice comments or concerns,
19+please post in the group `~poster-hoster-midlev-mindyr/astrolabe`, send a DM to `~midlev-mindyr`,
20+or [create an Issue on GitHub](https://github.com/johnhyde/astrolabe/issues).
21+
22+If you see something you want to improve, please fork the [GitHub repository](https://github.com/johnhyde/astrolabe) and make a pull request.
23+
24+Thanks for using Astrolabe. I hope it serves you well.
desk/doc/usr/astrolabe.udon+13
@@ -1,5 +1,18 @@
1+;>
1# Astrolabe
2# Astrolabe
2
3
4+Currently Astrolabe lets you type in `@p`s or Azimuth point numbers
5+to look up ships on the network. There's also Help Documentation if
6+you want to learn more about how Urbit IDs work.
7+
8+## Info
9+
10+- Developer: ~midlev-mindyr
11+- License: MIT
12+- App link: [~dister-midlev-mindyr/astrolabe](web+urbitgraph://~dister-midlev-mindyr/astrolabe)
13+- Source repo: [https://github.com/johnhyde/astrolabe](https://github.com/johnhyde/astrolabe)
14+- Bug reports: [https://github.com/johnhyde/astrolabe/issues](https://github.com/johnhyde/astrolabe/issues)
15+
3## Feedback
16## Feedback
4
17
5If you run into issues with the app, or want to voice comments or concerns,
18If you run into issues with the app, or want to voice comments or concerns,
desk/doc/usr/galaxy.udon+2−1
@@ -28,8 +28,9 @@ where they can find their sponsees so that they can communicate directly withthe
28asking a DNS server to tell you where to look for google.com.
28asking a DNS server to tell you where to look for google.com.
29Thus, it is crucially important that galaxies be online and reachable.
29Thus, it is crucially important that galaxies be online and reachable.
30
30
31−## [The Galactic Senate](https://urbit.org/docs/glossary/senate)
31+## The Galactic Senate
32
32
33+All galaxy owners are members of the [Galactic Senate](https://urbit.org/docs/glossary/senate).
33Galaxy owners can [vote](https://urbit.org/docs/glossary/voting) on proposals
34Galaxy owners can [vote](https://urbit.org/docs/glossary/voting) on proposals
34to upgrade the logic of [Azimuth](/~/scry/docs/usr/astrolabe/azimuth.html)
35to upgrade the logic of [Azimuth](/~/scry/docs/usr/astrolabe/azimuth.html)
35or approve the content of a document.
36or approve the content of a document.
docs-dev-desk/mar/toc.hoonnew file+16
@@ -0,0 +1,16 @@
1+/- docs
2+|_ tab=@t
3+++ grab
4+ |%
5+ ++ mime |=([=mite len=@ud tex=@] `@t`tex)
6+ ++ noun @t
7+ ++ txt of-wain:format
8+ --
9+++ grow
10+ |%
11+ ++ mime [/text/x-toc (as-octs:mimes:html tab)]
12+ ++ noun tab
13+ ++ txt (to-wain:format tab)
14+ --
15+++ grad %txt
16+--
ui/src/App.svelte+2−2
@@ -9,9 +9,9 @@
9 const routes = {
9 const routes = {
10 // '/': Home,
10 // '/': Home,
11 '/help/:path?': HelpPage,
11 '/help/:path?': HelpPage,
12− '/:patp?': ShipViewPage,
12+ // '/:patp?': ShipViewPage,
13 '/ship/:patp?': ShipViewPage,
13 '/ship/:patp?': ShipViewPage,
14− '*': Home,
14+ '*': ShipViewPage,
15 }
15 }
16</script>
16</script>
17
17
ui/src/components/EthAddressLink.svelte+9−2
@@ -2,8 +2,13 @@
2 import CopyToClipboard from "svelte-copy-to-clipboard";
2 import CopyToClipboard from "svelte-copy-to-clipboard";
3 import tooltip from "../actions/tooltip";
3 import tooltip from "../actions/tooltip";
4
4
5+ let overrideText = null;
6+
5 const handleSuccessfullyCopied = (e) => {
7 const handleSuccessfullyCopied = (e) => {
6− // alert(`successfully copied to clipboard! ${e}`);
8+ overrideText = 'Copied!';
9+ setTimeout(() => {
10+ overrideText = null;
11+ }, 2000);
7 }
12 }
8
13
9 const handleFailedCopy = () => {
14 const handleFailedCopy = () => {
@@ -17,7 +22,9 @@
17
22
18{#if address}
23{#if address}
19 <span use:tooltip={address}>
24 <span use:tooltip={address}>
20− <a href={`https://etherscan.io/address/${address}`} target="_blank">{abbrevAddress}</a>
25+ <a href={`https://etherscan.io/address/${address}`} target="_blank">
26+ {overrideText || abbrevAddress}
27+ </a>
21
28
22 <CopyToClipboard text={address} on:copy={handleSuccessfullyCopied} on:fail={handleFailedCopy} let:copy>
29 <CopyToClipboard text={address} on:copy={handleSuccessfullyCopied} on:fail={handleFailedCopy} let:copy>
23 <button on:click={copy} class="ml-1 text-3xl align-sub leading-4">⎘</button>
30 <button on:click={copy} class="ml-1 text-3xl align-sub leading-4">⎘</button>
ui/src/components/HomeScreenTiles.sveltenew file+33
@@ -0,0 +1,33 @@
1+<script lang="ts">
2+ import { createEventDispatcher } from 'svelte';
3+ import DocLink from './docs/DocLink.svelte';
4+
5+ const dispatch = createEventDispatcher();
6+ function navigate(path) {
7+ dispatch('navigate', path);
8+ }
9+
10+ function convertLinks(html: string): string {
11+ let converted = html;
12+ const externalLinkRegex = /href="http/g;
13+ converted = converted.replace(externalLinkRegex, 'target="_blank" href="http');
14+ return converted;
15+ }
16+</script>
17+
18+<div class="pt-10 max-w-md w-full flex flex-wrap gap-5 justify-center">
19+ <div class="rounded-lg bg-white flex-grow max-w-xs">
20+ <DocLink modal path="">
21+ <div class="p-5 text-xl text-center">
22+ Help Docs
23+ </div>
24+ </DocLink>
25+ </div>
26+ <!-- <div class="rounded-lg bg-white flex-grow max-w-xs">
27+ <DocLink modal path="">
28+ <div class="p-5 text-xl text-center">
29+ Help Docs
30+ </div>
31+ </DocLink>
32+ </div> -->
33+</div>
ui/src/components/SearchBar.svelte+10−1
@@ -7,13 +7,14 @@
7 export let searchQuery: RegExp = /~der/;
7 export let searchQuery: RegExp = /~der/;
8 export let analysis: SearchAnalysis = new SearchAnalysis();
8 export let analysis: SearchAnalysis = new SearchAnalysis();
9 export let search = '';
9 export let search = '';
10+ let debouncedSearch = search;
10
11
11 // const placeholderText = "Enter a @p or non-negative integer. '*' is wildcard.";
12 // const placeholderText = "Enter a @p or non-negative integer. '*' is wildcard.";
12 const placeholderText = "Enter a @p or non-negative integer";
13 const placeholderText = "Enter a @p or non-negative integer";
13
14
14 $: {
15 $: {
15 // analysis.search = search;
16 // analysis.search = search;
16− analysis = new SearchAnalysis(search);
17+ analysis = new SearchAnalysis(debouncedSearch);
17 if (analysis.queryIsValid) {
18 if (analysis.queryIsValid) {
18 searchQuery = analysis.query;
19 searchQuery = analysis.query;
19 } else {
20 } else {
@@ -25,6 +26,14 @@
25 patp = undefined;
26 patp = undefined;
26 }
27 }
27 }
28 }
29+
30+ let timer;
31+ $: {
32+ clearTimeout(timer);
33+ timer = setTimeout(() => {
34+ debouncedSearch = search;
35+ }, 300);
36+ }
28</script>
37</script>
29
38
30<!-- <div class="flex justify-center"> -->
39<!-- <div class="flex justify-center"> -->
ui/src/components/ShipListing.svelte+1−1
@@ -16,7 +16,7 @@
16 }
16 }
17</script>
17</script>
18
18
19−<div class="flex flex-wrap p-4 border-b last:border-none items-center"
19+<div class="flex flex-wrap p-4 border-b last:border-none items-center hover:bg-gray-300 cursor-pointer"
20 on:click={handleClick}
20 on:click={handleClick}
21 on:click
21 on:click
22 >
22 >
ui/src/components/ShipView.svelte+39−37
@@ -17,10 +17,10 @@
17
17
18 let parentChain: any[];
18 let parentChain: any[];
19 let rawPointInfoPromise: any;
19 let rawPointInfoPromise: any;
20− let rawPointInfo: any = {};
20+ let rawPointInfo: any = null;
21 let pointInfo: any = {};
21 let pointInfo: any = {};
22 let rawSpawnedPointsPromise: any;
22 let rawSpawnedPointsPromise: any;
23− let rawSpawnedPoints: any = {};
23+ let rawSpawnedPoints: any = null;
24 let spawnedPoints: string[] = [];
24 let spawnedPoints: string[] = [];
25 const api: UrbitApi = new UrbitApi('');
25 const api: UrbitApi = new UrbitApi('');
26 const spawnStatusOptions = {
26 const spawnStatusOptions = {
@@ -80,31 +80,31 @@
80 parentChain = parents;
80 parentChain = parents;
81 }
81 }
82 $: {
82 $: {
83− rawPointInfo = {};
83+ rawPointInfo = null;
84 if (azPoint) {
84 if (azPoint) {
85 rawPointInfoPromise = api.scry<any>({ app: 'astrolabe', path: `/point/${patp}` });
85 rawPointInfoPromise = api.scry<any>({ app: 'astrolabe', path: `/point/${patp}` });
86 rawPointInfoPromise.then((info) => {
86 rawPointInfoPromise.then((info) => {
87 rawPointInfo = info;
87 rawPointInfo = info;
88 }).catch((error) => {
88 }).catch((error) => {
89− rawPointInfo.error = error;
89+ rawPointInfo = { error };
90 });
90 });
91 }
91 }
92 }
92 }
93 $: {
93 $: {
94− rawSpawnedPoints = {};
94+ rawSpawnedPoints = null;
95 if (canSpawnPoints) {
95 if (canSpawnPoints) {
96 rawSpawnedPointsPromise = api.scry<any>({ app: 'astrolabe', path: `/spawned/${patp}` });
96 rawSpawnedPointsPromise = api.scry<any>({ app: 'astrolabe', path: `/spawned/${patp}` });
97 rawSpawnedPointsPromise.then((info) => {
97 rawSpawnedPointsPromise.then((info) => {
98 rawSpawnedPoints = info;
98 rawSpawnedPoints = info;
99 }).catch((error) => {
99 }).catch((error) => {
100− rawSpawnedPoints.error = error;
100+ rawSpawnedPoints = { error };
101 });
101 });
102 }
102 }
103 }
103 }
104 $: {
104 $: {
105 spawnedPoints = [];
105 spawnedPoints = [];
106− if (rawSpawnedPoints.spawned) {
106+ if (rawSpawnedPoints?.spawned) {
107− spawnedPoints = rawSpawnedPoints.spawned.map(patp => normalizeId(patp));
107+ spawnedPoints = rawSpawnedPoints?.spawned.map(patp => normalizeId(patp));
108 }
108 }
109 }
109 }
110 $: {
110 $: {
@@ -117,39 +117,41 @@
117 let keysSet = false;
117 let keysSet = false;
118 if (!azPoint) {
118 if (!azPoint) {
119
119
120− } else if (rawPointInfo.point) {
120+ } else if (rawPointInfo) {
121+ if (rawPointInfo.point) {
121− const { point } = rawPointInfo;
122+ const { point } = rawPointInfo;
122− const {
123+ const {
123− 'probable-dominion': dominion,
124+ 'probable-dominion': dominion,
124− npoint
125+ npoint
125− } = point;
126+ } = point;
126− spawnedCount = point['spa-count'];
127+ spawnedCount = point['spa-count'];
127− life = npoint.net.keys.life;
128+ life = npoint.net.keys.life;
128− rift = npoint.net.rift;
129+ rift = npoint.net.rift;
129− if (life > 0) {
130+ if (life > 0) {
130− keysSet = true;
131+ keysSet = true;
131− }
132+ }
132
133
133− pointInfo.proxies = npoint.own;
134+ pointInfo.proxies = npoint.own;
134− // const { dominion } = npoint;
135+ // const { dominion } = npoint;
135− layer = layerOptions[dominion];
136+ layer = layerOptions[dominion];
136
137
137− if (pointInfo.proxies.owner.address === '0x86cd9cd0992f04231751e3761de45cecea5d1801') {
138+ if (pointInfo.proxies.owner.address === '0x86cd9cd0992f04231751e3761de45cecea5d1801') {
138− spawnStatus = spawnStatusOptions.locked;
139+ spawnStatus = spawnStatusOptions.locked;
139− } else if (keysSet) {
140+ } else if (keysSet) {
140− spawnStatus = spawnStatusOptions.spawned;
141+ spawnStatus = spawnStatusOptions.spawned;
142+ } else {
143+ spawnStatus = spawnStatusOptions.spawnedNoKeys;
144+ }
145+ const { sponsor } = npoint.net;
146+ if (sponsor.has) {
147+ pointInfo.sponsor = normalizeId(sponsor.who);
148+ }
141 } else {
149 } else {
150+ // no info found
142− spawnStatus = spawnStatusOptions.spawnedNoKeys;
151+ spawnStatus = spawnStatusOptions.unspawned;
143− }
152+ life = 0;
144− const { sponsor } = npoint.net;
153+ rift = 0;
145− if (sponsor.has) {
146− pointInfo.sponsor = normalizeId(sponsor.who);
147 }
154 }
148− } else if (rawPointInfo.error) {
149− // no info found
150− spawnStatus = spawnStatusOptions.unspawned;
151− life = 0;
152− rift = 0;
153 } else {
155 } else {
154 // request pending
156 // request pending
155 }
157 }
ui/src/components/TooltipAndDocLink.svelte+1−1
@@ -1,6 +1,6 @@
1<script lang="ts">
1<script lang="ts">
2 import Tooltip from "./Tooltip.svelte";
2 import Tooltip from "./Tooltip.svelte";
3− import DocLink from './docs/DocLink.svelte'; // TODO try to add a link in the tooltip somehow or something, like:
3+ import DocLink from './docs/DocLink.svelte'; // TODO try to add a link in the tooltip somehow or something
4 export let text: string = '';
4 export let text: string = '';
5 export let doc: string = '';
5 export let doc: string = '';
6 let className: string = '';
6 let className: string = '';
ui/src/components/ValidationProblems.svelte+3−1
@@ -1,4 +1,6 @@
1<script lang="ts">
1<script lang="ts">
2+ import DocLink from './docs/DocLink.svelte';
3+
2 export let problems: Array<string> = [];
4 export let problems: Array<string> = [];
3 export let type: string = undefined;
5 export let type: string = undefined;
4</script>
6</script>
@@ -15,7 +17,7 @@
15 {/each}
17 {/each}
16 <p>
18 <p>
17 <!-- TODO: add link to doc -->
19 <!-- TODO: add link to doc -->
18− You can read more here.
20+ You can <DocLink modal path="patpee">read more here.</DocLink>
19 </p>
21 </p>
20</div>
22</div>
21
23
ui/src/components/docs/Doc.svelte+1−1
@@ -19,7 +19,7 @@
19 }
19 }
20</script>
20</script>
21
21
22−<div class=" rounded-lg bg-white">
22+<div class="rounded-lg bg-white">
23 <div class="flex p-4 border-navy">
23 <div class="flex p-4 border-navy">
24 {#if !homePage}
24 {#if !homePage}
25 <Hamburger on:click={() => navigate('')} />
25 <Hamburger on:click={() => navigate('')} />
ui/src/components/docs/DocHome.svelte+3
@@ -67,4 +67,7 @@
67 </DocLink>
67 </DocLink>
68 </li>
68 </li>
69 </ul>
69 </ul>
70+ <DocLink path="astrolabe" on:navigate>
71+ <h2>About Astrolabe</h2>
72+ </DocLink>
70</div>
73</div>
ui/src/lib/link.ts+4−2
@@ -1,3 +1,5 @@
1+import { buildQuerystring } from './utils';
2+
1−export function linkToShip(patp: string): string {
3+export function linkToShip(patp: string, queryParams = {}): string {
2− return `/ship/${patp}`;
4+ return `/ship/${patp}` + buildQuerystring(queryParams);
3}
5}
ui/src/lib/utils.ts+17
@@ -13,8 +13,25 @@ function filterObject(obj, predicate) {
13 return Object.fromEntries(Object.entries(obj).filter(([key, value]) => predicate(key, value)));
13 return Object.fromEntries(Object.entries(obj).filter(([key, value]) => predicate(key, value)));
14}
14}
15
15
16+function buildQuerystring(data) {
17+ if (typeof (data) === 'string') return data;
18+
19+ var query = [];
20+ for (let key in data) {
21+ if (data.hasOwnProperty(key)) {
22+ // Encode each key and value, concatenate them into a string, and push them to the array
23+ query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));
24+ }
25+ }
26+
27+ // Join each item in the array with a `&` and return the resulting string
28+ return query.length ? '?' + query.join('&') : '';
29+
30+}
31+
16export {
32export {
17 isStringNaN,
33 isStringNaN,
18 listStrings,
34 listStrings,
19 filterObject,
35 filterObject,
36+ buildQuerystring,
20};
37};
ui/src/routes/ShipViewPage.svelte+14−6
@@ -1,17 +1,17 @@
1<script lang="ts">
1<script lang="ts">
2− import { link, push } from 'svelte-spa-router'
2+ import { link, push, querystring } from 'svelte-spa-router'
3 import docs from '../stores/docs';
3 import docs from '../stores/docs';
4 import { SearchAnalysis } from '../lib/id';
4 import { SearchAnalysis } from '../lib/id';
5 import { linkToShip } from '../lib/link';
5 import { linkToShip } from '../lib/link';
6 import SearchBar from "../components/SearchBar.svelte";
6 import SearchBar from "../components/SearchBar.svelte";
7 import ShipView from '../components/ShipView.svelte';
7 import ShipView from '../components/ShipView.svelte';
8 import ValidationProblems from '../components/ValidationProblems.svelte';
8 import ValidationProblems from '../components/ValidationProblems.svelte';
9− import DocLink from '../components/docs/DocLink.svelte';
9+ import HomeScreenTiles from '../components/HomeScreenTiles.svelte';
10 export let params: any = {};
10 export let params: any = {};
11− let patp: string;
12 let analysis: SearchAnalysis = new SearchAnalysis();
11 let analysis: SearchAnalysis = new SearchAnalysis();
13
12
13+ const searchParams = new URLSearchParams($querystring);
14− let search: string = params.patp || '';
14+ let search: string = searchParams.get('search') || params.patp || '';
15 $: paramChanged = params.patp && Date.now();
15 $: paramChanged = params.patp && Date.now();
16 $: analysisPatpChanged = analysis.patp && Date.now();
16 $: analysisPatpChanged = analysis.patp && Date.now();
17 $: paramChangedMoreRecently = (paramChanged - analysisPatpChanged) > 1000;
17 $: paramChangedMoreRecently = (paramChanged - analysisPatpChanged) > 1000;
@@ -24,21 +24,29 @@
24 search = params.patp;
24 search = params.patp;
25 } else {
25 } else {
26 if (analysis.patpIsValid && analysis.search === search) {
26 if (analysis.patpIsValid && analysis.search === search) {
27+ if (analysis.patp === search) {
28+ push(linkToShip(analysis.patp));
29+ } else {
27− push(linkToShip(analysis.patp));
30+ push(linkToShip(analysis.patp, { search }));
31+ }
28 }
32 }
29 }
33 }
30 }
34 }
31 // if ()
35 // if ()
32 }
36 }
37+
33</script>
38</script>
34
39
35<div class="m-4 flex flex-col items-center space-y-8 2xs:m-8">
40<div class="m-4 flex flex-col items-center space-y-8 2xs:m-8">
41+ <!-- {@debug analysis, search, params} -->
36 <!-- <a use:link={"/"} class="p-4 bg-white rounded-lg text-center">Go Home</a> -->
42 <!-- <a use:link={"/"} class="p-4 bg-white rounded-lg text-center">Go Home</a> -->
37 <!-- <SearchBar bind:searchText={search} bind:analysis /> -->
43 <!-- <SearchBar bind:searchText={search} bind:analysis /> -->
38 <SearchBar bind:analysis bind:search />
44 <SearchBar bind:analysis bind:search />
39 {#if analysis.patpIsValid}
45 {#if analysis.patpIsValid}
40 <ShipView patp={analysis.patp} />
46 <ShipView patp={analysis.patp} />
41− {:else if (search.length > 0)}
47+ {:else if (analysis.search.length > 0)}
42 <ValidationProblems problems={analysis.patpProblems} />
48 <ValidationProblems problems={analysis.patpProblems} />
49+ {:else}
50+ <HomeScreenTiles />
43 {/if}
51 {/if}
44</div>
52</div>
ui/src/styles/tailwind-output.css+26
@@ -488,6 +488,10 @@ Ensure the default browser behavior of the `hidden` attribute.
488 margin-top: 0.5rem;
488 margin-top: 0.5rem;
489 margin-bottom: 0.5rem;
489 margin-bottom: 0.5rem;
490}
490}
491+.my-5 {
492+ margin-top: 1.25rem;
493+ margin-bottom: 1.25rem;
494+}
491.mt-2 {
495.mt-2 {
492 margin-top: 0.5rem;
496 margin-top: 0.5rem;
493}
497}
@@ -536,6 +540,12 @@ Ensure the default browser behavior of the `hidden` attribute.
536.-mt-0\.5 {
540.-mt-0\.5 {
537 margin-top: -0.125rem;
541 margin-top: -0.125rem;
538}
542}
543+.mt-10 {
544+ margin-top: 2.5rem;
545+}
546+.mt-20 {
547+ margin-top: 5rem;
548+}
539.block {
549.block {
540 display: block;
550 display: block;
541}
551}
@@ -620,6 +630,9 @@ Ensure the default browser behavior of the `hidden` attribute.
620.max-w-2xl {
630.max-w-2xl {
621 max-width: 42rem;
631 max-width: 42rem;
622}
632}
633+.max-w-xs {
634+ max-width: 20rem;
635+}
623.flex-shrink-0 {
636.flex-shrink-0 {
624 flex-shrink: 0;
637 flex-shrink: 0;
625}
638}
@@ -679,6 +692,9 @@ Ensure the default browser behavior of the `hidden` attribute.
679.gap-1 {
692.gap-1 {
680 gap: 0.25rem;
693 gap: 0.25rem;
681}
694}
695+.gap-5 {
696+ gap: 1.25rem;
697+}
682.space-y-4 > :not([hidden]) ~ :not([hidden]) {
698.space-y-4 > :not([hidden]) ~ :not([hidden]) {
683 --tw-space-y-reverse: 0;
699 --tw-space-y-reverse: 0;
684 margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
700 margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
@@ -911,6 +927,12 @@ Ensure the default browser behavior of the `hidden` attribute.
911.pl-5 {
927.pl-5 {
912 padding-left: 1.25rem;
928 padding-left: 1.25rem;
913}
929}
930+.pt-20 {
931+ padding-top: 5rem;
932+}
933+.pt-10 {
934+ padding-top: 2.5rem;
935+}
914.text-center {
936.text-center {
915 text-align: center;
937 text-align: center;
916}
938}
@@ -1042,6 +1064,10 @@ Ensure the default browser behavior of the `hidden` attribute.
1042.last\:border-none:last-child {
1064.last\:border-none:last-child {
1043 border-style: none;
1065 border-style: none;
1044}
1066}
1067+.hover\:bg-gray-300:hover {
1068+ --tw-bg-opacity: 1;
1069+ background-color: rgb(209 213 219 / var(--tw-bg-opacity));
1070+}
1045.hover\:opacity-40:hover {
1071.hover\:opacity-40:hover {
1046 opacity: 0.4;
1072 opacity: 0.4;
1047}
1073}