Blogging Prompt Dashboard Card: show a real prompt#18534
Conversation
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
wargcm
left a comment
There was a problem hiding this comment.
Looks good! Only left a note and had one question I wasn't sure about.
| self.blog = blog | ||
| self.presenterViewController = viewController | ||
| refreshStackView() | ||
| fetchPrompt() |
There was a problem hiding this comment.
Probably not a big deal and just something to note - I noticed this gets called every time the device goes from portrait to landscape. I didn't investigate too much but it looks like the dashboard might be getting recreated and that eventually ends up calling this on a view load.
There was a problem hiding this comment.
I noticed this gets called every time the device goes from portrait to landscape. I didn't investigate too much but it looks like the dashboard might be getting recreated and that eventually ends up calling this on a view load.
Thanks for noting this. It's not typical behavior so it didn't occur to me.
Probably not a big deal
If we were only going to get prompts via fetching, this is something we'd definitely not want to do. But once prompts are cached, it won't be so offensive. In the end, we should fetch only if we don't have a cached prompt. So the fetch should happen once per prompt. In theory. 😄
| bloggingPromptsService.fetchTodaysPrompt(success: { [weak self] (prompt) in | ||
| self?.prompt = prompt | ||
| }, failure: { (error) in | ||
| DDLogError("Failed fetching blogging prompt: \(String(describing: error))") |
There was a problem hiding this comment.
Oh that's a good point. Thanks! I'll show an error message in place of the title in a follow up PR.
|
Thanks @wargcm ! |

Ref: #18429
The dashboard prompt card now fetches one prompt and updates the card accordingly.
To test:
bloggingPromptsfeature flag.Hometab > prompt card.Regression Notes
Potential unintended areas of impact
N/A
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txtif necessary.