Skip to content

Add sorting to beta features#5392

Merged
sztomek merged 2 commits into
mainfrom
philip/beta-features-sort
Jun 7, 2026
Merged

Add sorting to beta features#5392
sztomek merged 2 commits into
mainfrom
philip/beta-features-sort

Conversation

@geekygecko
Copy link
Copy Markdown
Member

@geekygecko geekygecko commented Jun 5, 2026

It often takes me awhile to find the new beta features as I'm not to sure on the name. This change helps by adding a sort by release date. It will also help us find old feature flags we should remove.

Testing Instructions

  1. Open the app and go to Settings → Beta features
  2. Confirm the list is sorted alphabetically by name (A–Z) by default.
  3. Tap the sort icon in the top app bar.
  4. In the bottom sheet, confirm Name (A–Z) is checked and Release date (newest first) is available.
  5. Select Release date (newest first) and confirm the list reorders to show the most recently added flags first.
  6. Re-open the sort dialog and confirm Release date (newest first) is now the checked option.
  7. Toggle a feature on/off and confirm the current sort order is preserved.

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

Copilot AI review requested due to automatic review settings June 5, 2026 11:54
@geekygecko geekygecko added [Type] Enhancement Improve an existing feature. [Area] Settings labels Jun 5, 2026
@geekygecko geekygecko added this to the 8.14 milestone Jun 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds user-selectable sorting to the Settings → Beta features screen by introducing a sort action in the top app bar and wiring it to an OptionsDialog with “Name (A–Z)” and “Release date (newest first)” options. To enable release-date sorting, each Feature enum entry now includes an addedOn: LocalDate, and new localized strings were added for the sort UI.

Changes:

  • Add SortOrder state + sorting logic to BetaFeaturesViewModel (name or newest-first by addedOn, with name tiebreaker).
  • Add a sort icon to the Beta features top app bar and show an OptionsDialog to select sorting.
  • Add addedOn: LocalDate metadata to each Feature and add localization strings for sort labels and accessibility content description.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt Adds addedOn: LocalDate to feature flags to support release-date sorting.
modules/services/localization/src/main/res/values/strings.xml Adds localized strings for the sort action and the two sort options.
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/viewmodel/BetaFeaturesViewModel.kt Introduces SortOrder and applies sorting when building the feature list/state.
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/BetaFeaturesFragment.kt Adds a sort action in the app bar and opens an OptionsDialog to change sort order.
Comments suppressed due to low confidence (1)

modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/BetaFeaturesFragment.kt:118

  • The list is now re-sortable, but the LazyColumn items are emitted via a for loop with item { ... } and no stable key. When the sort order changes, Compose may reuse item slots by index, which can mis-associate any remembered per-row state (e.g., pressed/interaction/animation state) with the wrong feature. Use items(..., key = ...) keyed by the feature flag key to keep rows stable across reordering.
        LazyColumn(
            contentPadding = PaddingValues(vertical = 16.dp),
        ) {
            for (feature in state.featureFlags) {
                item {
                    SettingRow(

@geekygecko geekygecko marked this pull request as ready for review June 5, 2026 12:21
@geekygecko geekygecko requested a review from a team as a code owner June 5, 2026 12:21
@geekygecko geekygecko requested review from sztomek and removed request for a team June 5, 2026 12:21
Copy link
Copy Markdown
Contributor

@sztomek sztomek left a comment

Choose a reason for hiding this comment

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

This change is welcome indeed! Nice work! 👏
As future improvements, we should also add search by name and change orded (Z->A, date added asc)

@dangermattic
Copy link
Copy Markdown
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 8.14. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@sztomek sztomek merged commit 214ecb0 into main Jun 7, 2026
18 checks passed
@sztomek sztomek deleted the philip/beta-features-sort branch June 7, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Settings [Type] Enhancement Improve an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants