Skip to content

Migrate Content settings screen to Compose (KMP) - #13931

Closed
awaisdev5765 wants to merge 3 commits into
TeamNewPipe:devfrom
awaisdev5765:feature/content-settings-compose
Closed

awaisdev5765 wants to merge 3 commits into
TeamNewPipe:devfrom
awaisdev5765:feature/content-settings-compose

Conversation

@awaisdev5765

Copy link
Copy Markdown

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

This migrates the Content settings screen to the new Compose/KMP shared module, following the established VideoAudioSettingsScreen pattern:

  • ContentSettingsScreen (Compose) + ContentSettingsViewModel (@KoinViewModel) + ContentPreferences: app language (Android 13+ system locale settings), image quality (values matching the legacy settings_keys.xml), and YouTube restricted mode.
  • ContentActions interface with an AndroidContentActions actual — opens the system app-locale settings and reads the current language label. Image-cache wipe, restricted-mode cookie update, and localization reload are deliberately marked TODOs: they depend on app-module classes (CoilHelper, DownloaderImpl, NewPipe.setupLocalization) which the shared module can't reference yet. Happy to add hooks in a follow-up if a different direction is preferred.
  • Wired into Destination + navModule() + the settings home: SettingsCategoryType.CONTENT now resolves one of the // TODO: wire remaining sub-screens cases in SettingsHomeScreen.
  • Adds the needed string resources to the shared strings.xml.

This is an incremental migration — the legacy ContentSettingsFragment remains untouched and authoritative until full migration.

Before/After Screenshots/Screen Record

  • Before: Settings → Content only exists in the legacy PreferenceFragment; the Compose settings home shows "Content" as a non-functional row.
  • After: tapping "Content" in the Compose settings home opens the new Compose screen with working app-language (Android 13+), image-quality and restricted-mode settings.

Fixes the following issue(s)

  • None directly — incremental step of the Compose/KMP migration (resolves one of the // TODO: wire remaining sub-screens cases in SettingsHomeScreen).

Relies on the following changes

  • None

Testing/QA

Devices
  • Not yet tested on device/emulator — this PR compiles against the existing patterns but a build run is needed; CI on this PR will verify compilation, and I will test on a device and update this section.
Steps for testing
  1. Build and run the app, open Settings (new Compose settings home)
  2. Tap "Content"
  3. Tap "App language" → system app-locale settings opens (Android 13+)
  4. Change "Image quality" → selection persists; cache-wipe snackbar appears once the Coil hook is wired (currently a TODO in AndroidContentActions)
  5. Toggle YouTube restricted mode → persists
APK for 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

Implements TeamNewPipe#8981 (long-press Clear cache action on the app icon) and
partially implements TeamNewPipe#10448 (keyboard shortcuts: space/media keys for
play-pause, J/L for seek, M for mute) as a gift to the project.
Hardware keyboard users reported that arrow keys initiate focus
jumps between player UI elements instead of seeking. On non-TV
devices, LEFT/RIGHT now seek and D-pad-center toggles playback.
TV D-pad navigation behavior is unchanged.
Adds ContentSettingsScreen/ViewModel/Preferences to the shared module
following the established settings-screen pattern, wires it into the
settings home navigation (SettingsCategoryType.CONTENT), and introduces
ContentActions for platform-specific behavior. Image cache wipe,
restricted-mode cookies and localization reload are marked as TODOs —
they need app-module hooks. Legacy ContentSettingsFragment behavior
is preserved until full migration.
@github-actions github-actions Bot added size/large PRs with less than 750 changed lines template-ignored labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Please link this PR to an existing issue you are assigned to. Assignees are expected to discuss the details of the PR beforehand. This PR will be closed if it is not linked to an issue.

@sonarqubecloud

Copy link
Copy Markdown

@awaisdev5765

Copy link
Copy Markdown
Author

This PR is part of the Compose migration tracked in #11198 — it migrates the Content settings screen, resolving one of the TODO: wire remaining sub-screens cases in SettingsHomeScreen (SettingsCategoryType.CONTENT).

@theimpulson

Copy link
Copy Markdown
Member

@awaisdev5765 thanks for the PR. I see you agreed to the contribution guidelines but did not really follow it. Specifically:

If you want to help out with an existing bug report or feature request, leave a comment on that issue saying you want to try your hand at it. Please wait for a response from the maintainers before starting development.

@theimpulson

Copy link
Copy Markdown
Member

Did you use any AI assistants to help you when working on this PR? If so, how much of the work was done with it?

* "Clear cache" long-press shortcut on the app icon, so that users can wipe the
* caches without having to open the app and dig through the settings.
*
* See https://github.com/TeamNewPipe/NewPipe/issues/8981

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't seems connected to the migration nor I see any discussion on this issue as well that we want to work on this

@theimpulson

Copy link
Copy Markdown
Member

I don't see any implementation done for non-android part of the screens (jvm and iOS). Was there a reason those weren't migrated?

@TobiGr TobiGr added rewrite Issues and PRs related to rewrite settings Relating to NewPipe settings labels Oct 20, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Rewrite Oct 20, 2026
@theimpulson theimpulson added the spam This change violates contribution guidelines of NewPipe. label Oct 21, 2026
@theimpulson

Copy link
Copy Markdown
Member

Closing due to violating contribution guidelines of NewPipe.

@github-project-automation github-project-automation Bot moved this from In Progress to Done in Rewrite Oct 21, 2026
@AudricV AudricV removed this from Rewrite Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rewrite Issues and PRs related to rewrite settings Relating to NewPipe settings size/large PRs with less than 750 changed lines spam This change violates contribution guidelines of NewPipe. template-ignored

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants