Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
--accent-soft: #2a2114;

--font: 'Bricolage Grotesque Variable', -apple-system, system-ui, sans-serif;
--dock-h: 150px; /* reserved space so content never hides under the dock */

color-scheme: dark;
}
Expand Down Expand Up @@ -77,7 +76,6 @@ body {
}

.view__head { margin-bottom: 18px; }
.view__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.view__titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.importbtn { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; margin-top: 6px; }
Expand Down Expand Up @@ -178,10 +176,6 @@ body {
color: var(--text); font-size: 16px; /* 16px = no iOS zoom-on-focus */
padding: 13px 0; outline: none;
}
.searchbar__clear {
border: none; background: none; color: var(--text-faint);
font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.searchbar__icon {
border: none; background: none; color: var(--text-dim);
display: grid; place-items: center; cursor: pointer;
Expand Down Expand Up @@ -282,11 +276,6 @@ body {
.plcard__name { font-size: 16px; font-weight: 600; }
.plrow { display: flex; align-items: center; }
.plrow .row { flex: 1; }
.backbtn {
background: none; border: none; color: var(--accent);
font-family: var(--font); font-size: 15px; font-weight: 600;
padding: 0 0 12px; cursor: pointer;
}

/* ── bottom sheet ────────────────────────────────────────────── */
.sheet-overlay {
Expand Down
8 changes: 0 additions & 8 deletions src/state/useLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,10 @@ export function useTracks() {
return useLiveQuery(() => db.tracks.orderBy('dateAdded').reverse().toArray())
}

export function useStarredTracks() {
return useLiveQuery(() => db.tracks.where('starred').equals(1).toArray())
}

export function usePlaylists() {
return useLiveQuery(() => db.playlists.orderBy('createdAt').reverse().toArray())
}

export function usePlaylist(id) {
return useLiveQuery(() => (id == null ? undefined : db.playlists.get(id)), [id])
}

export function useLyrics(trackId) {
return useLiveQuery(() => (trackId == null ? undefined : db.lyrics.get(trackId)), [trackId])
}
Expand Down
14 changes: 14 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { rm } from 'node:fs/promises'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'

// The public/samples/*.wav tones are dev-only seed fixtures (see src/lib/seed.js,
// gated behind import.meta.env.DEV). Because they live in public/ they'd be
// copied verbatim into the build; strip them from the production output so
// ~2.7MB of audio no user ever plays doesn't ship.
const stripDevSamplesPlugin = () => ({
name: 'melody-strip-dev-samples',
apply: 'build',
closeBundle: async () => {
await rm('dist/samples', { recursive: true, force: true })
},
})

// Content-Security-Policy (defense-in-depth). Injected into index.html for
// PRODUCTION BUILDS ONLY — dev/HMR needs inline scripts + eval, which this would
// block. Sources: app assets are same-origin ('self'); thumbnails come from
Expand Down Expand Up @@ -49,6 +62,7 @@ export default defineConfig(({ command }) => ({
plugins: [
// CSP only in the built HTML — injecting it in dev would break Vite HMR.
command === 'build' && cspPlugin(),
stripDevSamplesPlugin(), // apply:'build' gates it to production
react(),
VitePWA({
// 'autoUpdate' = the new service worker activates and reloads the page as
Expand Down
Loading