-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Redesigned the exception pages #20951
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
@@ -0,0 +1,42 @@ | |||
{% block favicon_symfony_ghost %} | |||
{# PNG file encoded as base64 #} | |||
{% spaceless %} |
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.
spaceless is wrong. It won't remove anything as there is no HTML tag there. Use whitespace control instead
{% endblock %} | ||
|
||
{% block icon_chevron_left %} | ||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="M1427 301L896 832l531 531q19 19 19 45t-19 45l-166 166q-19 19-45 19t-45-19L429 877q-19-19-19-45t19-45l742-742q19-19 45-19t45 19l166 166q19 19 19 45t-19 45z"/></svg> |
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.
what about putting them in .svg
files instead, and including them as @Twig/Exception/image/chevron_left.svg
instead, as done in the WebProfiler ? It would mean that SVG icons are managed as real SVG files (allowing github and other tools to preview them for instance)
} | ||
//]]></script> | ||
</div> | ||
</div> |
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.
why an empty div ?
@@ -139,4 +139,5 @@ | |||
|
|||
{% block body %} | |||
{% include '@Twig/Exception/exception.html.twig' %} | |||
{{ include('@WebProfiler/Profiler/base_js.html.twig') }} |
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 makes it impossible to use a debug environment where the WebProfilerBundle is not enabled.
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. This exception_full
thing is still work in progress. I'm having some problems with the special exceptions managed by ExceptionHandler
Nice work! Looking at the screenshots, I saw that the plain text stack traces do not include function parameters anymore. E.g. it only says |
@Tobion good catch, I missed this change. I think that the plain-text version should keep the args, otherwise copy/pasting the plaintext trace in a bug report will give only partial info |
@Tobion @stof yes, that's done on purpose. The main reason is that I wanted to have the same stack traces as the rest of the industry (from Java to Node.js). @stof made me change it a bit to display the (ugly) full namespace of the classes. But I don't think adding the args is necessary there. Java, Node.js, etc. don't do that and we already show that information in the first panel, which is where a developer should always look for info (the stack trace is to just share some info about the exception with other colleagues or publicly). Another reason is that arguments can contain highly sensitive information. In the Symfony repo we regularly ask users to share the stack traces. We don't want them to share critical information. That's why we also remove your local project directory in the file paths (the first panel shows the absolute file paths when you put your mouse over the file paths, but the stack traces only shows paths relative to the project root directory). |
@javiereguiluz: Please take a look on how tracy/tracy does it. We've replaced the default exceptions with that via TracyBundle in all of our projects. The exceptions are a lot more detailed and having having dumps deduped in production in the log directory is invaluable. |
Very nice job @javiereguiluz! Some little notes:
|
In the sense of DX I suggest the visible source snippet should be the first user land code, not from vendor/* libraries. What do you think? |
(I haven't replied to most of your comments yet ... but I'm reading them with keen interest, so please keep adding comments and proposing changes. Thanks!) |
First off: amazing work. Love the direction. Think this should absolutely be the basis for whatever eventually makes it into
|
As @mvrhov mentioned, nette/tracy does a really nice job; it is definitely worth taking a look at their live examples to glean some inspiration for this Symfony exception page re-design/re-write. I love the simplicity, yet the power, of the call stack functionality. |
Indeed. I think it would be useful to include the Environment, HTTP request, HTTP response as this could be related to the failure. Concerning the parameters, is it possible add a JavaScript toggle to hide/show them? |
The red header is a bit too much. |
@gaetan-petit I'm having mixed feelings on that, the exception only happens when something is wrong and red indicates danger giving you a direct indication something is wrong, so only the upper bar would a bit small. But when you use a dark UI or can't bare bright colors I can imagine this would be to much. |
@gaetan-petit I actually like the move away from dull grays, on both the redesigned debug toolbar and profiler pages, as well as this new exception pages. |
@javiereguiluz what is the status of this PR ? Are you continuing the work ? |
Yes, I'm continuing the work ... but I'm taking a break here to think about your comments and proposals. |
Any news? Do we want this to be ready for 3.3? |
I'll have this ready for Symfony 3.3 (we're still 7 weeks away from the "feature freeze"). I want to make some of the changes proposed by reviewers. |
Last call for 3.3. |
OK, I've updated this PR to make it mergeable. I've made these changes as requested by reviewers:
I've decided to ignore these suggestions:
|
@javiereguiluz Looks like this will be a great change. Can't wait for its inclusion! |
The failing tests on AppVeyor are unrelated. Please tell me if I can do anything else to make this mergeable for 3.3. Thanks! |
Thank you @javiereguiluz. |
It seems something is broken 😭 cleared, cache bootstrap file, assets. No dice. According to Firebug the Edit. It seems |
…ustmi) This PR was squashed before being merged into the 3.3 branch (closes #22439). Discussion ---------- [DX] [TwigBundle] Enhance the new exception page design | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - - [x] Fix the problem with wrapping wide lines (#20951 (comment)) I got motivated by recent PR #20951 and redesigned the exception page even more. Compare before:  with after:  (Ignore the the "sf" toolbar icon in the middle of the page. This is how Firefox does full-page screenshots.) The most noticeable changes: - removed double line spacing (it just does not feel natural) - file context increased from 3 to 10 lines (it helps me to better orientate in the code) - added horizontal scrollbar for the cases when the code is wider - the highlighted line color is more saturated in order to be noticed easily Commits ------- 43212b9 [DX] [TwigBundle] Enhance the new exception page design
…ustmi) This PR was squashed before being merged into the 3.3 branch (closes #22439). Discussion ---------- [DX] [TwigBundle] Enhance the new exception page design | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - - [x] Fix the problem with wrapping wide lines (symfony/symfony#20951 (comment)) I got motivated by recent PR symfony/symfony#20951 and redesigned the exception page even more. Compare before:  with after:  (Ignore the the "sf" toolbar icon in the middle of the page. This is how Firefox does full-page screenshots.) The most noticeable changes: - removed double line spacing (it just does not feel natural) - file context increased from 3 to 10 lines (it helps me to better orientate in the code) - added horizontal scrollbar for the cases when the code is wider - the highlighted line color is more saturated in order to be noticed easily Commits ------- 43212b9a90 [DX] [TwigBundle] Enhance the new exception page design
This PR was squashed before being merged into the 3.3-dev branch (closes symfony#20951). Discussion ---------- Redesigned the exception pages | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#20620 | License | MIT | Doc PR | - Here are some before/after screenshots: | Before | After | --- | --- |  |  | Before | After | --- | --- |  |  | Before | After | --- | --- |  |  --- And here is the new design in action because everything is very dynamic and you can click anywhere to reveal/collapse things:  Commits ------- 9d0c263 Redesigned the exception pages
Here are some before/after screenshots:
And here is the new design in action because everything is very dynamic and you can click anywhere to reveal/collapse things: