Skip to content

Comments

Migrate MessageView Action Visbility Flags to PreferenceDataStore#10542

Open
shamim-emon wants to merge 5 commits intothunderbird:mainfrom
shamim-emon:fix-issue-10540
Open

Migrate MessageView Action Visbility Flags to PreferenceDataStore#10542
shamim-emon wants to merge 5 commits intothunderbird:mainfrom
shamim-emon:fix-issue-10540

Conversation

@shamim-emon
Copy link
Collaborator

@shamim-emon shamim-emon commented Feb 15, 2026

📝 Summary

Message view action visibility (Archive, Delete, Move, Copy, Spam) was still relying on legacy K9.isMessageView preference accessors. This PR migrates message view action visibility logic to use the modern PreferenceDataStore-backed APIs.

🎯 Benefits

  • Removes dependency on legacy static K9 preference calls.
  • Improves testability & reduces tech debt.
  • Aligns with ongoing preference migration efforts.

menu.findItem(R.id.move).isVisible = K9.isMessageViewMoveActionVisible
menu.findItem(R.id.archive).isVisible = canMessageBeArchived && K9.isMessageViewArchiveActionVisible
menu.findItem(R.id.spam).isVisible = canMessageBeMovedToSpam && K9.isMessageViewSpamActionVisible
menu.findItem(R.id.move).isVisible = generalSettingsManager.getConfig().display
Copy link
Contributor

Choose a reason for hiding this comment

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

Bit of a nitpick, but I do think this might look better broken up after the assignment operator, then a second time after the &&. Also, typically we indent four spaces after the &&

Copy link
Collaborator Author

@shamim-emon shamim-emon Feb 19, 2026

Choose a reason for hiding this comment

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

@dani-zilla please let me know if it's alright now

Copy link
Contributor

@dani-zilla dani-zilla left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate MessageView Action Visbility Flags to PreferenceDataStore

3 participants