thunderbird-android icon indicating copy to clipboard operation
thunderbird-android copied to clipboard

Issue with disabling Threaded view in settings

Open rezazarchi opened this issue 3 years ago • 2 comments

When I disable the Threaded view in display settings, It doesn't apply to the list immediately. I should close the app and open it again to see threaded view disabled.

To Reproduce Steps to reproduce the behavior:

  1. Go to Settings
  2. Go to General Settings
  3. Go to Display
  4. Uncheck Threaded View
  5. Back to the messages list
  6. Settings didn't apply
  7. We should restart the application to apply

Expected behavior It should apply immediately after uncheck

Environment (please complete the following information):

  • K-9 Mail version: 5.803 (28003)
  • Android version: 11
  • Device: Emulator
  • Account type: IMAP

rezazarchi avatar Aug 29 '21 09:08 rezazarchi

You can fix this by adding a parameter to MessageListActivityAppearance and initializing it with K9.isThreadedViewEnabled. If the value changes, the MessageList activity will be recreated.

https://github.com/k9mail/k-9/blob/51e6820d9289973347c342cab9db763d7fcaee70/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt#L519-L521

I'd love to get a pull request fixing this issue.

cketti avatar Sep 22 '21 11:09 cketti

My comment from PR #6011 that attempted to fix this issue:

I was wrong in the issue comment. Restarting the activity isn't enough because whether or not to show a threaded list is passed as an argument to MessageListFragment.

I see two possible ways to fix this issue:

  1. Create a new instance of MessageListFragment with the correct arguments when this situation is detected.
  2. Instead of using a boolean for ARG_THREADED_LIST, use an enum with values for "enabled", "disabled" and "use app config".

The first option is probably a bit more work. But using it we should also be able to handle the situation where the user is displaying the list of messages in a thread before going to settings and disabling the thread view.

cketti avatar Apr 20 '22 11:04 cketti