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

Fix dump panel hidden when closing a dump#24665

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

Merged
fabpot merged 1 commit intosymfony:2.8fromjulienfalque:fix-dump-panel-toggling
Nov 5, 2017

Conversation

@julienfalque
Copy link
Contributor

@julienfalquejulienfalque commentedOct 22, 2017
edited
Loading

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

In the dump panel of the debug bar, when closing a dump the panel sometimes get hidden:

before

This is because when the size of the panel is reduced, if the mouse is not over it anymore, the:hover pseudo-class does not apply anymore.

I "fixed" it by setting a min-height on the panel when closing a dump. The min-height is removed when leaving the panelon purpose:

after

For now I only tested it on Firefox 56 on Arch Linux.

@nicolas-grekas
Copy link
Member

I didn't try the behavior on a page where the dump is displayed inline. Does this change anything in this situation? (eg in the dump() panel, or when using{{ dump() }})

@julienfalque
Copy link
ContributorAuthor

Didn't try either but it's worth checking before merging. I'll have a look.

@julienfalquejulienfalqueforce-pushed thefix-dump-panel-toggling branch 2 times, most recently fromb1d290f tob16ffd2CompareOctober 23, 2017 21:23
@julienfalque
Copy link
ContributorAuthor

I updated the PR: previous version was not working with inline dumps (thepanel variable was set tonull with the first inline dump as the debug bar wasn't loaded yet, and then never updated).

I also noticed that all dumps have az-index: 99999. What's the reason for that?

@ogizanagi
Copy link
Contributor

@julienfalque : I still get aUncaught TypeError: Cannot read property 'style' of undefined at toggle error in the profiler with your latest fix :/

@julienfalque
Copy link
ContributorAuthor

Woops. Should be fixed now.

arrow = '▶';
newClass = 'sf-dump-compact';
if ('undefined' !== typeof window.Sfdump.debugBarPanel) {

Choose a reason for hiding this comment

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

This means var-dumper knows something about the Symfony panel.
Can't we decouple things and alter the logic in the panel's twig file instead?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done. I used a custom event to decouple toggle detection and panel min-height handling.

@julienfalquejulienfalqueforce-pushed thefix-dump-panel-toggling branch 2 times, most recently from55a7515 to4b58a83CompareOctober 24, 2017 22:56
return false;
}
s.dispatchEvent(new CustomEvent('sfbeforedumptoggle', {

Choose a reason for hiding this comment

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

breaks on IE11?

Choose a reason for hiding this comment

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

We don't care about IE for Symfony development tools (we do care about Microsoft Edge though).

Copy link
Member

Choose a reason for hiding this comment

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

we do care about IE11 for things running in the toolbar, because this one is injected in the page itself, and so anything breaking the JS could break the page itself.

Copy link
Member

Choose a reason for hiding this comment

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

note that today, IE11 supports the WDT properly (we just had an issue with the SVG rendering in the past doing wonky stuff when the size was not defined in the SVG, and we fixed it)

Choose a reason for hiding this comment

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

I disagree. Symfony debug toolbars are related to the backend. If you have a Symfony-related problem in your app, you should be able to use any browser. So there's no need to support legacy browsers. The only exception are Ajax requests ... but that's two different things: you can use IE to debug frontend + JS errors related to Ajax and any other browser to debug the Symfony responses to those Ajax requests.

Choose a reason for hiding this comment

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

At least failing gracefully should be required IMHO.

Copy link
Member

Choose a reason for hiding this comment

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

@javiereguiluz but if the frontend is brokenbecause of the JS injected by the toolbar, you cannot debug the frontend because the toolbar causes extra errors.
It is OK if some feature does not work. It is not OK for the JS to break.

@nicolas-grekas
Copy link
Member

Status: needs work

(should degrade gracefully on non-supported OSes)

@julienfalque
Copy link
ContributorAuthor

Rewritten usingdocument.createEvent(). Support by older browsers should be better. Though I cannot confirm it right now. Can someone have a look?

}
var event = doc.createEvent('Event');
event.initEvent(

Choose a reason for hiding this comment

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

this call should be on one line.
to further enhance compat, what about wrapping the new logic in a check like:if (doc.createEvent) {...}?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Updated.

event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false);
}
s.dispatchEvent(event);

Choose a reason for hiding this comment

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

should be inside the "if"?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oops, indeed... Also added to theif condition.

@fabpot
Copy link
Member

Thank you@julienfalque.

@fabpotfabpot merged commit2e0b263 intosymfony:2.8Nov 5, 2017
fabpot added a commit that referenced this pull requestNov 5, 2017
This PR was merged into the 2.8 branch.Discussion----------Fix dump panel hidden when closing a dump| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes-ish| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -In the dump panel of the debug bar, when closing a dump the panel sometimes get hidden:![before](https://user-images.githubusercontent.com/1736542/31867025-615e9c48-b788-11e7-8329-96716c211523.gif)This is because when the size of the panel is reduced, if the mouse is not over it anymore, the `:hover` pseudo-class does not apply anymore.I "fixed" it by setting a min-height on the panel when closing a dump. The min-height is removed when leaving the panel _on purpose_:![after](https://user-images.githubusercontent.com/1736542/31867054-d01a01cc-b788-11e7-9ef7-8418ae2b3094.gif)For now I only tested it on Firefox 56 on Arch Linux.Commits-------2e0b263 Fix dump panel hidden when closing a dump
@julienfalquejulienfalque deleted the fix-dump-panel-toggling branchNovember 5, 2017 17:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

7 participants

@julienfalque@nicolas-grekas@ogizanagi@fabpot@javiereguiluz@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp