-
Notifications
You must be signed in to change notification settings - Fork 295
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
Error state for Key Metric Widget / Tiles #7149
Comments
AC ✔️ |
@10upsimon Please note the change in the design of the error state for the KMW tile. |
@jimmymadon I am not sure where I am supposed to reference the new design URL from, as the one I had prior no longer works, instead it takes me to the overall Figma view of all key metrics design components. The most obvious one I could find was https://www.figma.com/file/CdtrHB0HAjfGRWTnTMMQI0/Key-Metrics?type=design&node-id=5409-80974&mode=design&t=NDZafi0d8jEUSTko-0 and this seems to match what is in the issue, so I assume this is correct? |
@jimmymadon (cc @aaemnnosttv) I have temporarily renamed "Implementation Brief" to "(DRAFT) Implementation Brief" in the issue as I would like feedback, but I do not consider it complete given that I still need to flesh out the scenario for when all widgets are erroring. I would, however, appreciate some feedback on this so long, and whether it is too verbose, not verbose enough, too instructions-driven etc. Thank you! -- The handling of all widgets erroring (point 2 in the AC) has me a little stumped though, and the following points are sticking points for me currently:
Apologies if these seem more like "thoughts on paper", they mostly are me thinking aloud while considering the potential means of implementing some points in the AC. |
@jimmymadon @aaemnnosttv I've moved this to IB Review in a bid to get some early feedback on my approach to the IB as a whole. I did not assign either of you directly as I am unsure if that would be considered acceptable in this instance, please do let me know. |
Hi @10upsimon, nice work so far getting stuck in here. With regard to your approach to the IB, I would say the general level of verbosity is good, however we usually avoid the detail of listing code examples in the IB itself, preferring to keep it at a slightly higher level - although we do take a pragmatic approach where sometimes it's appropriate to refer to a PoC PR if we've put one together while investigating the issue. We tend to try to provide a good level of detail in the IB, highlighting things that will be useful and giving a useful amount of direction to the implementer, without essentially writing a transliteration of the code that will be written. The rest of this reply doesn't directly follow the structure of your questions, but I felt a more holistic overview of things would be useful while hopefully providing enough information to answer your q's. That said, please let me know if there's anything you would like me to answer more directly. As a bit of background, it's worth me pointing out that at present we do support the concept of combining all widgets within a widget area into a single widget when they all share the same state - "state" here referring to them rendering a generic component for certain scenarios. Currently these states are the So, this info can help to answer a couple of questions.
I'll now move onto the more specific details relating to the implementation of this issue. Your initial draft, speccing out the Furthermore, as we're going to need It's also evident we can't use One more detail is the naming of this error component - we'll need to provide a wrapper to it, so it would be more streamlined to call this something like Moving onto this wrapper, it will need to use Briefly considering the suggestion of having a single, combined loading state for all widgets, one way to achieve this would be to add another "special widget state", say with a new A final few thoughts: It does occur to me I've gone quite far into a fairly specific approach for implementation - we could consider alternatives, for example we might want to manage the list of errors across all KM widgets via some Redux state, instead of via the metadata approach, but I think managing this as the errors change state would add a degree of complexity that would be a bit excessive for the requirements here. I don't really think there's a sensible alternative to using the existing "combine widgets" approach either. At least not without refactoring the widgets to lift the data fetching out of them so as to be manageable in a centralized manner, but again I think think this would probably add more complexity than it's worth and would break the encapsulation we have with each widget managing its own data requirements. We couldn't really do it in the way you've suggested with a sort of container widget while still leveraging our system as it stands where each widget is rendered by a That all said - please do feel free to consider other approaches too! If a more straightforward approach to anything I've suggested occurs to you, we should certainly give it a good look. As mentioned at the top, I hope this answers your questions but I realise it's a lot to unpack so please let me know if anything is unclear and/or you'd like to jump on a call to discuss this. |
@techanvil thank you so incredibly much for taking the time to explain aspects of the approach in so much detail. Albeit a lot to digest, it gives invaluable context. I'm going to need to take quite some time digesting what you've said and making sense of what and where certain aspects even are, especially before I am in any position to make any suggestions of an alternative approach. -- @techanvil @aaemnnosttv I will state that a lot of what is in the reply is out of my wheel house at the moment, and it's going to come with what is likely to be a healthy sum of hours on my end making sense of it in the context of the code base. If either of you feel that this is going to be detrimental to getting this ticket ready for execution in sprint 106, I'd be totally understanding even you suggest we move the IB phase of the issue to someone who is guaranteed to get it ready for timely execution. |
Thanks @10upsimon, very good point to raise. @aaemnnosttv if you land here before Slack, we have a thread there discussing whether Simon should indeed hand the IB over which it would be great to get your input on. |
Thanks for all the context and good ideas @techanvil and @10upsimon ! The widget API is a bit of a beast to say the least. I realize AC has already been set here, but I'd suggest that we reduce the scope to the first point only – implementing error states for individual tiles as designed without getting into combining widgets. It could be that the effort needed to achieve the monolithic error state is more than it would be worth (maybe we should revisit this state with UX?). Considering this state is likely an edge case, I'm not sure it makes sense to invest a large amount of time on it right now. Generally speaking, I feel any substantial changes to the Widget API should happen in a dedicated issue. Adapting KMW to use it should be the easy part. Apologies for such a brief reply to your very thoughtful and articulate ideas. It seems we may be trying to do a bit too much in this issue. 30 doesn't seem big enough for this 😄 |
Thank you so much @aaemnnosttv, this certainly sounds like a more sensible approach to me. In terms of updating the AC to be reflective of your comment above, should that be done by the original AC author., @jimmymadon in this case? |
Thanks @aaemnnosttv, this sounds like a good way forward to me too - with a slight twist, my thinking is we should create two new issues, one with the reduced AC, and one with the remaining aspects (the combined error state) to be clarified later. That way we avoid future readers of the cut down version having to wade through all the detail above, much of which would no longer be relevant. We should however link to this issue from the new ones for the historical context. We've discussed this on Slack, and @jimmymadon is going ahead to create these new issues. |
Feature Description
Key Metric widget tiles are much smaller than our usual widgets and hence require a new error component to be designed as per the Figma mocks.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
ReportErrorActions
component invalidating the resolution of the selectors that threw an error thereby attempting to resolve those selectors again.ReportErrorActions
component and use thegetErrorTroubleshootingLinkURL
selector.(DRAFT) Implementation Brief
Handling Individual Key Metrics Widget Errors
While the existing
<WidgetReportError>
could in theory be utilised and will correctly render an error message, error description and correct "Retry" handler, it will not display and format the contents in a means that satisfies the Figma design for a single key metric widget error state.Looking into the
<WidgetReportError>
component, and ultimately the<ReportError>
component (used by the<WidgetReportError>
component), the following components should be utilised when creating a new error component for Key Metrics Widgets:<CTA>
and<ReportErrorActions>
. These two components can be combined within said new error component, via a new wrapper, to be styled as per the Figma design.Create a new
<KeyMetricsWidgetError>
component, borrowing logic from the<WidgetReportError>
component, ultimately making use of<CTA>
and<ReportErrorActions>
components to render the error title, the retry button and the troubleshooting URL/CTA.moduleSlug
required for the<ReportErrorActions>
component to re-attempt data fetching correctly.assets/js/googlesitekit/widgets/components/KeyMetricsWidgetError.js
assets/sass/components/key-metrics
Add a mens to check for error states within each of the Key Metrics Widget components. This can be achieved via the
getErrorForSelector
method within auseSelect
implementation using theMODULES_ANALYTICS_4
module, i.e:<KeyMetricsWidgetError>
component as opposed to the<MetricTileNumeric>
component if an error is encountered. This will involve conditional rendering within the return statement of the<LoyalVisitorsWidget>
component, an shorthand example to demonstrate may be as follows:Handling All Key Metrics Widgets Erroring
TBC
Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: