Skip to content

Conversation

@wzieba
Copy link
Contributor

@wzieba wzieba commented Nov 21, 2025

Related to: AINFRA-548: Migrate ThemeModel

Description

Woo mobile app only uses 4 theme actions (fetch WP.com themes, fetch current theme, activate, install). This PR removes the unused theme infrastructure including starter designs, installed themes management, and database operations that aren't needed by the app and were inherited with FluxC vendoring.

Test Steps

Smoke test theme functionality:

  1. Open the app and navigate to SettingsSite SettingsThemes
  2. Verify the current theme is displayed correctly
  3. Browse available themes and verify they load with names and preview images
  4. Select a different theme and activate it
  5. Verify the theme activation succeeds and the new theme is shown as active
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@dangermattic
Copy link
Collaborator

dangermattic commented Nov 21, 2025

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 23.8. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wzieba wzieba marked this pull request as draft November 21, 2025 14:17
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 21, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit66cad90
Direct Downloadwoocommerce-wear-prototype-build-pr15011-66cad90.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 21, 2025

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

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit66cad90
Direct Downloadwoocommerce-prototype-build-pr15011-66cad90.apk

@wzieba wzieba force-pushed the clean_up_theme_model branch from 63da930 to 68ed834 Compare November 21, 2025 15:50
@wzieba wzieba added the type: technical debt Represents or solves tech debt of the project. label Nov 21, 2025
@wzieba wzieba added this to the 23.8 milestone Nov 21, 2025
@wzieba wzieba requested a review from Copilot November 21, 2025 16:14
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 removes unused theme infrastructure from FluxC to simplify the codebase, retaining only the 4 theme actions needed by the Woo mobile app: fetch WP.com themes, fetch current theme, activate theme, and install theme.

Key changes:

  • Removed starter designs functionality and related API endpoints
  • Removed installed themes management for Jetpack sites
  • Simplified ThemeModel by removing unused fields (description, slug, version, author, screenshot URL, pricing, etc.)
  • Cleaned up database operations and removed delete/remove theme actions

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ThemeStore.java Removed unused payload classes, event handlers, and public methods for starter designs, installed themes, and theme deletion
ThemeSqlUtils.java Removed database operations for installed themes management and mobile-friendly theme queries
ThemeRestClient.java Removed API methods for starter designs, Jetpack installed themes, and theme deletion; simplified theme model creation
ThemeModel.java Removed unused fields and simplified constructors to only include essential properties
ThemeAction.java Removed action enums for starter designs, installed themes, theme deletion, and site themes removal
StarterDesignsResponse.kt Deleted entire file as starter designs feature is removed
ThemeStoreUnitTest.java Updated tests to use parameterized methods and direct SQL access where needed

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

@wzieba wzieba marked this pull request as ready for review November 21, 2025 16:25
@wzieba wzieba requested review from JorgeMucientes and removed request for AdamGrzybkowski November 21, 2025 16:25
@wzieba
Copy link
Contributor Author

wzieba commented Nov 21, 2025

hi @JorgeMucientes 👋 I'm trying to round-robin review requests that, I think, are closer to Kiwi's scope. Are you available for doing reviews, or should I request other team members? :)

@JorgeMucientes JorgeMucientes self-assigned this Nov 24, 2025
@JorgeMucientes
Copy link
Contributor

Hey @wzieba feel free to add me to PR reviews whenever. I may just not be as fast as other folks to get the review done, but I'm definitely part of the pool of reviewers :).
I'll give a look at it this week

Copy link
Contributor

@JorgeMucientes JorgeMucientes left a comment

Choose a reason for hiding this comment

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

Thanks for working on this code clean up @wzieba.

Removed code looks safe and theme feature works as expected! :shipit:

final SiteModel site = SiteUtils.generateWPComSite();
TestSiteSqlUtils.INSTANCE.getSiteSqlUtils().insertOrUpdateSite(site);
assertNull(mThemeStore.getActiveThemeForSite(site));
assertEquals(0, ThemeSqlUtils.getActiveThemeForSite(site).size());
Copy link
Contributor

Choose a reason for hiding this comment

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

Super minor np, a potentially a matter of preference but I think this style is more readable?

Suggested change
assertEquals(0, ThemeSqlUtils.getActiveThemeForSite(site).size());
assertTrue(ThemeSqlUtils.getActiveThemeForSite(site).isEmpty());

No need to change :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is, thanks! Actually, I like assertj assertions the most, so I went with

assertThat(ThemeSqlUtils.getActiveThemeForSite(site)).isEmpty();

in 66cad90 🙂

@wzieba wzieba enabled auto-merge November 27, 2025 16:02
@wzieba wzieba merged commit 0342f46 into trunk Nov 27, 2025
18 checks passed
@wzieba wzieba deleted the clean_up_theme_model branch November 27, 2025 16:02
@wzieba wzieba mentioned this pull request Dec 4, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: technical debt Represents or solves tech debt of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants