feat: use native slider for playback (#88)#109
Draft
jsit wants to merge 35 commits into
Draft
Conversation
jsit
force-pushed
the
feat/88-native-playback-slider
branch
from
November 15, 2025 04:26
c4cd1dd to
68aa47b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the custom DIY slider implementation with the native @react-native-community/slider component to improve maintainability, accessibility, and provide a more native feel for playback controls.
Key changes:
- Introduces new
PlaybackSlidercomponent wrapping@react-native-community/slider - Removes complex gesture handling code using
react-native-reanimatedandreact-native-gesture-handler - Simplifies the codebase by eliminating ~200 lines of custom slider logic
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/PlaybackSlider.tsx | New component wrapping the native slider with TrackPlayer integration |
| src/app/Schedule/ShowDetailsPage.tsx | Replaces custom progress bar/gesture code with PlaybackSlider component |
| src/app/Schedule/ArchivedShowView.tsx | Replaces custom progress bar/gesture code with PlaybackSlider component |
| package.json | Adds @react-native-community/slider dependency (v5.1.1) |
| package-lock.json | Lock file update for new dependency |
| ios/Podfile.lock | iOS native dependency update for slider component |
Comments suppressed due to low confidence (1)
src/app/Schedule/ShowDetailsPage.tsx:68
- The
useMemohere is unnecessary and potentially problematic. TheuseProgress()hook already returns a stable object reference that updates when progress changes. Wrapping it inuseMemowithprogressHookas a dependency doesn't provide any benefit since the hook result already handles its own memoization. Additionally,progressHookwill never be falsy/null in normal operation, so the fallback|| { position: 0, duration: 0 }is unnecessary.
Consider simplifying to:
const progress = useProgress();And remove the progressHook variable entirely.
const progressHook = useProgress();
const progress = useMemo(
() => progressHook || { position: 0, duration: 0 },
[progressHook],
);
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat: stop playback, don't pause (#30) * fix: simplify styles * fix: use icons for home screen play/pause * Update src/app/Schedule/ArchivedShowView.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: pause archives, don't stop them * fix: live should stop, archive should pause * feat: allow jump/forward back on archive playback * fix: add missing utils file * chore: remove unused hook * fix: undo stop for preview * chore: remove unused import * fix: fix auto-paused state regression * fix: add jumpinterval options * adds missing event listeners to handle lock screen jump forward/backward controls * chore: lint * fix: update jump intervals from 15 to 30 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: alexandersimoes <alexandersimoes@gmail.com>
…ck-slider * origin/main: feat: add vertical scrollbars (#144) (#145) chore: add husky and lint-staged (#137) fix: add right padding to show artwork (#143) (#154) chore: fix old relative imports (#139) chore: remove unused currentShowRef chore: remove unneeded currentShow code refactor: simplify mainContent() call get current show from RecentlyPlayedService to fix highlighting refactor: split chained ternaries on RecentlyPlayed for readability
…yback-slider * origin/develop: feat: add show description to show detail page (#152) (#153) fix: html decode show hosts on home (#147) (#148) feat: use native search on schedule page (#166) chore: add exempt encryption value to plist (#161) fix: fix play button shape on Android (#172) feat: handle remote seek event (#170) fix: handle audio interruptions (#169) fix: fix lock screen play/stop controls (#163) (#164) fix: fix schedule stack background color (#167) docs: some updates to agents files (#149) fix: show artwork on lock screen with live stream (#142) (#162)
…yback-slider * origin/develop: feat: improve native sheet scroll header interaction (#168)
…yback-slider * origin/develop: fix: add fix for Xcode 26.4 fmt library (#183)
| @@ -0,0 +1,42 @@ | |||
| import { useProgress } from 'react-native-track-player'; | |||
| import { Platform, StyleProp, ViewStyle } from 'react-native'; | |||
| import { COLORS, CORE_COLORS } from '../utils/Colors'; | |||
Comment on lines
+249
to
+255
| <PlaybackSlider | ||
| style={styles.slider} | ||
| onValueChange={setCurrentPosition} | ||
| onSlidingStart={() => setIsSliding(true)} | ||
| onSlidingComplete={async value => { | ||
| try { | ||
| await TrackPlayer.seekTo( |
Comment on lines
+249
to
+255
| <PlaybackSlider | ||
| style={styles.slider} | ||
| onValueChange={setCurrentPosition} | ||
| onSlidingStart={() => setIsSliding(true)} | ||
| onSlidingComplete={async value => { | ||
| try { | ||
| await TrackPlayer.seekTo( |
Comment on lines
+7
to
+20
| export default function PlaybackSlider({ | ||
| style, | ||
| onValueChange, | ||
| onSlidingComplete, | ||
| onSlidingStart, | ||
| }: { | ||
| style?: StyleProp<ViewStyle>; | ||
| // Returns value in seconds | ||
| onValueChange?: (value: number) => void; | ||
| // Returns value in percentage (0 to 1) | ||
| onSlidingComplete?: (value: number) => void; | ||
| // Returns value in percentage (0 to 1) | ||
| onSlidingStart?: (value: number) => void; | ||
| }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replacing our DIY slider for OS-native sliders from React Native library. Should feel more native, be easier to maintain, and better for accessibility.
I can't actually drag this on the Android emulator, so -- I don't know if that's the emulator's fault or the component's fault, but either way I'm opening this as draft.
This will require an
npm iandpod installto work.Closes #88
Screen.Recording.2025-11-15.at.12.55.18.PM.mov