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

Migrate watch history to Jetpack Compose #11947

Open
wants to merge 34 commits into
base: refactor
Choose a base branch
from

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Jan 21, 2025

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Rewrite the watch history UI using Jetpack Compose. As part of this change, the ItemList composable was refactored to use separate data classes, in order to further decouple it from the information provided by the extractor and make it more easily reusable.
  • Clean up unused methods in StreamHistoryDAO.
  • Reimplement the watch history retrieval from the Room database using AndroidX Paging for improved efficiency, as it supports pagination.
  • Add stream card and grid composables.
  • Update several relevant dependencies, including the Compose BOM version.
  • Use loading indicator for placeholder items in ItemList.

Before/After Screenshots/Screen Record

Before After
Before After
Screen_recording_20250311_110112.mp4

Fixes the following issue(s)

  • Fixes #

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/giant PRs with more than 750 changed lines label Jan 21, 2025
@ShareASmile ShareASmile added history Anything to do with previously watched stuff rewrite Issues and PRs related to rewrite GUI Issue is related to the graphical user interface dependency Issues and PRs related to dependencies labels Jan 21, 2025
@asandikci
Copy link
Contributor

There should be a confirmation screen after "clear history" button clicked I guess

@Isira-Seneviratne Isira-Seneviratne force-pushed the History-Compose branch 2 times, most recently from 135d560 to e5882af Compare February 9, 2025 15:08
@TobiGr
Copy link
Contributor

TobiGr commented Mar 7, 2025

Is it possible to put get the background, pop up, and play all actions in a single row? The buttons and sort by drop down use a lot of vertical space.
What is the reasoning to make the sort by box not to grow to the full width of its parent container in portrait mode?

@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Mar 8, 2025

Is it possible to put get the background, pop up, and play all actions in a single row? The buttons and sort by drop down use a lot of vertical space. What is the reasoning to make the sort by box not to grow to the full width of its parent container in portrait mode?

A scrollable row could be used to keep the buttons in the same row (at the moment, a FlowRow is used to adjust the buttons if the screen width is too narrow). The sort box could also be included in the same row if needed.

@Isira-Seneviratne
Copy link
Member Author

@TobiGr I revised the UI again to use a segmented button instead of a dropdown.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 15, 2025

thanks. I am wondering whether the checkmark is the right icon to use here. Did you try to use the sort icon?

@Isira-Seneviratne
Copy link
Member Author

No, but I added the Sort By label for clarity.

image

@Stypox
Copy link
Member

Stypox commented Mar 24, 2025

I would put the Clear button in the three-dot menu, it's rarely used and especially should not be pressed on by accident.

@Isira-Seneviratne
Copy link
Member Author

I would put the Clear button in the three-dot menu, it's rarely used and especially should not be pressed on by accident.

It opens a confirmation dialog first.

@Stypox
Copy link
Member

Stypox commented Mar 24, 2025

I know, but I still think it would be better in the 3-dot menu (also because it would use up less space). Consider that if somebody doesn't want history they would just disable it, they wouldn't keep using the clear button.

@Isira-Seneviratne
Copy link
Member Author

Isira-Seneviratne commented Mar 24, 2025

Good point. I made the change.

@ShareASmile
Copy link
Collaborator

No, but I added the Sort By label for clarity.

image

Would you please restore earlier default behavior of "sort by" to "date", it defaults to "views" in this PR.

Also noticed a minor bug: last selected option isn't saved, it switches to sort by "views" even after manually changing it to sort by "date" after reopening the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Issues and PRs related to dependencies GUI Issue is related to the graphical user interface history Anything to do with previously watched stuff rewrite Issues and PRs related to rewrite size/giant PRs with more than 750 changed lines
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants