-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature: New Stats #24677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: New Stats #24677
Conversation
Generated by 🚫 Danger |
38a433d to
b743e7c
Compare
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 28433 | |
| Version | PR #24677 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 5b51ea1 | |
| Installation URL | 0p6uqst2l53a0 |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 28433 | |
| Version | PR #24677 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 5b51ea1 | |
| Installation URL | 1518dpjromgag |
|
I didn't make the connection between the "Site Time Zone" wording and the "Greenwich Mean Time" wording on screen. Instead of saying "Stats are reported and shown in your site's time zone", maybe we can put the time zone in the wording: "Stats are reported and shown in your site's time zone: Greenwich Mean Time."? |
|
The card customization seems to be stored app-wide, shared by all sites. What do you think of storing the customization per site? Users may want to see different cards on different sites. |
|
The "Most Downloaded" card on my atomic site says "File Download stats are not available for Jetpack sites". I'm not sure what exactly that means. Is it a paid feature? How can I test it? |
That is not happening, I'm sorry
They don't test, but we plan to do a Call for Testing to get more help testing it.
I'm not sure that's a problem – you just don't do that, and you can easily remove a chart you don't need.
I've also been thinking about it. I think it might be a good idea to fix the first chart, but I'm not sure about "Pages". If you truly don't need it – you'll remove it. Most users will likely never touch customization in the first place. I'll disable removal of the top chart. I think we want to retain some control over it but let the rest of it be fully editable.
That's where the "Info" button comes in – you can tap it an it explains it in detail. I didn't want it to take more space than that. It's already an improvement over the web that doesn't have any notes about the reporting timezone.
I have this on a list for phase 2, but I'm not sure it's worth complicating it. Most users will likely not even touch customization. Most users have a few sites. I don't think it's worth adding. It will complicate it because some users will want app-wide customization and some won't, and the UI will have to accommodate both, which is too complex.
I opened a defect: CMM-640. If you find more defects, please report them on Linear so they could be addressed later. It's an experimental feature, and it will ship with defects unless we have show-stoppers. |
I meant updating the wording in the pop-up, not the time zone text at the bottom of the screen. |
| if additionalSafeAreaInsets.bottom != bottomInset { | ||
| additionalSafeAreaInsets = UIEdgeInsets(top: 0, left: 0, bottom: min(20, bottomInset), right: 0) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot like AutoLayout. Can you implement this using constraints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to eliminate StatsHostingViewController in the scope of https://linear.app/a8c/issue/CMM-631/ipad-show-tabs-in-a-navigation-bar in phase two. The problem and the reason it was needed is that current StatsViewController(legacy) uses UIPageController for switching between pages, which is a bad idea because it's not designed to be used with vertically scrollable content. I plan to refactor it all for the final release.
|
|
||
| if FeatureFlag.newStats.enabled { | ||
| // Main actions | ||
| var mainActions: [UIMenuElement] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: this variable is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be used below: menuElements.append(contentsOf: mainActions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was not clear. By "redundant", I meant that you can put the actions into menuElements directly, without introducing this temporary veriable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, well this class will be removed in 26.2 anyway.
| @@ -90,6 +90,8 @@ struct StatsTrafficDatePickerView: View { | |||
| private extension StatsPeriodUnit { | |||
| var label: String { | |||
| switch self { | |||
| case .hour: | |||
| fatalError("unsupported") | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few of these fatal errors. Replace them with wpAssertionFailure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I forgot to do it. Updated in 1fff562. I used the same returns values as for .day as placeholders.
|
You may want to add JetpackStatsTests to the unit tests test plan, so that it runs on CI. |
|
crazytonyli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to unblock. I have posted comments in the individual PRs listed in #24712.
GitHub is having trouble loading the diff, so I can't comment in the place of the code.
How the card customization is stored in StatsViewModel can be difficult to maintain. It saves TrafficCardConfiguration's default Codable implementation as JSON.
TrafficCardConfiguration has nested properties that are declared and used in other places, whose type declaration may change in the future. If they are changed, the serialization and deserialization may break, which leads to data loss where the display cards go from customized cards to the default ones.







This PR implements the new "Traffic" tab for "Jetpack Stats".
The changes are isolated to the new JetpackStats module, which should make it easier to review – the new code in the module has no risk of introducing regressions to the existing codebase. I limited the number of changes to the existing code – I suggest to focus on that.
In terms of the new architecture and features, I'd suggest asking Claude Code to explain it.
Testing Instructions
Tip: you can use these options at the bottom to re-test the TipKit:
PRs
Dependency: wordpress-mobile/WordPressKit-iOS#843
Screenshots