Starting up¶
A page load runs in this order:
- Theme first. A small inline script in
index.htmlreadslocalStorage['nessie-theme']and setsdata-bs-themeon<html>before anything is drawn, so the page never flashes in the wrong colours. - Static frame.
index.htmlalready contains the header, the sidebar shell, an empty<main id="view">, the player bar, and the panels (Now Playing, queue). Most of these are custom elements like<nessie-sidebar>that draw themselves. - Components register.
main.jsimports every file incomponents/. Each one callscustomElements.define, and the tags already in the page come to life. - Who's listening?
loadMe()callsGET /v1/me. If the answer isn'tsigned_in(profiles are on and this device hasn't picked one), the profile picker covers the screen and startup stops there. Once a profile is picked, the picker starts the app again. - Data and player. It loads the libraries (
GET /v1/library/libraries) into the sidebar, gives the sharedPlayerto the player bar, queue and Now Playing, and starts the player. - Routing starts. Once integrations are known (whether Lidarr is on), the router reads the address and draws the first view.
- Extras. It wires the search box, the keyboard shortcuts (Space plays and pauses,
/jumps to search), and the request events. Then it registers the service worker and sets up the AI button at the end of the search box (startAiPrompt()).