Skip to content

Conversation

@konstantiniiv
Copy link
Collaborator

@konstantiniiv konstantiniiv commented Dec 3, 2025


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Copy link
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 refactors the membership tier UI mapping logic from an ID-based approach to a color-based approach, simplifying the codebase and making it more maintainable by eliminating hardcoded tier ID constants.

  • Replaced ID-based tier resource mapping with color-based mapping using CoverColor enum codes
  • Removed unused tier ID constants (FREE_ID, PLUS_ID, PLUS_MONTHLY_ID, PRO_ID, PRO_MONTHLY_ID, ULTRA_ID, ULTRA_MONTHLY_ID)
  • Consolidated duplicate mapping logic into a single reusable getIconsForColor() function

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
payments/src/main/java/com/anytypeio/anytype/payments/screens/TierPreviewView.kt Refactored tier-to-resource mapping functions from ID-based switch statements to color-based logic using a new helper function, significantly reducing code duplication and complexity
core-models/src/main/java/com/anytypeio/anytype/core_models/membership/MembershipConstants.kt Removed unused tier ID constants that are no longer needed with the new color-based mapping approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@konstantiniiv konstantiniiv merged commit e3d84b7 into release/0-42-0 Dec 3, 2025
10 checks passed
@konstantiniiv konstantiniiv deleted the droid-3951-change-in-app-product branch December 3, 2025 14:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants