refactor(subscriptions): restructure the screen, share its components, and adopt expressive controls - #1035
Merged
Conversation
…l, player and manager surfaces
…xpressive controls
…ttons to stop the measure crash
…efreshing surface
…ompact kind selector
…erves the feed state
…e stale poll on RESUMED
…just manual ones (#995)
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.
Summary
Splits the 1,309-line subscriptions screen into nine focused files and moves its shared pieces out: one subscribe button now backs the channel page, the player and the manager, and one expressive pull-to-refresh backs every refreshing surface. Adopts M3 Expressive controls on the way, fixes the missing refresh progress bar, and adds channel groups to the channel page.
Related issue
Closes #995
Closes #982
Change type
Validation
./gradlew :app:assembleGithubDebug./gradlew :app:testGithubDebugUnitTestAlso run and passing:
./gradlew spotlessCheck,:app:compileGithubDebugKotlin,:app:compileFossDebugKotlin.Test device and Android version: Xiaomi POCO X6 Pro, HyperOS 3.0.9.0, Android 16
Two crashes were found on device during testing and are fixed here:
ButtonGroupthrowing from its measure policy under a tight width constraint, and the groups dialog painting rows over the dialog container. The performance changes below are structural — they have not been measured with a profiler.Screenshots or recordings
Risk and compatibility
Fixes
isLoading, which the launch refresh deliberately leaves false so the pull indicator does not spin on every start. The channel counts were always published, so the bar now follows those instead. Regression from 2.2.0.SaveToCollectionSheet.AsyncImage, skippingThumbnailUrlResolverand the placeholder fallback that every other avatar in the app uses.|| trueguard, an unreachable selected-avatar branch holding hardcodedColor.Black/Color.White, andcontext.getStringinside composition.BLASTBufferQueue/HWUIframe spam; those tags are now silenced through logcat's filterspec, and the per-channel failure reason is recorded when the fetch fails rather than scraped back out of logcat.Behaviour changes worth knowing about
SubscriptionsViewModelis now activity-scoped on phone (sharedSubscriptionsViewModel()), matching what the TV shell already did. A tab visit no longer builds a fresh instance whoseensureStarted()restarts five collectors and another feed refresh, and feed and scroll state now survive tab switches.Two refresh timers are now gated. The 60 s relative-time tick suspends while nothing observes the feed state, and the 3-minute stale poll runs only while
RESUMED. The tick re-maps, filters and sorts the whole feed, so it was not a cheap clock update.The subscribe button is a split button when subscribed — the leading half toggles notifications, the trailing half opens the menu. It replaces three implementations, two of which were both named
SubscribeButton. Shorts and TV keep their own.New preference
show_channel_group_badges, off by default. With it off the group table is never observed at all.SubscriptionGroupmoved fromui/screens/subscriptions/todata/model/, so the channel page can use it without importing another feature's screen package.Two new fields on existing data classes (
failedChannelReasonson the refresh progress and UI state). No entity or schema change.4 new strings in
values/strings.xml. Other locales are left to Weblate.The change does not introduce secrets, private data, or unexpected telemetry.
New user-facing text uses Android string resources.
Dependency and lockfile changes are intentional and limited to this PR.
Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
Breaking changes and upgrade steps are clearly documented.