Skip to content

Commit

Permalink
minor #23843 [Profiler] Make the validator toolbar item consistent wi…
Browse files Browse the repository at this point in the history
…th the form one (ogizanagi)

This PR was merged into the 3.4 branch.

Discussion
----------

[Profiler] Make the validator toolbar item consistent with the form one

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

After more time experiencing it, I changed my mind about #22554 (review).

I do think replicating the form toolbar item behavior is the best thing to do.
Displaying a different property under some conditions may seem to be a bad idea, but the difference is clearly expressed by the background color used:

|-|-|
|--|--|
|<img alt="screenshot 2017-08-09 a 15 59 56" src="https://user-images.githubusercontent.com/2211145/29125368-de340da4-7d1b-11e7-9b04-8ff395e118f0.PNG">| Red: something wrong happened. Shows the relevant information: the number of violations.|
|<img alt="screenshot 2017-08-09 a 16 00 05" src="https://user-images.githubusercontent.com/2211145/29125374-e28dd6a0-7d1b-11e7-8ed6-b0d7634a5b21.PNG">| Grey: Everything went fine. Acknowledge the validator calls were made and passed by showing the number of calls.|

In any case, everything is clear when hovering the toolbar item (and most users are probably already used to this behavior due to the form item):

|Violations|No violations|
|--|--|
|<img width="173" alt="screenshot 2017-08-09 a 15 51 18" src="https://user-images.githubusercontent.com/2211145/29125023-e35ca602-7d1a-11e7-82d5-0ff3c0d9c46c.PNG">|<img width="172" alt="screenshot 2017-08-09 a 15 51 31" src="https://user-images.githubusercontent.com/2211145/29125037-ebbf0614-7d1a-11e7-8cd2-de6cb963a282.PNG">|

Commits
-------

b622d26 [Profiler] Make the validator toolbar item consistent with the form one
  • Loading branch information
fabpot committed Aug 10, 2017
2 parents 334b62a + b622d26 commit d8584e5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -6,7 +6,7 @@
{% set icon %}
{{ include('@WebProfiler/Icon/validator.svg') }}
<span class="sf-toolbar-value">
{{ collector.violationsCount }}
{{ collector.violationsCount ?: collector.calls|length }}
</span>
{% endset %}

Expand Down

0 comments on commit d8584e5

Please sign in to comment.