Skip to content

RS Post Settings: Fix dialog selection lost on rotation#22699

Merged
nbradbury merged 1 commit intotrunkfrom
issue/rsposts-dialog-rotation
Mar 17, 2026
Merged

RS Post Settings: Fix dialog selection lost on rotation#22699
nbradbury merged 1 commit intotrunkfrom
issue/rsposts-dialog-rotation

Conversation

@nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Mar 17, 2026

Description

When a user selects a new author, status, or format in the RS Post Settings dialogs and then rotates the device, the selection reverts to the original value. This happens because the dialog's local selection state uses remember which doesn't survive configuration changes.

This PR changes remember to rememberSaveable in StatusDialog, FormatDialog, and AuthorDialog so the selected index is preserved across configuration changes. The other dialogs (PasswordDialog, TextFieldDialog) already used rememberSaveable correctly.

Testing instructions

Dialog selection survives rotation:

  1. Open a post's RS Post Settings screen
  2. Tap on Status and select a different status (e.g., Draft → Pending)
  3. Before tapping OK, rotate the device
  • Verify the selection is still on the newly chosen status
  1. Repeat for the Format dialog
  • Verify the format selection persists through rotation
  1. Repeat for the Author dialog
  • Verify the author selection persists through rotation

Use rememberSaveable instead of remember for the selected index
in StatusDialog, FormatDialog, and AuthorDialog so the user's
choice persists through configuration changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 17, 2026

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@sonarqubecloud
Copy link

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22699-86be205
Build Number1487
Application IDorg.wordpress.android.prealpha
Commit86be205
Installation URL5col7p7o9duvo
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22699-86be205
Build Number1487
Application IDcom.jetpack.android.prealpha
Commit86be205
Installation URL7um97b7bgrvlg
Note: Google Login is not supported on these builds.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.50%. Comparing base (b7c4ddd) to head (86be205).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
...android/ui/postsrs/screens/PostRsSettingsScreen.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22699   +/-   ##
=======================================
  Coverage   37.50%   37.50%           
=======================================
  Files        2298     2298           
  Lines      120741   120741           
  Branches    16531    16531           
=======================================
  Hits        45288    45288           
  Misses      71781    71781           
  Partials     3672     3672           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury marked this pull request as ready for review March 17, 2026 14:57
@nbradbury nbradbury requested a review from adalpari March 17, 2026 14:57
Copy link
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

Looks great!! 🚢 it!

@nbradbury nbradbury merged commit 0a8f644 into trunk Mar 17, 2026
31 checks passed
@nbradbury nbradbury deleted the issue/rsposts-dialog-rotation branch March 17, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants