diff --git a/.changeset/sharp-signs-exist.md b/.changeset/sharp-signs-exist.md new file mode 100644 index 0000000..594cb0f --- /dev/null +++ b/.changeset/sharp-signs-exist.md @@ -0,0 +1,5 @@ +--- +'intrepid-ibex': minor +--- + +applications menu & mobile responsiveness improvements diff --git a/README.md b/README.md index e17d0a5..19f4cb4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,11 @@ info such as AT URI, CID, raw PDS link, and external links. A media viewer for repo blobs and record-attached media. It is used when Nautilus finds image or media blob references in a selected record. +### Web Browser + +A GNOME-style Lexicon schema browser. It resolves NSIDs through lexdns, shows +readable schema definitions, raw Lexicon JSON, and the DNS/PDS resolution trace. + ### Identity Inspector A public identity window for DID documents, aliases, services, verification diff --git a/src/lib/components/GnomeMenuBar.svelte b/src/lib/components/GnomeMenuBar.svelte index bfec31b..cf257a4 100644 --- a/src/lib/components/GnomeMenuBar.svelte +++ b/src/lib/components/GnomeMenuBar.svelte @@ -4,12 +4,15 @@ import { repoSession } from '$lib/atproto/session.svelte'; import { accountSetup } from '$lib/atproto/setup.svelte'; import { repoBrowser } from '$lib/atproto/repo.svelte'; - import { collectionPath } from '$lib/atproto/routes'; + import { blobsPath, collectionPath, identityPath } from '$lib/atproto/routes'; + import { REPO_URL } from '$lib/constants'; + import { desktopLaunchers, type DesktopLauncherId } from '$lib/launcher'; import { desktopSession } from '$lib/desktop-session.svelte'; import { windowManager } from '$lib/window-manager.svelte'; import GnomeTray from '$lib/components/GnomeTray.svelte'; type RepoPathname = `/repos/${string}`; + type AppPathname = '/' | '/browse' | '/docs' | '/lexicons' | RepoPathname; const navigateTo = goto as (url: string, options?: Parameters[1]) => ReturnType; function changeAccount() { @@ -26,13 +29,91 @@ void navigateTo(resolve(collectionPath({ did: identity.did, collection: collectionName }) as RepoPathname)); } + + function openPath(path: AppPathname) { + void navigateTo(resolve(path), { keepFocus: true, noScroll: true }); + } + + function openIdentityInspector() { + const identity = repoSession.identity ?? accountSetup.identity; + if (!identity) { + openPath('/browse'); + return; + } + + openPath(identityPath(identity.did) as RepoPathname); + } + + function openImageViewer() { + const identity = repoSession.identity ?? accountSetup.identity; + if (!identity) { + openPath('/browse'); + return; + } + + openPath(blobsPath(identity.did) as RepoPathname); + } + + function openAboutComputer() { + windowManager.open('about-computer'); + } + + function openLauncher(id: DesktopLauncherId) { + if (id === 'home') { + openPath('/'); + return; + } + + if (id === 'collections') { + openPath('/browse'); + return; + } + + if (id === 'identity-inspector') { + openIdentityInspector(); + return; + } + + if (id === 'image-viewer') { + openImageViewer(); + return; + } + + if (id === 'web-browser') { + openPath('/lexicons'); + return; + } + + if (id === 'about-computer') { + openAboutComputer(); + return; + } + + if (id === 'document-viewer') { + openPath('/docs'); + return; + } + + window.open(REPO_URL, '_blank', 'noopener,noreferrer'); + }