-
Notifications
You must be signed in to change notification settings - Fork 887
feat(site): add user activity on template insights #10013
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
Conversation
c729580
to
7518534
Compare
how is colin twice as active as anyone else? 😂 |
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.
idk if error handling is already done somewhere else, and just not showing in the diff, but we should definitely check for errors
</PanelTitle> | ||
</PanelHeader> | ||
<PanelContent> | ||
{!data && <Loader sx={{ height: "100%" }} />} |
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 don't like checking just data
for loading. we do this in a lot of places, and it ends up with lots of places that show spinners instead of error messages.
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 usually handle errors when they are expected like form errors, or possible user actions that can cause an "invalid" state. IMO handling all the errors caused by async can be too much and idk if that adds too much value, to be honest, but I'm open to that.
Maybe could be interesting to start a thread on dev about handling errors in the UI and see if we can come up with a more solid strategy.
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'm also going to put some thoughts on that 🤔. Can we get this work merged and I open the PR to handle the error for all the Insights pages?
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.
fair enough
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.
Is there anything else I should do to get your quality approval? 👀
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.
Not going to treat this as a blocking comment, but does the whole data need to be made a prop, or would it be safe just to have the component receive the users, since that's the only part the component seems like it would ever care about?
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.
Yes, it could but since its goal is to display the UserActivityInsightsResponse
data I think it is ok to use it.
I think it is just easier to maintain and extend using the context object than passing prop by prop.
site/src/pages/TemplatePage/TemplateInsightsPage/TemplateInsightsPage.tsx
Show resolved
Hide resolved
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.
Looks good! Just left one small comment about how much one of the components should be aware of the data coming into it
</PanelTitle> | ||
</PanelHeader> | ||
<PanelContent> | ||
{!data && <Loader sx={{ height: "100%" }} />} |
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.
Not going to treat this as a blocking comment, but does the whole data need to be made a prop, or would it be safe just to have the component receive the users, since that's the only part the component seems like it would ever care about?
Close #9497
Screen.Recording.2023-10-03.at.10.07.32.mov