Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

More compact display of vendor code in exception pages#26671

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@javiereguiluz
Copy link
Member

@javiereguiluzjaviereguiluz commentedMar 26, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#23144
LicenseMIT
Doc PR-

I like the general idea proposed in#23152 ... but I don't like the implementation ... so this PR is an alternative implementation.

UPDATE: the proposed feature has been completely redesigned. See#26671 (comment)

The idea is tohide by default all information that comes from "vendors" (vendor/ orvar/cache/ dir) because that code is out of your reach and you can't change it to fix your error.

In practice, each exception trace now would display aHide vendors option enabled by default:

Click here to view the outdated images

hide-vendors

It works like a toggle ... and it's compatible with the overall toggle of each trace header:

hide-vendors

When exceptions are complex, the amount of noise removed is massive:

Before

before

After

after

Simperfit, apfelbox, and yceruto reacted with thumbs up emoji
@Simperfit
Copy link
Contributor

This is really nice!

@lyrixx
Copy link
Member

I have often some issues in vendor so for me it will be more complicated to get to the point.
If you really want to go this way, could you add a "remember my last choice" cookie ?
Like we do with the debug bar (expanded / collapsed)

Thanks

jvasseur, ogizanagi, yceruto, and ostrolucky reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

Would be great if the toggle could be inplace of the hidden vendors. Putting it on the top right corner makes it hard to spot.
We need a visual hint (some ellipses) that there is something hidden.

@nicolas-grekas
Copy link
Member

Or instead of hidding the full vendor frame, can't we just hide the arguments?
I'd be extra cautious with hidding debugging info, because debugging generally needs full context to understand an issue.

lyrixx, ogizanagi, dmaicher, and yceruto reacted with thumbs up emoji

@javiereguiluz
Copy link
MemberAuthor

After reading your comments, I propose a complete redesign of this feature. Now we don't hide anything, we just make info more compact for vendors and keep the existing design for your code.

Simple exceptions

Before

v3-simple-before

After

v3-simple-after

Complex exceptions

Before

v3-before

After

v3-after

ro0NL, ogizanagi, yceruto, lyrixx, and sstok reacted with thumbs up emojisstok and andreybolonin reacted with heart emoji

@javiereguiluzjaviereguiluz changed the titleHide vendors by default in exception pagesMore compact display of vendor code in exception pagesMar 26, 2018
@ogizanagi
Copy link
Contributor

That's really better this way. I love it 👍

lyrixx reacted with thumbs up emoji

Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

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

Very nice idea 👍

<divclass="trace-line">
{{include('@Twig/Exception/trace.html.twig', {prefix:index,i:i,trace:trace,_display_code_snippet:_display_code_snippet },with_context =false) }}
<divclass="trace-line {{_is_vendor_trace?'trace-from-vendor' }}">
{{include('@Twig/Exception/trace.html.twig', {prefix:index,i:i,trace:trace,style:_is_vendor_trace ?'compact' :_display_code_snippet ?'expanded' },with_context =false) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it bestyle: _is_vendor_trace ? 'compact' : 'expanded' instead? 🤔

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is a bit trickier because we have 3 states:compact for vendors,expanded for the only trace that displays the code snippet expanded (there should be just one) andnormal which displays your code but doesn't expand the code snippet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something, but doesn't this check will interpret any application path containing "/vendor/" as part of vendor code? I know my point is really border, but could we check if the path is really in the project's/vendor directory?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Although you are right, I'd prefer to ignore that edge case: having/vendor/ in the file path and not being a real vendor. Moreover, in the last iteration of this feature we no longer hide anything, so the user won't miss anything important even in that edge case. Cheers!

phansys reacted with thumbs up emoji
@fabpot
Copy link
Member

Thank you@javiereguiluz.

@fabpotfabpot closed thisMar 27, 2018
fabpot added a commit that referenced this pull requestMar 27, 2018
… (javiereguiluz)This PR was squashed before being merged into the 4.1-dev branch (closes#26671).Discussion----------More compact display of vendor code in exception pages| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#23144| License       | MIT| Doc PR        | -I like the general idea proposed in#23152 ... but I don't like the implementation ... so this PR is an alternative implementation.**UPDATE**: the proposed feature has been completely redesigned. See#26671 (comment)~~The idea is to **hide by default all information that comes from "vendors"** (`vendor/` or `var/cache/` dir) because that code is out of your reach and you can't change it to fix your error.~~~~In practice, each exception trace now would display a `Hide vendors` option enabled by default:~~<details><summary>Click here to view the outdated images</summary>![hide-vendors](https://user-images.githubusercontent.com/73419/37895113-a9d942bc-30e0-11e8-9ff4-191dcb057d60.png)It works like a toggle ... and it's compatible with the overall toggle of each trace header:![hide-vendors](https://user-images.githubusercontent.com/73419/37895137-b9e8d406-30e0-11e8-82bd-5729d32aaa63.gif)When exceptions are complex, the amount of noise removed is massive:## Before![before](https://user-images.githubusercontent.com/73419/37895233-f9170eea-30e0-11e8-8c21-c514007d44d2.png)## After![after](https://user-images.githubusercontent.com/73419/37895240-fc2e50c0-30e0-11e8-9e5a-b7a73ba57b47.png)</details>Commits-------510b05f More compact display of vendor code in exception pages
{%set_is_first_user_code=true %}
{%fori,traceinexception.trace %}
{%set_display_code_snippet=_is_first_user_codeand ('/vendor/'not intrace.file)and ('/var/cache/'not intrace.file)and (trace.fileis notempty) %}
{%set_is_vendor_trace=trace.fileis notemptyand ('/vendor/'intrace.fileor'/var/cache/'intrace.file) %}
Copy link
Member

Choose a reason for hiding this comment

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

does this work on Windows ?

@stof
Copy link
Member

This is changing only the template of the TwigBundle exception controller, not the output of the Debug component, so this does not solve the same case than#23152

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

+4 more reviewers

@srozesrozesroze left review comments

@phansysphansysphansys left review comments

@ogizanagiogizanagiogizanagi approved these changes

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

10 participants

@javiereguiluz@Simperfit@lyrixx@nicolas-grekas@ogizanagi@fabpot@stof@sroze@phansys@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp