Skip to content

Conversation

@shamim-emon
Copy link
Collaborator

@shamim-emon shamim-emon commented Dec 9, 2025

Summary

This PR refactors the way the contact name color is handled in Thunderbird Android. Instead of using the direct reference K9.contactNameColor, it now leverages PreferenceDataStore to manage this setting consistently across the app.

Changes Made

  • Removed direct usage of K9.contactNameColor.
  • Updated tests (MessageHelperTest and related files) to reflect the change in preference management.
  • Minor cleanup to improve maintainability and readability of code that interacts with contact name colors.

Motivation

Using a centralized preference store instead of direct variable references ensures:

  • Consistency: All reads and writes to contact name color go through a single source of truth.
  • Maintainability: Future changes to how contact colors are stored or retrieved will require minimal code modifications.
  • Extensibility: Prepares the codebase for features like theme-specific or account-specific contact color settings.

Impact on Users
This change is internal and does not affect the app’s behavior from a user perspective. Users will continue to see contact name colors as before.

Testing

  • Verified existing tests pass after refactoring.

@wmontwe wmontwe changed the title Replace Direct Usage of K9.contactNameColor With PreferenceDataStore refactor: replace direct usage of K9.contactNameColor with PreferenceDataStore Dec 17, 2025
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

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

LGTM

@wmontwe wmontwe merged commit 1a4b4de into thunderbird:main Dec 17, 2025
12 checks passed
@thunderbird-botmobile thunderbird-botmobile bot added this to the Thunderbird 17 milestone Dec 17, 2025
@shamim-emon shamim-emon deleted the fix-issue-10242 branch December 18, 2025 03:05
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.

Replace Direct Usage of K9.contactNameColor With PreferenceDataStore

2 participants