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 / desktop-ui-and-interaction

Desktop UI and interaction model

Spotifast presents a desktop music client as one coordinated window. The UI combines navigation, content pages, playback controls, dialogs, and short status messages around shared input, text, theme, and window rules. The model keeps product actions consistent across pages while adapting the window to the active platform.

Interface composition

The main interface is built as a set of stable regions around the current page. The top bar and sidebar provide movement through the app, the central area presents the selected content, optional side panels expose queue or lyrics, and the player bar remains available for playback control.

This diagram shows how the signed-in window turns application state into visible surfaces.

flowchart TD
    S[Application state] --> C[Desktop UI coordinator]
    C --> T[Top bar and navigation]
    C --> L[Sidebar and library]
    C --> P[Current page]
    C --> R[Queue, lyrics, or friends panels]
    C --> B[Player bar]
    C --> O[Dialogs, banners, and toasts]
    T --> A[User actions]
    L --> A
    P --> A
    R --> A
    B --> A
    O --> A
    A --> S

Main window composition

The UI coordinator selects the signed-in page and adds the shared regions around it. Login, Soloist setup, and other setup states use separate surfaces, while the normal window can enter full-screen lyrics mode and temporarily change which panels are visible. The UI navigation and shared components page describes those shared surfaces in more detail.

References: src/…/mod.rs• L39-120 src/…/login.rs• L47-163 src/…/soloist.rs• L81-159

Content surfaces

Content pages use the same scrollable central area and shared presentation rules for cards, rows, artwork, loading states, and empty states. Large lists can load more content as the reader nears the end, so the page remains usable while data arrives instead of waiting for the full result.

References: src/…/mod.rs• L304-391 src/…/widgets.rs• L345-425 src/…/search.rs• L15-80

Settings surface

The Settings surface turns app-wide choices into searchable groups. It hides rows that do not apply to the current platform or account state, and it moves controls below their descriptions when the window is too narrow to keep both on one line.

References: src/…/settings.rs• L22-64 src/…/settings.rs• L461-519 src/…/settings.rs• L1326-1658 src/…/widgets.rs• L3718-3800

Player setup surfaces

Spotify Soloist setup guides the user through key entry, player download, device pairing, and readiness as one state-driven task. After setup, the app reports problems in a banner over the working UI and offers the built-in player as a fallback, so setup does not interrupt normal browsing more than necessary.

References: src/…/soloist.rs• L34-79 src/…/soloist.rs• L162-179 src/…/soloist.rs• L544-733 src/…/soloist.rs• L737-815

Mini-player and playlist surfaces

Optional skin-based mini players provide a compact playback window with a playlist attached to it. The playlist shows the current item and local queue, supports row selection and playback actions, and can be shaded or resized without changing the main window's action model.

References: src/…/playlist.rs• L1-89 src/…/playlist.rs• L275-338 src/…/playlist.rs• L350-455 src/…/playlist.rs• L524-592

Navigation joins page state with direct actions such as back, forward, search, library access, and panel toggles. Dialogs sit above the page when an action needs input, confirmation, or an explanation, and transient messages report short-lived results without taking control of the main view.

The top bar gives every page a common route back through the app. The sidebar exposes the home view, library entries, and saved content, while page and row actions open related artists, albums, shows, playlists, or radio views. The same routes are also available through keyboard and mouse navigation.

References: src/…/topbar.rs• L1-11 src/…/sidebar.rs• L1-10 src/…/keys.rs• L20-33 src/…/keys.rs• L201-222

Dialogs and transient messages

Modal dialogs handle focused tasks such as playlist editing, deletion checks, duplicate warnings, sign-in guidance, and shortcut discovery. They block unrelated page shortcuts until the task ends, and they close through an explicit action, the dialog backdrop, or Escape when appropriate. Banners and toasts provide less disruptive feedback for warnings, progress, and completed actions.

References: src/…/dialogs.rs• L10-38 src/…/dialogs.rs• L43-227 src/…/dialogs.rs• L663-703 src/…/mod.rs• L399-546 src/…/mod.rs• L703-757

Update dialog

The update dialog turns release state into a clear next action. It shows download progress, a ready-to-install restart, or a retry path; when the installed package cannot update itself, it explains the package route and provides a command or download link instead.

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

Input behavior

Input follows desktop conventions while protecting controls that need the same keys for their own work. Focused text fields keep typing and caret movement, focused rows remain keyboard-accessible, and the app handles global playback and navigation shortcuts only when those controls do not own the event.

Keyboard shortcuts

The shortcut system maps platform command keys to app actions for playback, search, navigation, panels, window actions, and the shortcut dialog. It resolves special cases before general shortcuts, such as selected-song queue actions and macOS-reserved key combinations. Page Up, Page Down, Home, and End scroll the page only when no text field, popup, or disabled view needs them.

References: src/…/keys.rs• L11-18 src/…/keys.rs• L35-170 src/…/keys.rs• L225-273 src/…/keys.rs• L275-425

Focus and text entry

Interactive controls expose focus information and scroll into view when focus moves to them. Text fields support localized editing behavior, preserve their native editing keys, and keep a selection while a clipboard menu opens. Search fields and playlist menus let users filter long lists and choose entries with the keyboard, while links use a pointing-hand cursor and ordinary buttons keep the standard desktop pointer.

References: src/…/widgets.rs• L427-517 src/…/widgets.rs• L894-1087 src/…/widgets.rs• L3493-3564 src/…/widgets.rs• L3566-3665 src/…/widgets.rs• L980-1020 src/…/dialogs.rs• L313-343

Localization and display helpers

The interface treats language as part of the user-facing contract. It translates labels, messages, plural forms, dates, durations, and accessibility text while keeping names and values meaningful in the selected language.

Locale selection

The app starts with the first supported language from the operating system unless the user selects another language in Settings. Stored and command-line language tags map to the closest bundled locale, and English remains the fallback for missing translations. Plural and contextual messages prevent counts and repeated words from using the wrong grammatical form.

References: src/i18n.rs• L1-7 src/i18n.rs• L9-70 src/i18n.rs• L72-181 src/i18n.rs• L241-261 src/…/settings.rs• L2761-2797

Text and value presentation

Shared display helpers keep values readable across the UI. Track times use clock notation, totals and episode lengths use localized units, recent dates use relative wording for the first 30 days, and older dates use localized month and day forms. Bidirectional text support keeps mixed Latin, Arabic, Hebrew, numbers, punctuation, and ellipses in visual reading order, including titles in the skin playlist.

References: src/util.rs• L7-18 src/util.rs• L20-53 src/util.rs• L56-102 src/util.rs• L104-177 src/bidi.rs• L25-107 src/bidi.rs• L211-243 src/…/pixel_text.rs• L1-9 src/…/pixel_text.rs• L294-327 src/…/playlist.rs• L459-521

Visual system

Shared visual rules give every surface the same sense of hierarchy and state. A palette supplies colors for the window, panels, text, actions, warnings, overlays, and shadows, while common fonts and icons keep controls recognizable across pages and themes.

Palette and typography

The visual system supports light, dark, custom, and artwork-tinted appearances. The selected palette also controls egui's menus, dialogs, text fields, focus rings, selection marks, and shadows, so built-in controls do not look separate from the custom page surfaces. Fonts include weights and script coverage for the supported languages.

References: src/theme.rs• L16-39 src/theme.rs• L41-106 src/theme.rs• L305-428 src/theme.rs• L430-441

Artwork and loading states

Artwork is treated as a progressive visual resource. A page can keep a prior preview or nearby loaded copy visible while the requested image becomes ready, then fall back to a consistent placeholder when no image is available. This keeps page heroes, cards, playback art, and dialogs stable during loading.

References: src/…/widgets.rs• L21-118 src/…/widgets.rs• L183-236 src/…/mod.rs• L224-301 src/…/dialogs.rs• L663-703

Platform window affordances

The desktop window adapts its chrome and capabilities to the active window system. The main UI reserves space for native or custom title-bar controls, preserves usable content width as panels open, and reports platform limits instead of pretending that every window feature works everywhere.

Window chrome

The app supports native and custom title-bar arrangements with drag regions, caption buttons, platform labels, and macOS traffic-light spacing. The main window rejects remembered sizes below its usable minimum, and open side panels can raise that minimum so the page and its top bar remain readable. Full-screen views remove reservations that no longer apply, and Settings exposes the custom title bar only where the platform supports it.

References: src/window.rs• L186-207 src/…/mod.rs• L122-167 src/…/mod.rs• L591-691 src/theme.rs• L247-270 src/…/settings.rs• L1295-1301 src/…/settings.rs• L1644-1657

Platform integrations

Platform controls extend the visible window without changing the app's action model. Windows can expose transport actions in the taskbar preview, macOS can deliver Spotify links and use native minimize behavior, and Linux sessions can apply window-manager-specific rules. Wayland limitations are surfaced to the user when the desktop must provide a window feature itself. See platform window controls and integrations for the platform-specific behavior.

References: src/window.rs• L6-18 src/window.rs• L65-108 src/thumbbar.rs• L1-14 src/thumbbar.rs• L88-127 src/mac_links.rs• L1-18 src/hyprland.rs• L1-6

Change checklist

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

  • Keep the page coordinator, setup surfaces, banners, side panels, and minimum-window rules aligned so a new surface does not cover or starve existing controls.
  • Keep keyboard labels, action handling, dialog blocking, and text-field ownership aligned when adding or changing a shortcut.
  • Keep searchable Settings row text, conditional availability, and deep links aligned so a requested control remains visible and focusable.
  • Keep Soloist setup states, retry actions, fallback-player actions, and the persistent status banner aligned.
  • Keep new user-facing strings in the catalog path and use plural or context-aware messages when a value changes the sentence.
  • Keep display helpers, skin text fitting, and bidirectional layout aligned when adding a new date, count, duration, or mixed-script label.
  • Keep update download states and package-manager guidance aligned so every release state has a safe next action.
  • Keep custom title-bar reservations aligned with caption-button placement on each supported window system.

Important failure modes

TriggerConsequenceGuard
A global shortcut consumes a key while a text field has focusTyping or caret movement turns into playback or navigationShortcut handling checks text-edit focus before taking editing keys.
A dialog leaves the normal shortcut path openA page action can run while the user is confirming or editing dataDialog state blocks plain global shortcuts and Escape closes the top interaction first.
A remembered window size is below the usable minimumThe app can reopen too small for its page and navigation controlsusable_size rejects undersized saved dimensions.
A side panel opens without reserving enough content widthThe page top bar and panel controls overlap or become unreadablePanel state raises the window minimum and lets panels yield width when needed.
A filtered Settings page hides a row needed by a deep-linked actionThe target control is not visible or cannot receive focusFlows that target a Settings row clear the search before focusing it.
A translation omits plural or message contextCounts or repeated labels can use the wrong wordingShared localization uses plural and contextual lookup with English fallback.
A skin title is measured as one direction while it is drawn as anotherMixed-script or right-to-left playlist titles are clipped or placed on the wrong edgeSkin text shapes visual runs, fits the title to its room, and places the title by its own direction.
A platform lacks window-level controlKeep-above or taskbar behavior may not work from the appCapability checks report the limit and point to the desktop's own control where needed.
A package-managed install cannot update itselfThe update dialog offers no safe in-app install actionThe update route explains the package manager and gives its command or a release download.

Key files

FileWhy to read it
src/…/mod.rsShows the main composition order and how pages, panels, dialogs, banners, and toasts share one window.
src/…/login.rsShows the sign-in and registration surface, including responsive setup guidance and proxy access.
src/…/topbar.rsExplains common navigation, search, account controls, and narrow-window behavior.
src/…/sidebar.rsShows the library and navigation surface that turns content state into page routes.
src/…/widgets.rsDefines the shared interaction language for menus, focus, text editing, settings rows, artwork, and list presentation.
src/…/settings.rsShows searchable app-wide settings and how platform-specific controls remain usable in narrow windows.
src/…/soloist.rsShows setup stages, fallback behavior, status banners, and the settings view for the alternate player.
src/…/dialogs.rsShows modal task flows and how dialog actions return to application state.
src/…/update.rsShows how release downloads, installs, retries, and package-managed updates are presented.
src/…/keys.rsDefines the desktop shortcut model and its focus and platform rules.
src/theme.rsDefines shared palette, typography, icon, focus, and egui styling rules.
src/i18n.rsDefines locale selection, bundled translation behavior, and language tags.
src/util.rsProvides localized formatting for time, dates, counts, and relative dates.
src/bidi.rsExplains the text layout contract for right-to-left and mixed-direction labels.
src/…/playlist.rsShows the attached skin playlist's queue, selection, scrolling, and playback actions.
src/…/pixel_text.rsShows how skin-sized text stays sharp while supporting fallback fonts and mixed scripts.
src/window.rsDefines window sizing, platform capability checks, and no-window guidance.
src/thumbbar.rsDefines the Windows taskbar transport affordance and its action mapping.