-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Redesigned the Symfony Profiler #15523
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
👏 👍 |
it seems to be far more accessible then the old version. so ... vote 👍 for this. great work! 👏 |
Big 👍 👏 👏 ! |
I really like the new design. |
|
||
.container { | ||
min-width: 960px; | ||
max-width: 1200px; |
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.
+10000 |
</div> | ||
</div> | ||
{% elseif profile is defined %} | ||
{% set status_code = profile.getcollector('request').statuscode|default(0) %} |
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 if the request collector is not registered ? The template should account for it
@romqin I've added the missing SVG icons. Thanks for reporting the error. @deguif very nice catch! I totally forgot about that. The line is now highlighted again: @romainneutron the problem is that at some point, making the lines longer worsen readability instead of improving it. The classic limit in the print era was around 75 characters per line (including white spaces). The longest line in the current table has 96 chars (and the longest file path text contain up to 134 chars, but it's not an important element). |
} | ||
|
||
|
||
{% verbatim %} |
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 a verbatim tag actually needed here ? and why only on a small part of the template ?
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.
Without the verbatim tag, the selector #tabs input[type=radio]:checked + label
produces an error.
But don't worry about this. The problem is that I dreamed about creating a "pure CSS" design. The tabs and the search form toggle are implemented just with CSS. However, this requires some ugly CSS tricks so the dream turned into a nightmare. I'm going to update this to use JavaScript.
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.
@javiereguiluz which error ? that look weird as I don't see anything looking like the beginning of a Twig block here. This may be a bug in the Twig regex
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've removed the verbatim
tag and the error no longer appears 😲
awesome!!!! |
@javiereguiluz I love the redesign, it's more functional and just looks awesome! One question though, is it by design the code from the exception will remain light themed? |
@javiereguiluz can you also open the DoctrineBundle PR so that I can see what it implies for a bundle supporting both versions of the profiler ? |
In general: Perfect! In more detail: I would change some things :) Some thoughts after playing with it for some minutes:
|
margin-bottom: 0; | ||
} | ||
#menu-profiler li:last-child { | ||
bborder: 0; |
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.
typo?
@wouterj thanks for your review. I've made some tweaks:
Regarding the "summary section", for now we prefer to maintain it as it is. first, because this colored block balances the "too gray / too dark" feeling of the rest of the page. Second because the green/yellow/red background is a very useful visual clue (assuming the user doesn't have problems perceiving colors). Third, the URL looks very short in your example ... but most of the times is way longer (and sometimes very long and it spans two lines!) Lastly, regarding the behavior with high resolution screens, here it is the comparison between maintaining it on the left or centering it. Let's do a quick poll to see what do people like: |
<span class="icon"><svg width="42" height="30" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 42 30" enable-background="new 0 0 42 30" xml:space="preserve"><g><path fill="#3F3F3F" d="M16.1 15.3c0-0.5 0-0.8 0-1.2c0.2-0.1 0.6-0.8 0.7-1.4c0.2 0 0.4-0.2 0.5-0.8c0-0.4-0.1-0.5-0.2-0.6 c0.3-0.8 0.8-3.4-1.1-3.7C15.7 7.2 15.2 7 14.6 7c-2.6 0-2.9 2-2.4 4.2c-0.1 0.1-0.3 0.3-0.2 0.6c0.1 0.7 0.3 0.8 0.5 0.8 c0.1 0.6 0.5 1.3 0.7 1.4c0 0.4 0 0.8 0 1.2c-0.5 1.4-4 1-4.2 3.7h11.2C20.1 16.3 16.6 16.7 16.1 15.3z"/><path fill="#3F3F3F" d="M28.3 10.2c-0.2 0-0.5 0.1-0.7 0.2c-0.2 0.1-0.4 0.3-0.6 0.6c-0.2 0.3-0.4 0.6-0.5 1s-0.2 0.7-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6 0.2-1.2 0.5-1.8c0.3-0.6 0.7-1.1 1.2-1.4c0.5-0.3 0.9-0.5 1.3-0.5 c0.3 0 0.6 0.1 0.9 0.3c0.3 0.2 0.6 0.4 0.8 0.8l0.2-0.9h1l-0.8 3.8c-0.1 0.5-0.2 0.8-0.2 0.9c0 0.1 0 0.2 0.1 0.3 c0.1 0.1 0.2 0.1 0.3 0.1c0.2 0 0.5-0.1 0.8-0.3c0.4-0.3 0.8-0.7 1-1.2c0.3-0.5 0.4-1 0.4-1.6c0-0.6-0.2-1.2-0.5-1.8 c-0.3-0.6-0.8-1-1.5-1.3s-1.4-0.5-2.1-0.5c-0.9 0-1.7 0.2-2.4 0.6c-0.7 0.4-1.3 1-1.7 1.8C24.2 11 24 11.9 24 12.7 c0 0.9 0.2 1.7 0.6 2.4c0.4 0.7 1 1.2 1.8 1.5c0.8 0.3 1.6 0.5 2.5 0.5c1 0 1.8-0.2 2.5-0.5c0.7-0.3 1.2-0.7 1.5-1.2h1 C33.7 15.8 33.4 16.2 32.9 16.6z"/></g></svg></span> | ||
<strong>Security</strong> | ||
</span> | ||
<span class="label {{ collector.enabled ? '' : 'disabled' }}"> |
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 collector.enabled ? 'disabled' }}
?
I prefer the second screenshot (centered page). |
@javiereguiluz : I prefer the first screenshot, but it's right some of the tables/informations deserve more space (timeline for instance). Regarding the 2 heading bars, what do you think about merging them ? (note margins/paddings are not representative) : For smaller screens, the search input would be hidden. |
awesome! 👍 |
awesome, please add! 👍 |
👍 for centered |
@wouterj @OskarStark the problem is that the layout wasn't designed to be displayed centered and it looks really bad 😢 |
hmm, ok then i would leave it as it is und maybe fix the whole problem to center the page later in a separate PR |
I really love the new design, just a few smaller remarks:
|
@apfelbox if it's the same search as the website, it will be "offline": http://symfony.com/search?q=form |
0c9c9f6
to
f971509
Compare
The option 4 looks nicer 👍
|
This PR is now completely finished. We just need some thumbs up from Symfony deciders to merge it. Thanks! The error reported by Travis seems unrelated:
|
</head> | ||
<body> | ||
<body id="{% block body_id %}{{ app.request.query.get('panel', '')|lower }}{% endblock %}"> |
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.
We cannot use app.*
in the web profiler to keep compatibility with Silex.
@javiereguiluz Can you test this redesign with Silex 1.x and 2.x, to validate that we do not break it? |
@fabpot absolutely! I'm going to do it right now. |
In a808fa5 I've made some changes for Silex 1 and 2. Let's review the changes: Silex 2Old toolbar New toolbar New toolbar detail All profiler panels are exactly the same as Symfony, except the following changes: Config panel Logger panel (there is no channel) Events panel (there is no priority) Silex 1First, I cannot make the profiler work for a freshly installed Silex 1 app because of this issue. The solution is to add the following in $app->register(new Silex\Provider\HttpFragmentServiceProvider()); The new toolbar looks the same, but it suffers the same shortcomings of the old toolbar:
|
Perfect!
|
@hason I'd prefer to have this PR merged as it is and then let people experience the new profiler before changing any of the things you mentioned :) |
Thank you @javiereguiluz. |
…mfony Profiler (javiereguiluz) This PR was squashed before being merged into the 1.6.x-dev branch (closes #452). Discussion ---------- Updated the profiler panel for the new version of the Symfony Profiler Refs symfony/symfony#15523 Commits ------- 4bbb4df Updated the profiler panel for the new version of the Symfony Profiler
This PR was squashed before being merged into the 2.8 branch (closes symfony#15523). Discussion ---------- Redesigned the Symfony Profiler | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ### Context Recently, we redesigned the web debug toolbar ([read announcement](http://symfony.com/blog/new-in-symfony-2-8-redesigned-web-debug-toolbar)). We maintained "the spirit" of the original toolbar, but its visual appearance was completely changed. Now it's the turn of the Symfony Profiler. We want to update it to match the new toolbar design and to give it a more modern look and feel. ### The redesign Most of the redesign is focused on updating just the visual appearance, but we've seized this opportunity to make some minor functional changes as well. Testing this pull request in your own applications may be difficult, so we'll provide below a complete walkthrough of the redesign. (Click on the images to see them in full resolution) ### Overview This is the new general structure of the profiler pages:  ### Request panel * Renamed `Request` panel to `Request / Response` * Divided contents into tabs: Request, Response, Session, etc. (this prevents ultra long pages)  ### Timeline panel * Renamed `Timeline` panel to `Performance` * Highlighted the most important metrics * Added "Peak Memory Usage" to those metrics * The timeline graph is now easier to read (font size is slightly larger, updated the color palette, made the canvas wider, etc.) * If there is only one request, the page doesn't distract you with the "Master Request" heading. If there are several sub-requests, headings are now bigger and graphs are more separated.  ### Twig panel * Just a minor update to highlight the important metrics. The rest of the contents remain the same.  ### Exception panel * Just minor design tweaks.  ### Events panel When the `framework.ide` config option is set: * The listeners are now displayed as more evident clickable links. * Bellow the listener we show its full class namespace (if you don't need this information, it doesn't distract you much; if you need it, you don't have to wait for the `<abbr>` tooltip to show it)  When the `framework.ide` config option is NOT set: * In this case the developer cannot click on the listener name to go to that file and line. Therefore, we think it's important to display that information (full class namespace + full file path + line number). At first it may seem that it contains too much information ... but this panel should be more "useful" than "beautiful".  ### Logs panel * Logs are now grouped in: "Info. & Errors" (this is the panel that you need most of the times); "Deprecations" (separated from the normal logs because they are specific to the process of updating your Symfony version); and "Debug" (which are all those messages that you almost never need) * We now show the channel for the log messages (for built-in Symfony channels it may be redundant, but your application can define custom channels)  ### Routing panel * Just a minor redesign and highlighted some information.  ### Forms panel * Not redesigned yet. ### Translation panel * Highlighted the important metrics. * Replaced the old selector by the new tabbed navigation.  ### Security panel * Just a minor redesign and highlighted some information.  ### E-mails panel * Not redesigned yet. ### Doctrine panel * Queries are no longer displayed "shrinked". We display the full query without parameters by default. * The three old actions ("expand", "runnable" and "explain") have been reduced to two actions ("runnable" and "explain")  Here you can see what happens when you click on the "Show runnable query" and "Explain query" links:  ### Debug panel * Not redesigned yet. ### Config panel * This was probably the "ugliest" panel in the old profiler, because of the two first tables. * We now display the information of those tables highlighted in a different way.  ### Search results Results with response status different from 2xx now are highlighted:  ### Other design elements The page title now changes for each section: **Before**  **After**  Empty elements now display a dashed border. This allows to make design more consistent between different section. Besides, once you are used to the new design, your brain will immediately associate that design to an empty element, so you'll no longer need to read the inner text content.  Besides, when the entire panel doesn't have any content, its menu label looks disabled:  Long pages have been break down using a tabs-based navigation:  Below the page header we display a "summary section" which displays the profiled URL and some useful profiling information. The big URL is the natural way to "go back to application" from the profiler:  Besides, the summary background color changes according to the response HTTP status code:  Above the main menu we now display two shortcuts to common operations: "display the 10 most recent profiles" and "search profiles":  The search form in the sidebar has been collapsed and it's revealed when clicking on the "Search" shortcut button:  ----- And that's all! Please tell us what you think about this redesign. **Don't hesitate to criticize anything you don't like or think it's wrong or it's worse than in the previous profiler.** Let's work together to make the new profiler a reality! Thanks! Commits ------- 05773c2 Redesigned the Symfony Profiler
Context
Recently, we redesigned the web debug toolbar (read announcement). We maintained "the spirit" of the original toolbar, but its visual appearance was completely changed.
Now it's the turn of the Symfony Profiler. We want to update it to match the new toolbar design and to give it a more modern look and feel.
The redesign
Most of the redesign is focused on updating just the visual appearance, but we've seized this opportunity to make some minor functional changes as well. Testing this pull request in your own applications may be difficult, so we'll provide below a complete walkthrough of the redesign. (Click on the images to see them in full resolution)
Overview
This is the new general structure of the profiler pages:
Request panel
Request
panel toRequest / Response
Timeline panel
Timeline
panel toPerformance
Twig panel
Exception panel
Events panel
When the
framework.ide
config option is set:<abbr>
tooltip to show it)When the
framework.ide
config option is NOT set:Logs panel
Routing panel
Forms panel
Translation panel
Security panel
E-mails panel
Doctrine panel
Here you can see what happens when you click on the "Show runnable query" and "Explain query" links:
Debug panel
Config panel
Search results
Results with response status different from 2xx now are highlighted:
Other design elements
The page title now changes for each section:
Before
After
Empty elements now display a dashed border. This allows to make design more consistent between different section. Besides, once you are used to the new design, your brain will immediately associate that design to an empty element, so you'll no longer need to read the inner text content.
Besides, when the entire panel doesn't have any content, its menu label looks disabled:
Long pages have been break down using a tabs-based navigation:
Below the page header we display a "summary section" which displays the profiled URL and some useful profiling information. The big URL is the natural way to "go back to application" from the profiler:
Besides, the summary background color changes according to the response HTTP status code:
Above the main menu we now display two shortcuts to common operations: "display the 10 most recent profiles" and "search profiles":
The search form in the sidebar has been collapsed and it's revealed when clicking on the "Search" shortcut button:
And that's all! Please tell us what you think about this redesign. Don't hesitate to criticize anything you don't like or think it's wrong or it's worse than in the previous profiler. Let's work together to make the new profiler a reality! Thanks!