From f0a5ea1de41f2abe7308461f0d1169451068d020 Mon Sep 17 00:00:00 2001 From: Boof2015 <75185879+Boof2015@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:45:09 -0400 Subject: [PATCH] minor ui/ux stuff --- src/app/(tabs)/_layout.tsx | 2 +- src/app/(tabs)/eq.tsx | 10 ++++-- src/app/_layout.tsx | 2 +- src/app/now-playing.tsx | 2 +- src/components/search/QuickSearchOverlay.tsx | 37 +++++++++++++++++++- 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/app/(tabs)/_layout.tsx b/src/app/(tabs)/_layout.tsx index aba9b43..452d8c0 100644 --- a/src/app/(tabs)/_layout.tsx +++ b/src/app/(tabs)/_layout.tsx @@ -11,7 +11,7 @@ export default function TabsLayout() { const colors = useColors(); return ( + ({ }, graphWrap: { flex: 1, - minHeight: 180, + minHeight: 168, marginHorizontal: spacing.lg, }, section: { @@ -697,6 +698,9 @@ const useStyles = createThemedStyles((colors) => ({ paddingTop: spacing.md, paddingBottom: spacing.sm, }, + bottomBarNarrow: { + paddingTop: spacing.xs, + }, preamp: { flex: 1, }, diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index 154aa72..ef4715a 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -363,7 +363,7 @@ export default function RootLayout() { presentation: 'transparentModal', animation: 'none', gestureEnabled: false, - contentStyle: { backgroundColor: 'transparent' }, + contentStyle: { backgroundColor: theme.colors.bgPrimary }, }} /> diff --git a/src/app/now-playing.tsx b/src/app/now-playing.tsx index b7426f7..74f66b1 100644 --- a/src/app/now-playing.tsx +++ b/src/app/now-playing.tsx @@ -1064,7 +1064,7 @@ export default function NowPlayingScreen() { const useStyles = createThemedStyles((colors) => ({ backdrop: { flex: 1, - backgroundColor: 'transparent', + backgroundColor: colors.bgPrimary, }, content: { flex: 1, diff --git a/src/components/search/QuickSearchOverlay.tsx b/src/components/search/QuickSearchOverlay.tsx index 5235a97..530e1ec 100644 --- a/src/components/search/QuickSearchOverlay.tsx +++ b/src/components/search/QuickSearchOverlay.tsx @@ -75,6 +75,7 @@ const PLAYLIST_RESULT_LIMIT = 4; const EMPTY_RECENT_TRACKS_LIMIT = 3; const ALL_TRACK_RESULT_LIMIT = 120; const ALL_ENTITY_RESULT_LIMIT = 80; +const QUEUED_FEEDBACK_MS = 1000; const NAV_ENTRIES: { id: string; @@ -470,12 +471,14 @@ function ResultRow({ result, query, active, + queued, onPress, onQueueTrack, }: { result: SearchResult; query: string; active: boolean; + queued: boolean; onPress: () => void; onQueueTrack: (track: DbTrack) => void; }) { @@ -513,7 +516,7 @@ function ResultRow({ accessibilityRole="button" accessibilityLabel={`Play ${result.track.title} next`} > - + ) : result.kind === 'playlist' && result.playlist.remote ? ( @@ -550,6 +553,8 @@ function QuickSearchPanel({ const [query, setQuery] = useState(initialQuery); const [showAllLibrary, setShowAllLibrary] = useState(false); + const [queuedTrackPaths, setQueuedTrackPaths] = useState>(() => new Set()); + const queuedFeedbackTimers = useRef(new Map>()); const trimmedQuery = query.trim(); const hasQuery = trimmedQuery.length > 0; @@ -558,6 +563,14 @@ function QuickSearchPanel({ return () => clearTimeout(timer); }, []); + useEffect( + () => () => { + queuedFeedbackTimers.current.forEach(clearTimeout); + queuedFeedbackTimers.current.clear(); + }, + [] + ); + const updateQuery = (value: string) => { setQuery(value); setShowAllLibrary(false); @@ -930,6 +943,27 @@ function QuickSearchPanel({ const queueTrack = (track: DbTrack) => { commitHaptic(); + const existingTimer = queuedFeedbackTimers.current.get(track.path); + if (existingTimer) clearTimeout(existingTimer); + + setQueuedTrackPaths((current) => { + if (current.has(track.path)) return current; + const next = new Set(current); + next.add(track.path); + return next; + }); + + const feedbackTimer = setTimeout(() => { + queuedFeedbackTimers.current.delete(track.path); + setQueuedTrackPaths((current) => { + if (!current.has(track.path)) return current; + const next = new Set(current); + next.delete(track.path); + return next; + }); + }, QUEUED_FEEDBACK_MS); + queuedFeedbackTimers.current.set(track.path, feedbackTimer); + void enqueueTop(dbTrackToTrack(track)); }; @@ -1018,6 +1052,7 @@ function QuickSearchPanel({ result={item.result} query={trimmedQuery} active={item.result.kind === 'track' && item.result.track.path === currentPath} + queued={item.result.kind === 'track' && queuedTrackPaths.has(item.result.track.path)} onPress={() => executeResult(item.result)} onQueueTrack={queueTrack} />