'use client'; import { useState, useEffect } from 'react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; // Current app version from package.json const APP_VERSION = '2026.01.24'; // Changelog data - add new versions at the top const CHANGELOG = [ { version: '2026.01.24', title: 'January 2026 Update', changes: [ 'Improved SortableQueueItem component with enhanced click handling and styling', 'Added keyboard shortcuts and queue management features', 'Added ListeningStreakCard component for tracking listening streaks', 'Moved service worker registration to dedicated component for improved client-side handling', 'Enhanced offline download manager with client-side checks', 'Enhanced OfflineManagement component with improved card styling and layout', 'Implemented Auto-Tagging Settings and MusicBrainz integration', 'Enhanced audio settings with ReplayGain, crossfade, and equalizer presets', 'Added AudioSettingsDialog component', 'Updated cover art retrieval to use higher resolution images', 'Enhanced UI with Framer Motion animations for album artwork and artist icons', 'Added page transition animations and notification settings for audio playback', 'Implemented offline library synchronization with IndexedDB', 'Implemented offline library management with IndexedDB support', 'Updated all npm subdependencies to latest minor versions', ], fixes: [ 'Updated README formatting and improved content clarity', ], breaking: [ 'Removed PostHog analytics tracking', 'Removed caching system (replaced with offline library management)', ] }, { version: '2025.07.31', title: 'July End of Month Update', changes: [ 'Native support for moblie devices (using pwa)', ], fixes: [ 'Fixed issue with mobile navigation bar not displaying correctly', 'Improved performance on mobile devices', 'Resolved layout issues on smaller screens', 'Fixed audio player controls not responding on mobile', 'Improved touch interactions for better usability', 'Fixed issue with album artwork not loading on mobile', 'Resolved bug with search functionality on mobile devices', 'Improved caching for faster load times on mobile', ], breaking: [ ] }, { version: '2025.07.10', title: 'July Major Update', changes: [ // New Features 'Support for Rich PWA Installs', 'Added right-click shortcuts to the PWA icon', 'Onboarding now suggests Navidrome\'s Demo Server', 'User can export settings as a downloadable JSON', 'New sidebar layout (compact design)', 'New masonry-style grid in the settings page', 'New options in settings to customize appearance', 'Added 5 recently played albums and playlists created', 'New loading screen', 'New recommended songs section', 'Enhanced playlist page', 'Enhanced Home page layout and content', 'Themes updated to use OKLCH (from HSL)', 'All themes updated (light themes look similar)', 'Skeleton loading added across all pages' ], fixes: [ 'Fixed skeleton loader on the Home screen', 'Fixed album page not showing correct album art', 'Fixed album page not showing correct artist', 'Fixed album page not showing correct song count', 'Fixed flash of onboarding when already onboarded', 'Fixed issue with audio player not resuming playback after pause', 'Resolved bug with search results not displaying correctly' ], breaking: [ // Technically not breaking, but notable: 'Removed extended sidebar layout for a cleaner look' ] }, { version: '2025.07.02', title: 'July Mini Update', changes: [ 'New Favorites inside of the Home Page', 'Server Status Indicator removed for better performance', 'New Album Artwork component for consistency (along with the artists)' ], breaking: [], fixes: [] }, { version: '2025.07.01', title: 'July New Month Update', changes: [ 'Integrated standalone Last.fm scrobbling support', 'Added collapsible sidebar with icon-only mode', 'Improved search and browsing experience', 'Added history tracking for played songs', 'New Library Artist Page', 'Enhanced audio player with better controls', 'Added settings page for customization options', 'Introduced Whats New popup for version updates', 'Improved UI consistency with new Badge component', 'New Favorites page with album, song, and artist sections', 'New Favortites inside of the Home Page', 'Server Status Indicator removed for better performance', ], breaking: [], fixes: [ 'Fixed issue with audio player not resuming playback after pause', 'Resolved bug with search results not displaying correctly', 'Improved performance for large libraries', 'Fixed layout issues on smaller screens', 'Resolved scrobbling issues with Last.fm integration' ] }, // Example previous version { version: '2025.06.15', title: 'June Final Update', changes: [ 'Added dark mode toggle', 'Improved playlist management', ], breaking: [], fixes: [ 'Fixed login bug', ] } ]; type TabType = 'latest' | 'archive'; export function WhatsNewPopup() { const [isOpen, setIsOpen] = useState(false); const [tab, setTab] = useState('latest'); const [selectedArchive, setSelectedArchive] = useState(CHANGELOG[1]?.version || ''); useEffect(() => { const hasCompletedOnboarding = localStorage.getItem('onboarding-completed'); if (!hasCompletedOnboarding) return; const lastShownVersion = localStorage.getItem('whats-new-last-shown'); if (lastShownVersion !== APP_VERSION) { setIsOpen(true); } }, []); const handleClose = () => { localStorage.setItem('whats-new-last-shown', APP_VERSION); setIsOpen(false); }; const currentVersionChangelog = CHANGELOG.find(entry => entry.version === APP_VERSION); const archiveChangelogs = CHANGELOG.filter(entry => entry.version !== APP_VERSION); // For archive, show selected version const archiveChangelog = archiveChangelogs.find(entry => entry.version === selectedArchive) || archiveChangelogs[0]; if (!currentVersionChangelog) { return null; } const renderChangelog = (changelog: typeof CHANGELOG[0]) => (
{changelog.title && (

{changelog.title}

)} {changelog.changes.length > 0 && (

✨ New Features & Improvements

    {changelog.changes.map((change, index) => (
  • {change}
  • ))}
)} {changelog.fixes.length > 0 && (

🐛 Bug Fixes

    {changelog.fixes.map((fix, index) => (
  • {fix}
  • ))}
)} {changelog.breaking.length > 0 && (

⚠️ Breaking Changes

    {changelog.breaking.map((breaking, index) => (
  • {breaking}
  • ))}
)}
); return ( <> {isOpen && (
{/* Backdrop */}
{/* Dialog content */}
{/* Header */}

What's New in Mice {tab === 'latest' ? currentVersionChangelog.version : archiveChangelog?.version}

{/* Tabs */}
{tab === 'archive' && archiveChangelogs.length > 0 && ( )}
{/* Scrollable content */}
{tab === 'latest' ? renderChangelog(currentVersionChangelog) : archiveChangelog && renderChangelog(archiveChangelog)}
{/* Footer button */}
)} ); }