10000 feature #49887 [WebProfilerBundle] Add clickable entry view to debug … · symfony/symfony@847416f · GitHub
[go: up one dir, main page]

Skip to content

Commit 847416f

Browse files
feature #49887 [WebProfilerBundle] Add clickable entry view to debug toolbar (PhilETaylor)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [WebProfilerBundle] Add clickable entry view to debug toolbar | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Just a proposed idea. One of the great parts of the tool bar is the Clickable IDE integration to quickly jump to the Controller method that the page is rendered from. example: <img width="409" alt="ScreenShot-2023-03-31-21 01 07" src="https://user-images.githubusercontent.com/400092/229218485-e07d2588-9421-453a-a4cb-93c0d34f13e1.png"> One thing I find myself doing often is needing to get to the rendered view (a twig returned by the controller method with `return $this->render('template.twig.html,[]);` etc. To do that I need to Hover the toolbar left corner, move up and click the controller, wait for phpStorm to load the controller file, then scroll down to find the rendered view, then go and find it manually in the tree (or with the [phpStorm Symfony plugin (amazing plugin)](https://plugins.jetbrains.com/plugin/7219-symfony-support) use the gutter icon to select the view). After this PR the first template used in the stack will be rendered into to the twig debug toolbar (much like the controller in the request toolbar) and will be clickable if the [IDE integration is enabled](https://symfony.com/doc/current/reference/configuration/framework.html#ide) meaning less clicks to get from the webpage to the twig template to make changes in HTML quickly. Just a thought, would make less clicks...thoughts? <img width="551" alt="ScreenShot-2023-03-31-20 46 24" src="https://user-images.githubusercontent.com/400092/229217786-e516c8a5-817d-4767-8d85-60521265b1a0.png"> Commits ------- 1c6152e [WebProfilerBundle] Add clickable entry view to debug toolbar
2 parents e70f359 + 1c6152e commit 847416f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Add a "role=img" and an explicit title in the .svg file used by the web debug toolbar
88
to improve accessibility with screen readers for blind users
9+
* Add a clickable link to the entry view twig file in the toolbar
910

1011
6.1
1112
---

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/twig.html.twig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@
4646
{% endset %}
4747

4848
{% set text %}
49+
{% set template = collector.templates|keys|first %}
50+
{% set file = collector.templatePaths[template]|default(false) %}
51+
{% set link = file ? file|file_link(1) : false %}
52+
<div class="sf-toolbar-info-piece">
53+
<b>Entry View</b>
54+
<span>
55+
{% if link %}
56+
<a href="{{ link }}" title="{{ file }}" class="stretched-link">
57+
{{ template }}
58+
</a>
59+
{% else %}
60+
{{ template }}
61+
{% endif %}
62+
</span>
63+
</div>
4964
<div class="sf-toolbar-info-piece">
5065
<b>Render Time</b>
5166
<span>{{ time }} ms</span>

0 commit comments

Comments
 (0)
0