Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix trick play overflow #186

Merged
merged 3 commits into from
Dec 23, 2024
Merged

Conversation

PartyDonut
Copy link
Collaborator

Pull Request Description

This fixes the trick play window wandering off-screen

Resolves #175

Copy link

sourcery-ai bot commented Dec 21, 2024

Reviewer's Guide by Sourcery

This pull request fixes a bug where the trick play window would wander off-screen by clamping the position of the trick play window to the screen bounds.

Sequence diagram for trick play window positioning

sequenceDiagram
    participant User
    participant VideoProgressBar
    participant Screen

    User->>VideoProgressBar: Scrub video
    VideoProgressBar->>Screen: Get screen width
    Screen-->>VideoProgressBar: Return screen width
    VideoProgressBar->>VideoProgressBar: Calculate position
    VideoProgressBar->>VideoProgressBar: Clamp position
    Note right of VideoProgressBar: Clamp between -10 and<br/>(screenWidth - width)
    VideoProgressBar->>User: Display trick play window
Loading

State diagram for trick play window position clamping

stateDiagram-v2
    [*] --> TrickPlayWindow
    TrickPlayWindow --> CalculatePosition: User scrubs video
    CalculatePosition --> ClampPosition: Position calculated
    ClampPosition --> PositionClamped: Clamp between -10 and (screenWidth - width)
    PositionClamped --> TrickPlayWindow: Update position

    note right of ClampPosition
        New clamping logic prevents
        window from going off-screen
    end note
Loading

File-Level Changes

Change Details Files
Clamp trick play window position to screen bounds
  • The calculated position of the trick play window is now clamped to the screen bounds to prevent it from going off-screen.
  • Updated the calculatedPosition variable to clamp the position between -10 and screenWidth - (chapterCardWidth + 45).
lib/screens/video_player/components/video_progress_bar.dart

Assessment against linked issues

Issue Objective Addressed Explanation
#175 Fix trickplay preview thumbnails being cut off/overflowing on the far left side of the player
#175 Improve the sharpness/pixelation of preview thumbnails to match the official jellyfin client The PR only addresses the positioning/overflow issue. It does not make any changes related to the thumbnail image quality.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @PartyDonut - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@PartyDonut PartyDonut merged commit c845184 into develop Dec 23, 2024
1 check passed
@PartyDonut PartyDonut deleted the bugfix/fix-trickPlay-scrubber branch December 23, 2024 10:43
@PartyDonut PartyDonut added the bug Something isn't working label Dec 23, 2024
@PartyDonut PartyDonut changed the title bugfix: Fix trick play overflow fix: Fix trick play overflow Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Trickplay preview thumbnails are cut off
1 participant