From 77775b432ae29efbf9d71e67ca26d52fc2ebe528 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Fri, 13 Nov 2026 22:33:28 +0100 Subject: [PATCH] Unify browsing and make listening and download actions explicit --- CONTRIBUTING.md | 11 +- README.md | 12 +- src/_album.svelte | 29 +- src/_artist.svelte | 23 +- src/_connect.svelte | 156 ++++ src/_downloads.svelte | 109 ++- src/_library.svelte | 300 +------- src/_search.svelte | 211 +++--- src/_settings.svelte | 475 ++++--------- src/app.svelte | 37 +- src/cache.svelte.ts | 23 + src/playback.svelte.ts | 33 +- src/router.svelte | 4 +- src/session.svelte.ts | 19 +- src/ui/player.svelte | 77 +- tests/album-page.test.ts | 60 +- tests/app-cache.test.ts | 39 +- tests/app-settings.test.ts | 100 +-- tests/artist-page.test.ts | 27 +- tests/browser/downloads.test.cjs | 10 +- tests/browser/library.test.cjs | 24 +- tests/browser/navigation.test.cjs | 17 +- tests/browser/queue.test.cjs | 1 + tests/browser/search.test.cjs | 10 +- tests/browser/settings.test.cjs | 831 +++++++++------------- tests/browser/startup.test.cjs | 10 +- tests/browser/website-cascade.test.cjs | 2 +- tests/downloads-page.test.ts | 73 +- tests/mixed-download-availability.test.ts | 2 +- tests/playback.test.ts | 72 +- tests/player-exchange.test.ts | 34 +- tests/search-filters.test.ts | 9 +- tests/search-page.test.ts | 37 +- tests/search.test.ts | 10 +- tests/session-library.test.ts | 9 +- tests/session-login.test.ts | 50 +- tests/session.test.ts | 6 +- website/demo.test.ts | 6 +- 38 files changed, 1497 insertions(+), 1461 deletions(-) create mode 100644 src/_connect.svelte diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8467a21..a254727 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ Routes use the bare query, for example `/webapp/?/library/artist/123#section`. E - Read Cache collections directly; change them through explicit methods. Session owns account details; Cache accepts an opaque account key and hashes it for storage. An undefined key creates an empty, non-persisting fallback. A defined key does not mean hydration succeeded. - Library, queue, playlist, and image memory updates checkpoint asynchronously. Downloads instead await explicit queued/failed/completed commits in one versioned store; failed jobs require explicit Retry or a bulk Download action. Interrupted queued jobs restart from scratch, never adopting unregistered bytes. Successful byte close wins cancellation while completed metadata commits; cancellation joins that work. Unknown queued/failed job fields, including old attempts, are ignored on load and omitted on subsequent writes; orphan-file reclamation after old attempts or abrupt termination is intentionally out of scope. Work offline disables all server domains and pauses queued downloads, retaining durable intent. One Network-owned connection serves every domain; reconnect resumes queued, never failed jobs. All music/Downloaded is a separate browsing preference and never filters or rewrites the queue. Cached playback may continue offline; remote playback stops. Do not treat visible state as proof of persistence. Unreadable download documents are preserved, not reset; readable saved files remain usable. -- Credentials use localStorage only, until disconnect. Token login stores username/token/salt; verified direct-password fallback stores the actual password. localStorage is not encrypted and is readable by same-origin scripts. Never log credentials or credential-bearing URLs. Legacy token records migrate without changing account keys; migration writeback is best-effort. +- New connections default to memory-only credentials. `Session.connect(input, remember)` persists verified credentials only after workspace acceptance when explicitly opted in; credential-free identity persists separately so reload opens local data offline. Existing persisted credentials remain recognized until disconnect/explicit opt-out; do not silently remove legacy records. Token persistence stores username/token/salt; verified direct-password fallback stores the actual password. localStorage is not encrypted and is readable by same-origin scripts. Never log credentials or credential-bearing URLs. Legacy token records migrate without changing account keys; migration writeback is best-effort. Keep injected demo `AuthStore(new MemoryStorage())` supported. Remember is an app persistence choice, not browser autofill policy. - Session acquires an exclusive Web Lock with `ifAvailable`, named from the same SHA-256 account identity as OPFS, before hydration or authenticated producers. Only one tab activates a persistent account; another is blocked, not a read-only replica. Retry is explicit after closing the owner; there is no polling/takeover. Missing Web Locks blocks activation honestly. Browser document termination releases its lock; it does not guarantee the last in-memory edit survived a crash. - Disconnect retains local data and ownership for offline use. Same-account reconnects reuse the live cache and lease to preserve edits. Different-account preparation acquires its lease first; failures retain the original workspace. Account changes stop producers and drain old writes before releasing ownership. Disposal stops producers, checkpoints globally and cancels/drains disk operations before releasing. Deletion retains ownership even on failure. Late results must not leak into a different account. - `Cache.flushQueue()` checkpoints only the queue document, independent of other domains’ pending/failing checkpoints. Playback progress, pause, visibility and explicit queue commands use it. Global `flush()` remains for workspace retirement/disposal. These guarantees apply to Session-owned persistent workspaces; direct Cache construction in focused storage fixtures does not acquire a lease. @@ -75,8 +75,9 @@ Library normalization uses structured `artists`, `displayArtist`, and `genres`, - Use semantic color/type roles and spacing/shape primitives. Containers own gaps and padding. Avoid global element resets and additional token aliases or configuration layers without a concrete consumer. - `src/ui/` contains shared presentation. Artwork delegates acquisition and object-URL ownership to Covers. Atmosphere uses CSS scroll timelines with static fallbacks for unsupported browsers and reduced motion; don't add scroll handlers for decoration. - The app scrolls the document with native page overscroll. Container queries adapt navigation and split layouts without remounting playback. Now Playing is a fullscreen native dialog with its own scrolling. Modal dialogs/backdrops suppress scroll chaining and boundary bounce without changing document overflow. -- Preserve offline filtering, ordered playback, and action scope. Library batches remain lazy. Downloads show real jobs and saved records, not invented progress. Queue rows use original occurrence indexes. -- Keep native validation, keyboard focus, actual error messages, and guarded busy actions. Never expose credentials. A completed connection must not redirect after the user leaves Settings. Update state is shared between sidebar and drawer. +- Library reuses the committed search implementation, including multi-select URL criteria and lazy batches; `/search` is an alias, not a second browse model. Routine Library arrival focuses its heading; explicit search anchors focus the input, and criteria updates preserve focus. Preserve independent downloaded filtering and ordered collection scope. Track Play now replaces with only that track; collection Play now replaces with its scope. Play next inserts after selection; Add to queue appends; neither autoplays inactive queues. Queue removal uses original occurrence indexes, stops selected removal without advancing, and focuses next/previous removal or the heading. +- Downloads show actual jobs and registered completed audio-byte totals (not origin usage). Completed-format removal commits the catalog before reclaiming bytes, preserves failures honestly, and stops/unloads an active cached source without changing queue membership. Bulk removal confirms account scope and excludes pending jobs; cancellation remains separate. +- Keep native validation, keyboard focus, actual error messages, and guarded busy actions. Never expose credentials. A completed connection must not redirect after the user leaves the focused Connect screen. Update state is shared between sidebar and drawer. - Prefer native `commandfor`/`command` invokers for dialogs and popovers. Use imperative APIs only for behavior that cannot be expressed declaratively. Popovers already have implicit invoker anchors. Preserve long-press and swipe dismissal; don't dismiss overlays on resize. - Store UI icons in `src/sprite.svg` and render through typed `Icon`; keep its name union synchronized. Use `currentColor` and accessible labels for icon-only controls. The build injects the sprite into HTML, not JavaScript. - Self-hosted fonts and their license live in `src/fonts/`; preserve optional loading and system fallbacks. Keep font preloads aligned with the faces each entry point uses. @@ -101,11 +102,11 @@ Select suites for the behavior being changed: | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `edgerunner.test.cjs` | Shared styles, fonts, native controls, overlays, and reduced motion | | `navigation.test.cjs` | Document scrolling, shell, playback, query routes, anchors, and optional offline navigation | -| `startup.test.cjs` | Initial Settings route, reloads, and subsequent animated navigation | +| `startup.test.cjs` | Initial Connect route, reloads, and subsequent animated navigation | | `pwa-updates.test.cjs` | Self-hosted production builds: real worker installation, per-tab consent, repeated discovery, offline application, failed precache, and optional old-plugin migration | | `library.test.cjs`, `search.test.cjs` | Browsing, actions, responsive layouts, and native dismissal | | `queue.test.cjs` | Explicit load/save, zero automatic queue requests, empty navigation, native confirmation focus/Escape, sanitized failures, duplicates and 320px reflow (optional `ARTIFACT_DIR` for screenshots) | -| `downloads.test.cjs`, `settings.test.cjs` | Actual app/OPFS behavior with intercepted Subsonic requests | +| `downloads.test.cjs`, `settings.test.cjs` | Actual app/OPFS behavior with intercepted Subsonic requests; focused connection, memory/remembered reload, queue removal focus, saved-byte removal and confirmation | | `atmosphere.test.cjs` | Document/dialog scroll timelines; self-contained, no server required | | `website-cascade.test.cjs` | Script-free landing layout, keyboard/FAQ behavior, and standalone demo journeys | | `design-improvements.test.cjs` | Compact details, full-height player, queue anchors, confirmation, gradients, popover timing, titles, and demo guidance (website server) | diff --git a/README.md b/README.md index 1dc1a2b..d9c4f33 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Libras is a browser-based minimalistic music player that connects to your own mu ## Features -- Browse artists, albums, and tracks. +- Browse and search artists, albums, and tracks together in Library, with shareable multi-select type filters. Older Search links keep their criteria. - Stream music from your own server. - Download music for offline playback and manage it in Settings → Downloads. - Restore this device’s playback queue and position between sessions, without autoplay. @@ -23,7 +23,9 @@ Libras is a browser-based minimalistic music player that connects to your own mu 1. Open [Libras](https://libras-music.app/webapp/). 2. Connect to your music server with your server address, username, and password. -3. Browse your library and start listening. +3. Browse or search Library and start listening. Settings links back to the focused connection screen for sign-in. + +**Play now** replaces the queue with that track only, or the chosen collection in its current scope. **Play next** inserts after the selected occurrence; **Add to queue** appends. Neither starts an inactive queue. Queue removal preserves other occurrences (including duplicates and unavailable tracks); removing the selected occurrence stops playback without choosing a replacement. Just trying it out? Connect to the [Navidrome demo server](https://demo.navidrome.org/) using `https://demo.navidrome.org` as the server address and `demo` as both the username and password. @@ -37,7 +39,9 @@ Safari 26.0 or newer is required; older Safari versions are not supported. The a Libras tries salted token authentication first; your password stays in the browser for that attempt. Only a structured server rejection of token authentication (Subsonic code 41 or 42) automatically retries the same username and password over HTTPS, including on localhost. Invalid credentials, connection failures, and other errors never trigger a password retry. -Credentials persist in **localStorage** until you disconnect. Token login saves the username, token, and salt, not your password. Successfully verified direct-password login saves the actual password and sends it with subsequent requests, including artwork and streaming URLs. HTTPS encrypts transport, not localStorage; scripts running on the app's origin and anyone with access to your browser profile can read saved credentials. Use a trusted device and server, and disconnect on shared devices. Disconnect removes credentials but retains your offline account, music, and queue. +New connections keep credentials **in memory only** by default. Reloading retains your credential-free offline identity, music, and queue, but requires signing in again for server access. Select **Remember this device** only on a trusted device to save verified credentials in localStorage after the account workspace is accepted. Existing remembered credentials remain recognized until you disconnect or explicitly opt out; they are not silently deleted on startup. This choice controls Libras storage, not your browser’s password manager. + +Remembered token login saves username/token/salt, not your password. Verified direct-password fallback saves the actual password and sends it with subsequent requests, including artwork and streaming URLs. HTTPS encrypts transport, not localStorage; same-origin scripts and anyone with access to your browser profile can read saved credentials. Disconnect removes credentials but retains offline identity/data unless you also choose local deletion. ## Install @@ -55,7 +59,7 @@ Download music while connected, then choose **Work offline** in navigation or Se **Library scope → All music / Downloaded** is independent of the connection. Downloaded filters browsing and search without disconnecting or changing your queue, position or active audio. All music can browse saved metadata offline; uncached tracks remain visible as unavailable. -- **Manage downloads:** Settings → Downloads. +- **Manage downloads:** Downloads in navigation (also linked from Settings). Totals count registered completed audio bytes, not total browser storage. Remove individual formats, or confirm **Remove all downloaded music** for this account. Queue membership and server files stay unchanged; pending jobs use the separate Cancel downloads action. Removing an active cached source stops/unloads it. Catalog deletion must succeed before bytes are reclaimed; failures remain visible for retry. - **Refresh library:** Automatic when opening online, or via Settings → Refresh library. - **Disconnect:** Clears credentials and optionally deletes this account’s local cache and downloads. Remembered identity, preferences, other accounts and server data are unchanged. Only one tab can open an account’s local data at a time, including while deleting it. A second tab is blocked: close the owning tab, then select **Retry**. There is no automatic takeover or live cross-tab queue replication. - **Storage:** Each server/account has its own offline library, saved only in this browser on this device. **Clearing site data deletes it.** diff --git a/src/_album.svelte b/src/_album.svelte index d6ce476..c4a198b 100644 --- a/src/_album.svelte +++ b/src/_album.svelte @@ -44,9 +44,6 @@ const albumPlaybackState = $derived( album && currentTrack?.albumId === album.id ? playbackState : undefined, ); - const albumCanPause = $derived( - albumPlaybackState === "playing" || albumPlaybackState === "loading", - ); const artist = $derived(album ? cache.artists.get(album.artistIds[0]) : undefined); const atmosphere = $derived(album?.artworkId ? covers.ensureCover(album.artworkId) : undefined); const visibleTracks = $derived( @@ -61,7 +58,7 @@ const visibleTrackIds = $derived(visibleTracks.map((track) => track.id)); function playTrack(track: Immutable) { - void playback.replaceQueueAndPlay(visibleTrackIds, visibleTrackIds.indexOf(track.id)); + void playback.replaceQueueAndPlay([track.id]); } let menuTrackId = $state(); @@ -88,6 +85,7 @@ +{#if playback.queueMessage}

{playback.queueMessage}

{/if}
{#if libraryAvailable && artist && album}
@@ -104,18 +102,16 @@ + {:else if session.auth} +

+ {session.offlineMode ? "Working offline" : "Connected"} · {session.auth.username}@{new URL( + session.auth.host, + ).host} +

+ + Account settings + {:else} +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+

+ Keep sign-in credentials in this browser after closing it. Use only on a trusted device. +

+

+ Without remembering, you’ll need to sign in again after reloading. Downloaded music stays on + this device. +

+ {#if session.libraryProgress}

+ {session.libraryProgress.albums.toLocaleString()} albums · {session.libraryProgress.tracks.toLocaleString()} + tracks +

{/if} + {#if session.error}

+ {session.error} +

{/if} +
+ + {#if session.busy}{/if} +
+
+ {/if} + Open library +
diff --git a/src/_downloads.svelte b/src/_downloads.svelte index 6919cf3..f40799e 100644 --- a/src/_downloads.svelte +++ b/src/_downloads.svelte @@ -5,16 +5,49 @@ import type { Cache } from "./cache.svelte"; import type { Covers } from "./covers.svelte"; import type { TrackEngine } from "./track.svelte"; + import type { Playback } from "./playback.svelte"; interface Props { cache: Cache; covers: Covers; trackEngine: TrackEngine; loading: boolean; + playback: Playback; appName?: string; } - let { cache, covers, trackEngine, loading, appName = "Libras" }: Props = $props(); + let { cache, covers, trackEngine, playback, loading, appName = "Libras" }: Props = $props(); + let removing = $state(false); + let removalMessage = $state(""); + const completed = $derived( + [...cache.downloads].filter(([, entry]) => entry.status === "completed"), + ); + const savedBytes = $derived( + completed.reduce((sum, [, entry]) => sum + (entry.status === "completed" ? entry.size : 0), 0), + ); + async function remove(keys: string[]) { + if (removing || loading) return; + removing = true; + removalMessage = ""; + const workspace = cache; + playback.unloadDownloadedTrack( + new Set( + keys.flatMap((key) => { + const entry = workspace.downloads.get(key); + return entry ? [entry.track.id] : []; + }), + ), + ); + try { + await workspace.removeDownloads(keys); + if (workspace === cache) removalMessage = "Downloaded music removed. Queue unchanged."; + } catch { + if (workspace === cache) + removalMessage = "Could not remove downloaded music. Please try again."; + } finally { + removing = false; + } + } const canceling = $derived(trackEngine.cancelingDownloads); const failed = $derived( @@ -27,7 +60,7 @@ for (const entry of cache.downloads.values()) { if (entry.status === "completed") { downloaded.add(entry.track.id); - } else { + } else if (entry.status === "queued") { pending.add(entry.track.id); } } @@ -47,7 +80,7 @@ } async function cancelAll() { - if (loading || canceling || !counts.pending) return; + if (loading || canceling || (!counts.pending && !failed.length)) return; try { await trackEngine.cancelDownloads(); } catch { @@ -85,8 +118,12 @@

Downloads

{counts.downloaded} - {counts.downloaded === 1 ? "track" : "tracks"} available for offline listening, {counts.pending} - pending + {counts.downloaded === 1 ? "track" : "tracks"} downloaded · {sizeFormatter.format( + savedBytes / 1_000_000, + )} downloaded audio +

+

+ {counts.pending} pending · {failed.length} failed

{#if trackEngine.waitingForConnection && trackEngine.downloadCount}

Paused while working offline

@@ -96,17 +133,27 @@ class="button" data-variant="secondary" data-size="text" - disabled={loading || canceling || !failed.length} + disabled={loading || removing || canceling || !failed.length} onclick={retryAll}>Retry all + + {#if removalMessage}

{removalMessage}

{/if} {#if cache.reportingError} @@ -158,7 +205,7 @@ data-variant="secondary" data-size="text" aria-label={`Retry download of ${entry.track.title} (${entry.format.toUpperCase()})`} - disabled={loading || canceling} + disabled={loading || removing || canceling} onclick={() => { void trackEngine.download(entry.track.id, { format: entry.format }); }}>Retry + {/if} @@ -191,3 +247,40 @@ {/if} + + +
+

Remove all downloaded music?

+

+ Remove {counts.downloaded} + {counts.downloaded === 1 ? "track" : "tracks"} · {sizeFormatter.format( + savedBytes / 1_000_000, + )} downloaded audio from this account on this device. Queue membership and server files stay unchanged. + Pending downloads are not removed; use Cancel downloads separately. +

+
+ + +
+
+
diff --git a/src/_library.svelte b/src/_library.svelte index 823a483..372b05c 100644 --- a/src/_library.svelte +++ b/src/_library.svelte @@ -1,299 +1,7 @@ -Your library | {appName} - -
-

Your library

- - {#if session.loadingAfterConnect} -
- -

Loading your library…

- -
- {:else if libraryAvailable} -
- {#if libraryError} -
-

Library needs attention

-

- {libraryError} -

-

Available music is still listed below.

- -
- {/if} -
-

Artists

- -
- {#if visibleArtists.length > 0} -
- {#each artistPage as artist (artist.id)} - - {/each} -
- {#if artistPage.length < visibleArtists.length} - {#key artistLimit} - - - {/key} - {/if} - {:else if !loading} -
-

- {offlineMode ? "No downloaded music." : "No artists found."} -

-

- {offlineMode - ? "Download music from the library to listen offline." - : "Your server's artists will appear here after synchronization."} -

-
- {/if} -
- {:else if !loading} -
-

- {libraryError ? "Library unavailable" : "Connect your library"} -

-

- {libraryError || "Add your music server to start listening."} -

-
- {#if libraryError && session.auth && !session.offlineMode} - - {/if} - Open settings -
-
- {/if} -
- - - - {@render artistActions("artist-menu", false)} - - - - -{#snippet artistActions(id: string, popover: boolean)} -
-
-
- -

{menuArtist?.name}

-
- -
-
- - - - -
-
-{/snippet} - - + diff --git a/src/_search.svelte b/src/_search.svelte index 07d28cf..0e3625c 100644 --- a/src/_search.svelte +++ b/src/_search.svelte @@ -20,7 +20,7 @@ for (const type of searchTypes) if (types.includes(type)) parameters.append("type", type); if (query) parameters.set("q", query); const suffix = parameters.toString(); - return `?/search${suffix ? `&${suffix}` : ""}`; + return `?/library${suffix ? `&${suffix}` : ""}`; } const searchGroups = ["Artists", "Albums", "Tracks"] as const; @@ -142,6 +142,14 @@ -Search | {appName} +Library | {appName} -
+
+

Library

-

Search

-
@@ -358,6 +361,7 @@ {/each}
+ {#if playback.queueMessage}

{playback.queueMessage}

{/if} {#if libraryError}

Library needs attention

@@ -371,7 +375,15 @@
{/if}
- {#if !session.localReady && index.size === 0} + {#if session.loadingAfterConnect} +
+ +

Loading your library…

+ +
+ {:else if !session.localReady && index.size === 0}

Loading your library…

@@ -418,78 +430,112 @@

{group}

- +
-
+
{#each records as record (record.id)} - {@const track = group === "Tracks" ? cache.tracks.get(record.id) : undefined} -
+
+

Connection

+ {#if session.auth} + + {:else}Connect{/if} +

+ {session.offlineMode + ? "Server access is off. Requested downloads are paused." + : "Server access is on. Choose Downloaded in Library scope to browse saved music without disconnecting."} +

+ View downloads +
+
+ {@render children?.()} +
{@render disconnectConfirmation("disconnect-dialog")} - - {#snippet disconnectConfirmation(id: string)} -
+

Disconnect from server

Would you also like to clear this account’s data and downloads from this device? Server data @@ -119,22 +197,21 @@

- + />
Cancel {/snippet} - -
-
-

Settings

- -
-
-

Music server

-
-

- - {#if connectionLoading} - - {:else} - - {/if} - - {#if connectionLoading && session.libraryProgress} - - {session.libraryProgress.albums.toLocaleString()} albums · {session.libraryProgress.tracks.toLocaleString()} - tracks - - {:else} - - - {connectionLabel} - {#if session.auth && !connectionLoading} - · - {/if} - - {#if session.auth && !connectionLoading} - {session.auth.username}@{serverAddress} - {/if} - - {/if} -

- {#if session.error} -

{session.error}

- {/if} -
- - {#if session.refreshError} -
-

Synchronization needs attention

-

{session.refreshError}

-

Your existing library is still available.

-
- {/if} - - {#if cleaning} -

Deleting local data…

- {:else if !session.auth && demo} -

- This demo uses a fixed music library and cannot connect to other servers. Reload to - reconnect to the demo. -

-
- -
- {:else if !session.auth} -
-

- Connect to your Navidrome or another OpenSubsonic-compatible server to browse your - library and stream music. -

-
- - -
-
- - -
-
- - -
-
- - {#if session.busy} - - {/if} -
-
- {:else} -
-

- {#if demo} - This demo uses a fixed music library. Disconnect stops streaming; reload to - reconnect. Choose whether to keep its local data. - {:else} - Disconnect to switch users or servers. Choose whether to keep this account’s local - data. - {/if} -

-
- - - -
-
- {/if} -
- -
-

Connection

-

- {session.busy ? "Connecting…" : session.offlineMode ? "Working offline" : "Connected"} -

- {#if session.auth} - - {/if} -

- {#if !session.auth} - {demo - ? "Reload the demo to browse online. Any previews you kept remain available." - : "Connect to a server to browse online. Any music you kept remains available."} - {:else if session.offlineMode} - Server access is off. Requested downloads are paused. - {:else} - Server access is on. Choose Downloaded in Library scope to browse saved music without - disconnecting. - {/if} -

- -
-
- - {@render children?.()} -
-
diff --git a/src/app.svelte b/src/app.svelte index 59a1b1b..77ccad8 100644 --- a/src/app.svelte +++ b/src/app.svelte @@ -13,8 +13,8 @@ import Settings from "./_settings.svelte"; import AlbumRoute from "./_album.svelte"; import ArtistRoute from "./_artist.svelte"; + import Connect from "./_connect.svelte"; import LibraryRoute from "./_library.svelte"; - import SearchRoute from "./_search.svelte"; import type WebappUpdater from "./webapp-updater.svelte"; import type { AuthStore } from "./auth"; import { Covers } from "./covers.svelte"; @@ -115,11 +115,11 @@ onMount(() => { const savedAuth = session.start(); - if (!savedAuth && cache.key === undefined) { + if (!savedAuth && !session.hasLocalAccount && cache.key === undefined) { // Startup chooses the first page; it is not an animated navigation. const url = new URL(window.location.href); - if (url.search !== "?/settings") url.hash = ""; - url.search = "/settings"; + if (url.search !== "?/connect") url.hash = ""; + url.search = "/connect"; if (url.href !== window.location.href) window.history.replaceState(window.history.state, "", url); } @@ -144,7 +144,7 @@ {#snippet downloadsRoute()} - + {/snippet} {#snippet libraryRoute()} @@ -152,9 +152,9 @@ {/snippet} -{#snippet searchRoute()} +{#snippet connectRoute()} - + {/snippet} {#snippet artistRoute(params: RouteParams)} @@ -209,21 +209,15 @@ navigationDrawer?.close()} > - + Your library - navigationDrawer?.close()} - > - - Search - {offlineMode ? "Connect" : "Work offline"} {:else} - navigationDrawer?.close()}>Connect + navigationDrawer?.close()}>Connect {/if} {#if offlineMode}

Server access is off. Requested downloads are paused. @@ -331,7 +325,7 @@ {@render brand()}

{@render actions()} - +