-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add playful 404 and error pages #3248
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
You can access the deployment of this PR at https://renku-ci-ui-3248.dev.renku.ch |
914dc79
to
6171132
Compare
6171132
to
1192840
Compare
1192840
to
f7d54a4
Compare
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.
This looks nice!
A couple of comments before digging deep into the code:
-
Some content is flashing on the top left when opening a link like the following (see gif)
https://renku-ci-ui-3248.dev.renku.ch/projects/fakename
-
The Error page is blank, except for the footer. I would suggest removing it so that we minimize the probably of crashing the error page itself.
The content is also centered vertically, while it's not for the other error pages; I suggest keeping it consistent, adding only some margin on top
-
The custom CSS classes should be limited to the bare minimum and avoided wherever unnecessary. E.G. We can use the bootstrap
w-100
instead ofwidth: 100%;
P.S. Sorry I missed that this PR was still a draft 🤦 |
f7d54a4
to
631645f
Compare
Thanks, @lorenzo-cavazzi, for your helpful suggestions. Regarding the flashing information, I'm unsure how to address it. The info is the loading message indicating what is being searched for, but since, in the best case, this query is resolved quickly, it shows our 'not found' page in seconds. There isn't enough time to read the loading message. So, I am not sure whether to delay the query response or leave it as it is. Do you have a suggestion for this case? |
30ad2ab
to
b9e0417
Compare
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.
Great to see these components being standardized! 🙌
I noticed a few sub-optimal solutions (see inline comments -- and please feel free to justify your changes if you feel I missed the reason).
Even tho they mostly do not impact the users, we should try to avoid bad patterns we used in the past (like prop drilling, inconsistent spaces, unnecessary abstraction layers) so that it's easier to maintain the code in the long term 🙂
client/src/not-found/OopsImage.tsx
Outdated
export default function OopsImage({ className, id }: OopsImageProps) { | ||
return ( | ||
<svg viewBox="0 0 211.64 54.61" className={className} id={id}> |
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.
Same here. You can add IDs and add classes straight to the img
instead of passing them down to the additional level of abstraction
<div className={cx("d-flex", "justify-content-center", "w-100")}> | ||
<div className={cx(styles.errorNotFoundContainer, "m-auto")}> | ||
<Row> | ||
<Col className={cx("p-4", "mt-5")}> |
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.
There is an interesting combination of classes here 😄
- The custom style interferes with automatic margins forcing the content to a specific width so that on larger screens there is an additional white space on the right.
I suggest dropping that div entirely, together with the fixed width, and letm-auto
do its job.
What's the reason for the fixed width? If you wish to avoid wrapping, you could usetext-nowrap
. - There is an additional "row-col" layer that feels unnecessary here. Perhaps that's a leftover after trying a multi-column layout?
- There are multiple classes that are adding space to the top. The final result is a space between the top border and the first component that is a combination of
mt-5
+p-4
+mt-3
, ending up with a semi-random number of pixels. I suggest avoiding this pattern because it makes keeping spacing consistent throughout the application much harder.
In this case, you could remove the classes from the children components and let the topmost component handle also the space on top.
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.
Please double-check the other pages that implement a similar pattern. This is used in several places in this PR
c22d815
to
ef01169
Compare
ef01169
to
014abfe
Compare
@andre-code looks good now! There is something off with "oops" images used for the error pages. In my case, they don't show up. It's probably just something with the
|
{children} | ||
</Sentry.ErrorBoundary> | ||
); | ||
} | ||
|
||
function ErrorPage() { | ||
const ErrorPage = () => { |
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.
Use the function
coding style here.
return ( | ||
<Sentry.ErrorBoundary onError={onError} fallback={ErrorPage}> | ||
<Sentry.ErrorBoundary onError={onError} fallback={fallbackErrorPage}> |
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 not sure I get why you cannot just use ErrorPage
here.
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.
Lgtm 🚀
Tearing down the temporary RenkuLab deplyoment for this PR. |
Playful 404 and error pages
Cases to test:
Cases current Renku
Cases Renku 2.0
Screenshots

fix #3235
/deploy