Introducing a new way to review your PRs.

Read the announcement

crmne / spotifast

Spotify, native and fast. One lightweight Rust app for your whole library, local playback, and Spotify Connect on Linux, macOS, and Windows.

View on GitHub

19 documents · Updated Nov 18, 2026

docs / ui-navigation-and-shared-components

UI navigation and shared components

The UI module is the desktop surface where a listener signs in, finds music, controls playback, and changes app behavior. It joins a shared window frame with pages, side panels, dialogs, and common controls. This page is a child of Desktop UI and interaction model; platform-owned window behavior is described in Platform window controls and integrations.

Window composition

Main view

The main view gives signed-in use one stable frame for all content. It keeps navigation on the left, the active page in the center, optional queue and lyrics panels on the right, and playback controls at the bottom. Login and setup use separate views until a session and playback path are ready.

The frame routes input as actions back to shared app state. This lets a page, panel, player bar, or dialog produce the same product behavior without owning the whole window.

The following diagram shows how session state selects the visible frame and how user actions return to app state.

flowchart TD
    A[Application state] --> B{Session and setup state}
    B -->|Signed out or connecting| C[Login view]
    B -->|Playback setup| D[Soloist setup]
    B -->|Signed in| E[Shared window frame]
    E --> F[Sidebar and topbar]
    E --> G[Active page]
    E --> H[Queue or lyrics panel]
    E --> I[Player bar]
    E --> J[Dialogs and notices]
    F --> K[Shared action]
    G --> K
    H --> K
    I --> K
    J --> K
    K --> A

References: src/…/mod.rs• L39-120 src/…/mod.rs• L304-391

Navigation uses named destinations and shared actions instead of direct view changes. The sidebar exposes Home, Search, and library areas. The topbar adds global search, page history, account access, settings, and auxiliary views. Cards, covers, and track rows use the same destination and playback actions, so the listener can reach a feature from several surfaces.

The sidebar also acts as a library workspace. It can change the view with filters, sorting, folders, pins, ownership choices, and local search while keeping the same page model.

References: src/…/sidebar.rs• L1002-1223 src/…/sidebar.rs• L1257-1433 src/…/topbar.rs• L197-281

Topbar status

The topbar keeps global controls above every page. Its search field opens Search when a query starts. Its account menu reaches settings, shortcut help, and sign-out. Status areas report background work, offline state, updates, and playback on another device.

The bar reduces secondary status content before it gives up space needed by search. Window buttons occupy the outer edge of this layout. See Platform window controls and integrations for that platform boundary.

References: src/…/topbar.rs• L54-96 src/…/topbar.rs• L285-393 src/…/topbar.rs• L398-650

Player bar

The player bar is the persistent playback surface. It shows the current item and exposes transport, seek, volume, device, queue, and lyrics controls. It remains active as the listener changes pages because it reads shared playback state.

The bar also links playback to content actions. The listener can open the current context, save the item, add it to the queue, or use the same menu as a track row.

References: src/…/player_bar.rs• L46-121 src/…/player_bar.rs• L420-703 src/…/player_bar.rs• L953-1124

Content experiences

Home page

Home is the personalized starting point after sign-in. It gives quick access to recent contexts and presents recommendation shelves when data is available. These shelves can include new releases, recent plays, podcasts, artists, and songs.

The page stays useful while remote data is pending. It uses loading placeholders, meaningful empty sections, and offline guidance. Cards support navigation, playback, and context actions.

References: src/…/home.rs• L15-61 src/…/home.rs• L192-325 src/…/home.rs• L327-505

Queue experience

The queue shows the current item, the listener’s additions, and the next items from the active context. It works as a page and as a resizable side panel. The view can also show recent plays and save the current queue as a playlist.

Queue edits depend on the playback target. Local playback permits insert, move, clear, and drag-and-drop reorder actions. A remote target does not expose those local edits, so the UI limits its controls and treats a drop as an addition when needed.

References: src/…/queue.rs• L15-147 src/…/queue.rs• L163-284 src/…/queue.rs• L341-594 src/…/widgets.rs• L1200-1238

Lyrics experience

Lyrics follow the current track and support timed and untimed text. The side panel highlights the active line and follows playback until the listener scrolls away. Selecting a timed line seeks playback and restores following.

Full-screen lyrics provide a focused reading view with artwork. Missing, instrumental, loading, offline, and failed states each give the listener a clear status and a retry or reconnect path when one exists.

References: src/…/lyrics.rs• L39-125 src/…/lyrics.rs• L127-315 src/…/lyrics.rs• L317-509 src/…/lyrics.rs• L801-1004

Login experience

Login is a browser-based sign-in flow. The listener enters a personal Spotify Client ID, starts sign-in, and returns through the browser callback. The screen explains invalid IDs, rejected accounts, expired sessions, and the retired shared sign-in.

The screen can show a short registration guide beside the form. It also exposes proxy settings for network access. The form never handles the listener’s Spotify password and remains scrollable when setup content is taller than the window.

References: src/…/login.rs• L22-163 src/…/login.rs• L165-369 src/…/login.rs• L445-653 src/…/login.rs• L671-759

Playback setup

Playback setup guides the listener through an optional Spotify Soloist path. It moves through key entry, player download, device pairing, account verification, and ready states. If the path fails, it offers retry, a different key, or the built-in player.

After setup, the working app reports Soloist status through a banner instead of reopening the setup card. Settings expose its state, access needs, version, update notice, and the switch back to built-in playback. This keeps setup separate from normal browsing while preserving a visible recovery path.

References: src/…/soloist.rs• L34-79 src/…/soloist.rs• L81-179 src/…/soloist.rs• L735-814 src/…/soloist.rs• L824-978

Settings experience

Settings groups account access, playback, appearance, proxy use, local files, updates, and desktop options. A settings search field matches section names, row titles, and row descriptions. Conditional rows only appear when their platform or account state makes them relevant.

Changes use the same action path as other UI input. Some changes apply at once. Playback and proxy changes can remain marked until the listener applies them and restarts or reconnects the affected service. Appearance settings also cover themes, language, display scale, compact lists, visualizers, and mini-player behavior.

References: src/…/settings.rs• L22-64 src/…/settings.rs• L461-519 src/…/settings.rs• L704-885 src/…/settings.rs• L1195-1322 src/…/settings.rs• L1662-1752

Update prompt

The update prompt gives a single place to understand an available release and choose how to proceed. It can download an update, show progress, report a failed download, or explain why the current installation must be updated by its package manager.

When an update is ready, the prompt makes the restart effect clear. It offers restart-and-install when the app can install directly. Otherwise it links to release notes or a suitable download and can show a copyable package-manager command.

References: src/…/update.rs• L11-243 src/…/update.rs• L245-309

Shared interaction patterns

Shared widgets

Shared widgets give pages one visual and action language. Covers provide artwork or a stable placeholder. Cards, track rows, shelves, menus, setting rows, switches, loading rows, error rows, and empty states let feature pages focus on content meaning.

Long lists and card grids keep the same user view while drawing the visible range. Menus connect common actions such as play, queue, save, playlist changes, navigation, and link copying. Track rows also carry playability, selection, drag, focus, and accessibility meaning across pages.

References: src/…/widgets.rs• L15-118 src/…/widgets.rs• L345-425 src/…/widgets.rs• L427-675 src/…/widgets.rs• L1174-1463 src/…/widgets.rs• L1577-1823

Dialog behavior

Dialogs provide focus, confirmation, and short temporary workspaces. They cover playlist creation and editing, deletion warnings, shortcut help, account setup prompts, playback limits, and enlarged artwork.

The modal layer keeps the page behind it inactive. Explicit buttons, dismissal gestures, and Escape close the local transient surface. Forms validate the minimum input before they emit an action. Long content scrolls inside the dialog so its final controls remain reachable.

References: src/…/dialogs.rs• L10-233 src/…/dialogs.rs• L345-610 src/…/dialogs.rs• L663-721

Keyboard handling

Keyboard handling gives playback, navigation, search, panels, settings, and window actions one consistent path. Platform-specific command keys map to the same product actions where possible. Shortcut help uses the same active definitions as the handler.

Text fields and menus keep keys that belong to editing or selection. Escape closes the nearest transient surface first, then broader surfaces such as devices or full-screen lyrics. Focus and scrolling rules let keyboard users reach rows in virtual lists and menus.

References: src/…/keys.rs• L11-223 src/…/keys.rs• L225-273 src/…/keys.rs• L275-425 src/…/widgets.rs• L894-1000

Loading and failure states

UI sections present remote data as a small set of user-facing states: not loaded, loading, loaded, empty, or failed. Each state has a matching message, placeholder, retry control, or offline path. This keeps slow service responses from looking like missing content.

The main frame also uses notices and toasts for problems that affect more than one page. A local failure can leave the rest of the app usable while the affected surface explains its next action.

References: src/…/mod.rs• L399-546 src/…/mod.rs• L703-757 src/…/lyrics.rs• L139-206 src/…/queue.rs• L356-367 src/…/soloist.rs• L459-542

Presentation rules

The module uses the active palette, locale, and display scale as shared presentation inputs. Artwork can tint page headers and the player bar. Text and controls keep contrast against that tint. Narrow layouts wrap or collapse controls instead of removing the main task.

The same rules apply to pointer, keyboard, and assistive input. Labels, focus feedback, translated text, widget names, hover help, and action emission keep those input paths aligned. The Winamp playlist follows the same product rules inside its skin while preserving its pixel-based look; its text supports mixed scripts, right-to-left titles, emoji, and fit-to-row ellipses.

References: src/…/mod.rs• L255-301 src/…/widgets.rs• L662-675 src/…/topbar.rs• L111-155 src/…/settings.rs• L143-188 src/…/pixel_text.rs• L27-38 src/…/pixel_text.rs• L180-245 src/…/playlist.rs• L275-338 src/…/playlist.rs• L447-501

Winamp playlist

The Winamp playlist is a skin-based companion surface joined to the mini-player. It shows the current track and queue in the skin’s list style. The listener can select rows, play a queued row, scroll, resize, shade the panel, and open supported list menus.

Its menus connect the legacy surface to current app actions. They can open Search or Liked Songs, remove only locally editable queue rows, load a playlist, save the queue as a playlist, and open album or artist pages. Unsupported skin controls remain decorative rather than promising behavior the app cannot provide.

References: src/…/playlist.rs• L1-89 src/…/playlist.rs• L349-501 src/…/playlist.rs• L626-818

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep page destinations, sidebar entries, topbar actions, and keyboard shortcuts aligned when adding or renaming a global destination.
  • Keep side-panel width rules aligned with topbar minimum space so queue or lyrics panels cannot hide search and account controls.
  • Keep each dialog’s close behavior and action contract aligned with Escape handling and modal dismissal.
  • Keep loading, empty, offline, retry, and setup states aligned with the related data state.
  • Keep settings row text, filter matching, conditional availability, and the control action aligned when a setting changes.
  • Keep queue and Winamp playlist edit controls aligned with the active playback target’s ability to change its local queue.
  • Keep shared widget labels, shortcut help, translated strings, and accessibility names aligned when an input path changes.
  • Keep Winamp row identity aligned with queue positions when the current track or duplicate queue items change.

Important failure modes

TriggerConsequenceGuard
A text field keeps focus while global shortcuts consume its editing keysSearch or form text changes when the listener tries to edit itKeyboard handling checks focused text editors before consuming app shortcuts
A queue or Winamp playlist action assumes every target supports local queue editsA remote queue appears editable but cannot perform the requested changeQueue actions check local reorder and removal capability before enabling controls
A lyrics view keeps following after manual scrollingThe reader is pulled away from the text they chose to inspectLyrics pause following on manual scroll and expose an explicit Follow path
A panel keeps its saved width without fitting the page beside itSearch, page content, or window controls overlap at narrow sizesShared panel fitting yields width and raises the window minimum when needed
A dialog or setup card grows beyond the window without inner scrollingConfirmation, submit, or recovery controls move off screenLong modal, login, and setup content scroll inside its available area
Settings filters rows but not the section or control availability modelA valid setting disappears or a control appears for an unavailable featureShared row metadata drives both search matching and conditional display
Winamp text uses one left-to-right label for a mixed-script titleRight-to-left titles appear in the wrong place or lose joined glyphsPixel text shapes directional runs and positions the title by its own direction

Key files

FileWhy to read it
src/…/mod.rsDefines shared window composition, page dispatch, overlays, notices, and panel fitting.
src/…/sidebar.rsShows navigation, library filters, folders, sorting, pins, and library interaction.
src/…/topbar.rsShows global search, account actions, status badges, and responsive topbar behavior.
src/…/player_bar.rsShows persistent playback controls and entry points for devices, queue, lyrics, and visual feedback.
src/…/home.rsShows the personalized Home experience and its loading, card, and shelf patterns.
src/…/queue.rsShows queue, recent plays, local reorder rules, and side-panel placement.
src/…/lyrics.rsShows side-panel and full-screen lyrics behavior, follow state, seeking, and failure states.
src/…/login.rsShows browser sign-in, Client ID setup, proxy access, and auth error guidance.
src/…/soloist.rsShows playback setup, recovery, status banner, and settings integration for Soloist.
src/…/settings.rsShows searchable settings sections and how settings changes map to app actions.
src/…/update.rsShows update download, install, package-manager guidance, and restart messaging.
src/…/widgets.rsDefines shared covers, rows, menus, selection, drag behavior, and presentation contracts.
src/…/dialogs.rsDefines modal workflows for playlist changes, confirmations, shortcuts, and artwork.
src/…/keys.rsDefines keyboard actions, platform variants, focus rules, and shortcut help.
src/…/playlist.rsShows the skin-based playlist surface and its bridge to current queue and navigation actions.
src/…/pixel_text.rsShows the Winamp text behavior for pixel rendering, script direction, fallback, and row fitting.