Skip to content
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

Style the error boundaries component #1910

Merged
merged 7 commits into from
Feb 7, 2022
Merged

Conversation

Tbaut
Copy link
Collaborator

@Tbaut Tbaut commented Feb 2, 2022

closes #41 ooooh that feels good!

I wasn't able to use createStyle, the app kept crashing, saying I wasn't able to use useTheme. so I did this all manually 🤷‍♂️.

Edit: error boundaries are a weird kind of component based on old fashion classes where you can't use hooks basically https://blog.lookitskris.com/error-boundaries-hooks/

image
image


Submission checklist:

Layout

  • Change looks good in the desktop web ui
  • Change looks good in the mobile web ui

Theme

  • Components / elements inspected in light mode
  • Components / elements inspected in dark mode

@Tbaut Tbaut requested review from tanmoyAtb and FSM1 February 2, 2022 16:16
@render
Copy link

render bot commented Feb 2, 2022

@render
Copy link

render bot commented Feb 2, 2022

@render
Copy link

render bot commented Feb 2, 2022

@github-actions github-actions bot added the Type: Bug Fix Added to PRs if they are addressing a bug label Feb 2, 2022
@asnaith
Copy link
Member

asnaith commented Feb 2, 2022

I ran this branch locally and temporarily reverted Tanmoy's search fix to test this out. Looking good in both themes.

The close button was not responding to my click action and I also noticed that after around 6 seconds of being displayed the styling for the error disappears and the unstyled error is displayed. Video below:

Screen.Recording.2022-02-02.at.1.29.35.PM.mov

@Tbaut
Copy link
Collaborator Author

Tbaut commented Feb 3, 2022

What you see after some time is the react development error (which is still nice actually) because you run a dev server. This would not be shown in prod. or on render. The reason it is lagging is because this error is being prepared. Close it with the cross at the top right and you'll see the error boundaries component again, and the close button should then work.

@asnaith
Copy link
Member

asnaith commented Feb 3, 2022

What you see after some time is the react development error (which is still nice actually) because you run a dev server. This would not be shown in prod. or on render. The reason it is lagging is because this error is being prepared. Close it with the cross at the top right and you'll see the error boundaries component again, and the close button should then work.

Sounds good 👍 thanks for the explanation. I wasn't sure what was happening there.

Copy link
Member

@asnaith asnaith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested and closed the react development error, all is beautiful 🔥

@tanmoyAtb
Copy link
Contributor

Its amazing how the light and dark theme vars worked out. 👍

I'm not sure how useful the stack part of the modal would be. This is what I got on a local build version.

Screenshot 2022-02-04 at 11 54 29 PM

@asnaith thanks for giving the idea on how to best test this PR :)

@Tbaut Tbaut enabled auto-merge (squash) February 4, 2022 23:48
@Tbaut
Copy link
Collaborator Author

Tbaut commented Feb 4, 2022

Yeah, the stack can be useful, as well as useless, it'll really depend on the error itself!
In my case (and Andrew's as well) it's actually super helpful because we know which component the error is coming from, but it may be obscure in a build indeed..

@Tbaut Tbaut merged commit 58466af into dev Feb 7, 2022
@Tbaut Tbaut deleted the fix/style-errorboundaries-41 branch February 7, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix Added to PRs if they are addressing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a styled Error Fallback component
4 participants