Skip to content

Conversation

adalpari
Copy link
Contributor

@adalpari adalpari commented Oct 9, 2025

Description

This PR is manually calling FluxC event every time the terms list is loaded. This helps to store the terms locally for quicker access.

Important note: Neither "Site settings" nor "DataView" support offline mode. So, even though the terms are stored locally, the flow when offline is not available.

Testing instructions

  1. Log into a self-hosted site using Application Password
  2. Add categories or tags to the site
  3. Go to "Site Settings" and load categories
  4. Create a post or open an existing one
  5. Go to "Post Settings" -> Categories
  • Categories should be ready straight away

@adalpari adalpari requested a review from Copilot October 9, 2025 15:02
Copy link
Contributor

@Copilot 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 implements local caching of taxonomy terms by integrating FluxC calls within the TermsViewModel to sync and store terms locally for quicker access. The implementation adds a new getLocalData() method to the DataView architecture to support showing locally cached data before network updates.

  • Adds FluxC integration to store taxonomy terms locally when they are fetched from the network
  • Updates the DataView architecture to support showing local data before network requests
  • Modifies several ViewModels to properly initialize and leverage the local data functionality

Reviewed Changes

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

Show a summary per file
File Description
TermsViewModel.kt Core implementation adding FluxC integration and local data support for taxonomy terms
DataViewViewModel.kt Base class updates to support displaying local data before network requests
ApplicationPasswordsViewModel.kt Adds initialization call to enable local data functionality
SubscribersViewModel.kt Adds initialization call to enable local data functionality
DataViewViewModelTest.kt Test updates to ensure proper initialization during testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dangermattic
Copy link
Collaborator

dangermattic commented Oct 9, 2025

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 9, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr22273-8ee9e69
Commit8ee9e69
Direct Downloadwordpress-prototype-build-pr22273-8ee9e69.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 9, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr22273-8ee9e69
Commit8ee9e69
Direct Downloadjetpack-prototype-build-pr22273-8ee9e69.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 26.74419% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.86%. Comparing base (29dbe55) to head (8ee9e69).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
.../wordpress/android/ui/taxonomies/TermsViewModel.kt 12.28% 50 Missing ⚠️
...wordpress/android/ui/dataview/DataViewViewModel.kt 69.56% 4 Missing and 3 partials ⚠️
...plicationpassword/ApplicationPasswordsViewModel.kt 0.00% 3 Missing ⚠️
...ess/android/ui/subscribers/SubscribersViewModel.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22273      +/-   ##
==========================================
- Coverage   39.88%   39.86%   -0.02%     
==========================================
  Files        2168     2168              
  Lines      102823   102894      +71     
  Branches    14830    14840      +10     
==========================================
+ Hits        41007    41015       +8     
- Misses      58339    58399      +60     
- Partials     3477     3480       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adalpari adalpari marked this pull request as ready for review October 9, 2025 17:15
@adalpari adalpari requested a review from dcalhoun October 9, 2025 17:15
@adalpari adalpari changed the title CMM-801 create sync taxonomies calls in flux c CMM-801 create sync taxonomies calls in fluxC Oct 9, 2025
Copy link

sonarqubecloud bot commented Oct 9, 2025

Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

LGTM. Test plan succeeded for me.

@adalpari adalpari merged commit 938529e into trunk Oct 9, 2025
25 checks passed
@adalpari adalpari deleted the feature/CMM-801-Create-sync-taxonomies-calls-in-FluxC branch October 9, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants