Skip to content

Staging#25

Merged
Skeptic-systems merged 3 commits intomainfrom
staging
Dec 30, 2025
Merged

Staging#25
Skeptic-systems merged 3 commits intomainfrom
staging

Conversation

@Skeptic-systems
Copy link
Copy Markdown
Contributor

@Skeptic-systems Skeptic-systems commented Dec 30, 2025

Description

Brief description of the changes in this PR.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Fixes #(issue number)
Closes #(issue number)
Related to #(issue number)

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

  • I have tested these changes locally
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Add screenshots to help explain your changes.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Add any additional notes about the PR here.

Summary by CodeRabbit

  • New Features

    • Custom theme creation and management: Save, load, export, and delete personalized themes in JSON format.
    • Theme Studio: Built-in editor for creating and testing custom themes with live preview and validation.
    • Enhanced search: Search songs with recent history, quick playback, and result listing.
    • Window dragging: Native window drag interaction for improved desktop experience.
  • Improvements

    • Updated theme configuration with new header text styling option.
    • Improved UI responsiveness with adjusted layout spacing and cursor behavior.
    • Refined playback bar interaction for smoother user experience.
  • Documentation

    • Updated guides and configuration documentation for custom themes and settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 30, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request introduces a custom theme system for the desktop application, with a Tauri backend for persisting JSON themes, TypeScript APIs for theme management, enhanced UI components supporting truncation and empty states, a rebuilt search interface with Spotify integration, and a Theme Studio feature in Settings for creating and managing custom themes.

Changes

Cohort / File(s) Summary
Trailing Newline Formatting
.dockerignore, CODE_OF_CONDUCT.md, CONTRIBUTING.md, LICENSE, SECURITY.md, apps/docs/.gitignore, apps/docs/.npmrc, apps/docs/nginx.conf, apps/docs/src/content.config.ts, apps/docs/src/content/docs/config/*, apps/docs/src/content/docs/desktop/*, apps/docs/src/content/docs/dev/*, apps/docs/src/content/docs/guides/*, apps/docs/src/env.d.ts, apps/docs/src/styles/custom.css, apps/docs/tsconfig.json, apps/www/components/ui/grid-background.tsx, apps/www/next-env.d.ts, compose.yml
Added trailing blank lines for consistent formatting across project files; no functional changes.
Custom Themes Infrastructure
apps/desktop/src-tauri/src/custom_themes.rs, apps/desktop/src-tauri/src/lib.rs
New Rust module introducing CustomTheme data structures with nested configs (panel, settings, controls, playbar, typography, actions, cover). Adds five Tauri commands: save_custom_theme, load_custom_themes, delete_custom_theme, export_custom_theme, validate_theme_json. Includes file I/O, JSON validation, and filename sanitization. Registered module in lib.rs with invoke_handler integration.
Custom Themes TypeScript API
apps/desktop/src/lib/settingLib.ts
Adds CustomTheme TypeScript interface and five public async functions mirroring Tauri backend: saveCustomTheme, loadCustomThemes, deleteCustomTheme, exportCustomTheme, validateThemeJson. Provides client-side API surface for theme management.
Theme Loading & Validation
apps/desktop/src/loader/themeLoader.ts
Extends ThemeConfig and RawTheme with headerText field for settings. Introduces applyThemeConfig, validateThemeJsonFormat, applyCustomThemeFromJson, and getBuiltInThemeNames public APIs. New ThemeValidationResult type for validation feedback. Refactors theme application flow to support both built-in and custom themes from JSON.
Theme Configuration Updates
apps/desktop/src/themes/dracula.json, apps/desktop/src/themes/light.json
Added headerText: "#FFFFFF" property under settings in both theme files.
Tauri Window Permission
apps/desktop/src-tauri/capabilities/default.json
Added "core:window:allow-start-dragging" to permissions array to support window dragging functionality.
Track Info Display Components
apps/desktop/src/ui/components/LayoutTrackInfo/TrackInfoLayout.tsx, apps/desktop/src/ui/components/TrackDataComponent/TrackCover.tsx, apps/desktop/src/ui/components/TrackDataComponent/TrackMeta.tsx
Extended TrackInfoLayout with optional maxLength prop and guards for missing tracks. Added isEmpty prop to TrackCover for displaying MusicNote placeholder when no track present. Added maxLength and isEmpty props to TrackMeta with text truncation logic and empty-state messaging ("Not playing", "Click play to resume").
Layout & Styling
apps/desktop/src/ui/layouts/LayoutC.tsx, apps/desktop/src/ui/global.css, apps/desktop/src/ui/components/TrackControls/PlaybackBar.tsx
Adjusted LayoutC to pass maxLength={20} to TrackInfoLayout and changed left margin from -ml-36 to -ml-14. Updated global.css to reduce drag-area height from 40px to 20px and change cursor from grab/grabbing to move. Removed hover:cursor-ew-resize class from PlaybackBar.
Spotify Client Integration
apps/desktop/src/ui/spotifyClient.ts
Added three new public functions: searchTracks(query, limit) for searching tracks, playTrack(trackUri) for playback control, fetchRecentlyPlayed(limit) for retrieving recently played items with de-duplication. Includes supporting interfaces SpotifySearchResponse and RecentlyPlayedResponse.
Search View Rewrite
apps/desktop/src/ui/views/SearchBar.tsx
Complete refactor from simple input wrapper to full-featured stateful search interface. Adds internal state for query, results, recent tracks, loading indicators, and playing track ID. Implements 300ms debounced search, loads recently played on mount, displays results/recent sections with album art, track info, and play controls. Adds onBack prop and formats track durations. Integrates with Spotify client for search and playback.
Settings Theme Studio
apps/desktop/src/ui/views/Settings.tsx
Major expansion adding Theme Studio tab with JSON editor, theme validation preview, save/export/delete workflows. Loads and displays custom themes alongside built-in themes. Introduces defaultThemeJson constant and handlers for validation, preview, save, export, and deletion. Enhances Appearance view with custom theme management and "Built-in Themes" label. Updates current theme display to handle "custom:" prefix.
Main UI Integration
apps/desktop/src/ui/index.tsx
Replaces theme invoke import with loadCustomThemes and applyCustomThemeFromJson. Routes custom themes (prefixed with "custom:") through custom theme loader with fallback to "dark". Adds window dragging via startDragging() on drag-area mousedown. Removes Debug and Maximize menu items. Wires SearchBar onBack handler for view switching.

Sequence Diagrams

sequenceDiagram
    participant UI as User/UI
    participant ThemeLoader as ThemeLoader
    participant SettingLib as SettingLib (TS)
    participant Tauri as Tauri Backend
    participant FS as File System

    UI->>SettingLib: applyCustomThemeFromJson(jsonString)
    SettingLib->>ThemeLoader: validateThemeJsonFormat(jsonString)
    ThemeLoader->>ThemeLoader: Parse & validate JSON
    ThemeLoader-->>SettingLib: ThemeValidationResult
    
    alt Valid Theme
        SettingLib->>ThemeLoader: applyCustomThemeFromJson(jsonString)
        ThemeLoader->>ThemeLoader: Transform & apply CSS variables
        ThemeLoader-->>SettingLib: Success result
        SettingLib-->>UI: Theme applied
    else Invalid
        ThemeLoader-->>SettingLib: Error result
        SettingLib-->>UI: Validation error
    end

    Note over UI,FS: Save Custom Theme
    UI->>SettingLib: saveCustomTheme(themeJson)
    SettingLib->>Tauri: save_custom_theme(themeJson)
    Tauri->>Tauri: Validate & sanitize
    Tauri->>FS: Write theme.json
    FS-->>Tauri: Success/Error
    Tauri-->>SettingLib: Filename or Error
    SettingLib-->>UI: Result with filename
Loading
sequenceDiagram
    participant UI as SearchBar UI
    participant Client as Spotify Client
    participant SpotifyAPI as Spotify API
    participant Player as Playback

    UI->>UI: Input query (debounce 300ms)
    UI->>Client: searchTracks(query, 20)
    Client->>SpotifyAPI: GET /search (tracks)
    SpotifyAPI-->>Client: Search results
    Client-->>UI: SimplifiedTrack[]
    UI->>UI: Display results

    rect rgb(200, 150, 255)
    Note over UI,SpotifyAPI: Recently Played (on mount)
    UI->>Client: fetchRecentlyPlayed(20)
    Client->>SpotifyAPI: GET /me/player/recently_played
    SpotifyAPI-->>Client: Items with track & timestamp
    Client->>Client: De-duplicate by track ID
    Client-->>UI: SimplifiedTrack[]
    UI->>UI: Display recent tracks
    end

    rect rgb(150, 200, 255)
    Note over UI,Player: Play Track
    UI->>Client: playTrack(trackUri)
    Client->>SpotifyAPI: PUT /me/player/play
    SpotifyAPI-->>Client: Success
    Client-->>UI: Void
    UI->>UI: Show spinner & update state
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 Custom themes hop into view,
JSON brushstrokes, colors true!
Search and drag, new features bloom,
Tauri persists in file-room!
A rabbit's work, now styled with care! 🎨

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c65989 and c7597b4.

⛔ Files ignored due to path filters (4)
  • apps/desktop/src-tauri/gen/schemas/acl-manifests.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/capabilities.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/desktop-schema.json is excluded by !**/gen/**
  • apps/desktop/src-tauri/gen/schemas/windows-schema.json is excluded by !**/gen/**
📒 Files selected for processing (42)
  • .dockerignore
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • SECURITY.md
  • apps/desktop/src-tauri/capabilities/default.json
  • apps/desktop/src-tauri/src/custom_themes.rs
  • apps/desktop/src-tauri/src/lib.rs
  • apps/desktop/src/lib/settingLib.ts
  • apps/desktop/src/loader/themeLoader.ts
  • apps/desktop/src/themes/dracula.json
  • apps/desktop/src/themes/light.json
  • apps/desktop/src/ui/components/LayoutTrackInfo/TrackInfoLayout.tsx
  • apps/desktop/src/ui/components/TrackControls/PlaybackBar.tsx
  • apps/desktop/src/ui/components/TrackDataComponent/TrackCover.tsx
  • apps/desktop/src/ui/components/TrackDataComponent/TrackMeta.tsx
  • apps/desktop/src/ui/global.css
  • apps/desktop/src/ui/index.tsx
  • apps/desktop/src/ui/layouts/LayoutC.tsx
  • apps/desktop/src/ui/spotifyClient.ts
  • apps/desktop/src/ui/views/SearchBar.tsx
  • apps/desktop/src/ui/views/Settings.tsx
  • apps/docs/.gitignore
  • apps/docs/.npmrc
  • apps/docs/nginx.conf
  • apps/docs/src/content.config.ts
  • apps/docs/src/content/docs/config/custom-themes.mdx
  • apps/docs/src/content/docs/config/settings.mdx
  • apps/docs/src/content/docs/desktop/authentication.mdx
  • apps/docs/src/content/docs/desktop/layouts.mdx
  • apps/docs/src/content/docs/desktop/shortcuts.mdx
  • apps/docs/src/content/docs/desktop/themes.mdx
  • apps/docs/src/content/docs/dev/building.mdx
  • apps/docs/src/content/docs/guides/introduction.mdx
  • apps/docs/src/content/docs/guides/quick-start.mdx
  • apps/docs/src/content/docs/index.mdx
  • apps/docs/src/env.d.ts
  • apps/docs/src/styles/custom.css
  • apps/docs/tsconfig.json
  • apps/www/components/ui/grid-background.tsx
  • apps/www/next-env.d.ts
  • compose.yml

Comment @coderabbitai help to get the list of available commands and usage tips.

@Skeptic-systems Skeptic-systems merged commit 4477d39 into main Dec 30, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant