-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hiding dashboard cards: add empty state view #20385
Hiding dashboard cards: add empty state view #20385
Conversation
case .personalize: | ||
return AppConfiguration.isJetpack && FeatureFlag.personalizeHomeTab.enabled |
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 removed AppConfiguration.isJetpack
from here to make it easier to test using the WordPress test target. I'm planning to add AppConfiguration.isJetpack
check to FeatureFlags
instead one we are ready to enable it, the same way it's done for prompts, for example:
case .bloggingPrompts:
return AppConfiguration.isJetpack
@@ -21,6 +21,8 @@ enum DashboardCard: String, CaseIterable { | |||
/// Card placeholder for when loading data | |||
case ghost | |||
case failure | |||
/// Empty state when no cards are present | |||
case empty |
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.
Other state views such as ghost
and failure
are also displayed using DashboardCard
. I kept it consistent.
How does the button look in dark mode? For the button background color I used 'fill color - tertiary' in the design. Which has a light mode and dark mode version. But realise I never specifically called that out. |
You can find the dark mode screenshot in the previous PR #20369. |
@kean ah cool, looks good thanks! |
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.
Thanks! LGTM 👍 Adapts well with dynamic type, dark/light mode, bigger screens, smaller screens, and different orientations.
I agree with using the cell to it consistent. Even though cards.isEmpty || cards.map(\.cardType) == [.personalize]
such code is necessary, it looks like a special case to me compared to other cards.
@kean there're some conflicts. Let me know when you fix them, I will run CI and auto-merge this PR. Thanks! |
Thanks for the review - I fixed the conflicts. |
Related issue: #20296
Previous PRs (dependencies):
There is only one commit in this PR: fb67fbd5.
Add an empty state view in case there are no cards to display on the Home tab.
To test:
Regression Notes
Potential unintended areas of impact
n/a (new feature, doesn't affect the existing cards)
What I did to test those areas of impact (or what existing automated tests I relied on)
I performed manual testing
What automated tests I added (or what prevented me from doing so)
I covered the new logic for displaying the empty state view with unit tests
PR submission checklist:
RELEASE-NOTES.txt
if necessary.