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

[WebProfilerBundle] Add clickable entry view to debug toolbar #49887

Merged
merged 1 commit into from Apr 3, 2023

Conversation

PhilETaylor
Copy link
Contributor

@PhilETaylor PhilETaylor commented Mar 31, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR symfony/symfony-docs#...

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:

ScreenShot-2023-03-31-21 01 07

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) 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 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?

ScreenShot-2023-03-31-20 46 24

@carsonbot carsonbot added this to the 6.3 milestone Mar 31, 2023
@PhilETaylor PhilETaylor changed the title Add clickable entry view to debug toolbar [WebProfilerBundle] Add clickable entry view to debug toolbar Mar 31, 2023
@ahmedyakoubi
Copy link

i'm doing the same thing as you describe and i think this is very cool for DX. hey @javiereguiluz wdyt ?

@Chris53897
Copy link
Contributor

This would be a great improvement and time saver

Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

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

❤️!

@carsonbot carsonbot changed the title [WebProfilerBundle] Add clickable entry view to debug toolbar Add clickable entry view to debug toolbar Apr 1, 2023
@PhilETaylor
Copy link
Contributor Author

PhilETaylor commented Apr 1, 2023

I forgot to mention, without the IDE integration enabled, the link will link to a page showing the source code of the twig file within the profiler view (like it does with the controller) another cool feature we gain here is the quick ability to get from the rendered view, to viewing the twig source code (when IDE Integration is not enabled)

ScreenShot-2023-04-01-17 27 47

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

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

Cool

@carsonbot carsonbot changed the title Add clickable entry view to debug toolbar [WebProfilerBundle] Add clickable entry view to debug toolbar Apr 3, 2023
@nicolas-grekas
Copy link
Member

Thank you @PhilETaylor.

@nicolas-grekas nicolas-grekas merged commit 847416f into symfony:6.3 Apr 3, 2023
6 of 7 checks passed
@PhilETaylor
Copy link
Contributor Author

🚀 Thank you all...

@PhilETaylor PhilETaylor deleted the clickableview6.3 branch April 3, 2023 16:28
nicolas-grekas added a commit that referenced this pull request May 16, 2023
…view (javiereguiluz)

This PR was merged into the 6.3 branch.

Discussion
----------

[WebProfilerBundle] Tweak the HTML code of the Twig entry view

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Stretched links are used to make entire sections, like a card, clickable. See https://getbootstrap.com/docs/5.3/helpers/stretched-link/

Maybe `@PhilETaylor` can answer us about this (he made the original PR to add this in #49887) but I think it wasn't intended to make entire Twig panel clickable to open the template. So, in this PR I propose to remove this behavior.

Here you can see how in the Security panel, the link is not stretched but in the Twig panel it is:

![profiler-panel](https://github.com/symfony/symfony/assets/73419/155170f3-115d-4043-98cd-8844c1a3a4bf)

Commits
-------

c9ed471 [WebProfilerBundle] Tweak the HTML code of the Twig entry view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants