Skip to content

Conversation

@kean
Copy link
Contributor

@kean kean commented Jan 26, 2026

Closes CMM-1132: Add WordAds revenue stats to Jetpack app.

This PR adds "Total Payment" and "Payment History" cards.

Screenshot 2026-01-27 at 10 43 24 AM

@kean kean added this to the 26.7 milestone Jan 26, 2026
@kean kean added the Stats label Jan 26, 2026
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

totalAmountOwed = earningsContainer.totalAmountOwed.value

// Convert dictionary to sorted array
var earnings = earningsContainer.wordads.compactMap { (period, data) -> MonthlyEarning? in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll review this part tomorrow again. Ran out of time today. The rest should be good.

@kean kean requested a review from crazytonyli January 26, 2026 23:29
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 26, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30623
VersionPR #25174
Bundle IDorg.wordpress.alpha
Commitd6ae5b3
Installation URL3hotditnt1oa0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 26, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30623
VersionPR #25174
Bundle IDcom.jetpack.alpha
Commitd6ae5b3
Installation URL495cq9fkcvdmo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 27, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@kean kean force-pushed the task/add-earnings branch from 9a35315 to 227c3e5 Compare January 27, 2026 00:18
@kean kean force-pushed the task/add-earnings branch from 227c3e5 to 120a3b8 Compare January 27, 2026 00:59
.background(Constants.Colors.background)
.environment(\.context, context)
.environment(\.router, router)
.onAppear {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use .task, so that you don't have to manually create Task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's simpler. Updated.

components.month = earning.period.month
components.day = 1

guard let date = Calendar.current.date(from: components) else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the earning.period in the site timezone?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The time zone is irrelevant. It only needs to display year and month. This code creates Date in your local timezone and formats it in your local timezone, so there is no drift.

}

var formattedAmount: String {
earning.amount.formatted(.currency(code: "USD"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Looks like we can use the same code to replace the NumberFormatter code above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switch to formatted in other places. It's clear and I think it's faster too.

@kean
Copy link
Contributor Author

kean commented Jan 27, 2026

Hey, thanks for the feedback. I addressed it, and I also slightly improved how the header card looks (see screenshot) and added analytics. It should be good now.

@sonarqubecloud
Copy link

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants