Skip to content

feat: use native slider for playback (#88)#109

Draft
jsit wants to merge 35 commits into
developfrom
feat/88-native-playback-slider
Draft

feat: use native slider for playback (#88)#109
jsit wants to merge 35 commits into
developfrom
feat/88-native-playback-slider

Conversation

@jsit

@jsit jsit commented Nov 15, 2025

Copy link
Copy Markdown
Member

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 i and pod install to work.

Closes #88

Screen.Recording.2025-11-15.at.12.55.18.PM.mov

@jsit
jsit force-pushed the feat/88-native-playback-slider branch from c4cd1dd to 68aa47b Compare November 15, 2025 04:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PlaybackSlider component wrapping @react-native-community/slider
  • Removes complex gesture handling code using react-native-reanimated and react-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 useMemo here is unnecessary and potentially problematic. The useProgress() hook already returns a stable object reference that updates when progress changes. Wrapping it in useMemo with progressHook as a dependency doesn't provide any benefit since the hook result already handles its own memoization. Additionally, progressHook will 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],
  );

Comment thread src/components/PlaybackSlider.tsx Outdated
Comment thread src/components/PlaybackSlider.tsx Outdated
Comment thread src/app/Schedule/ArchivedShowView.tsx Outdated
Comment thread src/components/PlaybackSlider.tsx Outdated
Comment thread src/app/Schedule/ArchivedShowView.tsx Outdated
@jsit jsit added this to the v1.4.0 milestone Nov 18, 2025
jsit and others added 9 commits November 20, 2025 08:20
…ck-slider

* origin/main:
  fix: fix day grouping for early morning shows (#99) (#125)
  feat: stop playback for live, pause for archive (#30) (#106)
  chore: add path aliases (#111)
  fix: remove logo from schedule page (#118) (#119)
  chore: version bump 1.3.0 (#107)
* 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: adds skip buttons to both the archive view and homescreen (#146)
  docs: add conventional commits format to copilot instructions (#133)
  feat: allow jump forward/back when playing archives (#124)
jsit added 2 commits November 22, 2025 16:32
…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
@jsit jsit removed this from the v1.4.0 milestone Dec 2, 2025
@jsit
jsit requested a review from Copilot December 6, 2025 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated 7 comments.

Comment thread src/components/PlaybackSlider.tsx
Comment thread src/components/PlaybackSlider.tsx
Comment thread src/components/PlaybackSlider.tsx
Comment thread src/app/Schedule/ShowDetailsPage.tsx Outdated
Comment thread src/app/Schedule/ArchivedShowView.tsx Outdated
Comment thread src/app/Schedule/ArchivedShowView.tsx Outdated
Comment thread src/components/PlaybackSlider.tsx Outdated
jsit added 8 commits December 6, 2025 14:08
…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:
  chore: add Bruno config for API debugging (#174)
  chore: bump version to 1.4.0 (#180)
  chore: normalize colors (#138)
…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)
…yback-slider

* origin/develop:
  Add platform-specific user agents for iOS/Android streams (#102)
  test: add tests for ArchivedShowView (#151)
  chore: seekTo is async; await it, and add catch (#173)
  feat: use SectionList for Schedule page (#90) (#184)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Comment thread src/app/Schedule/ArchivedShowView.tsx
Comment thread src/components/PlaybackSlider.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.

@@ -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;
}) {
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.

Create separate component for progress bar / playback scrubber

3 participants