-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Display the missing translation panel by default #26398
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] Display the missing translation panel by default #26398
Conversation
for (var j = 0; j < tabs.length; j++) { | ||
var tabId = 'tab-' + i + '-' + j; | ||
var tabTitle = tabs[j].querySelector('.tab-title').innerHTML; | ||
|
||
var tabNavigationItem = document.createElement('li'); | ||
tabNavigationItem.setAttribute('data-tab-id', tabId); | ||
if (j == 0) { addClass(tabNavigationItem, 'active'); } | ||
if (hasClass(tabs[j], 'tab-active')) { selectedTabId = tabId; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not check if class 'active'
is set already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your proposal would work, but I think the current one is simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introducing tab-active + active 🤔 why use 2 "active" classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we use active
to apply other styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed this again ... and I was completely wrong. The .active
styles are not used how I thought they were, so we can totally reuse that class. @ro0NL thanks for helping me realize this!
@@ -117,7 +117,7 @@ | |||
{% endfor %} | |||
|
|||
<div class="sf-tabs"> | |||
<div class="tab"> | |||
<div class="tab {{ collector.countMissings == 0 ? 'tab-active' }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing, but wouldn't tab{{ collector.countMissings == 0 ? ' tab-active' }}
be more optimal for output? There are redundant spaces in case those fail.
There was a problem hiding this comment.
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 redundant spaces. They don't hurt at all. And this code is more readable in the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Destroy666x you are right, but as @stof said, we always prioritize the readability of Twig templates over the generated HTML code. So let's keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see. IMO both versions are equally readable though
Thank you @javiereguiluz. |
…nel by default (javiereguiluz) This PR was squashed before being merged into the 4.1-dev branch (closes #26398). Discussion ---------- [WebProfilerBundle] Display the missing translation panel by default | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Display the "Missing Translations" panel by default ... except if there are no missing translations. Commits ------- 15fe686 [WebProfilerBundle] Display the missing translation panel by default
…tion panel by default (javiereguiluz) This PR was squashed before being merged into the 4.1-dev branch (closes symfony#26398). Discussion ---------- [WebProfilerBundle] Display the missing translation panel by default | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Display the "Missing Translations" panel by default ... except if there are no missing translations. Commits ------- 15fe686 [WebProfilerBundle] Display the missing translation panel by default
…el (javiereguiluz) This PR was merged into the 4.1-dev branch. Discussion ---------- Show the deprecations tab by default in the logger panel | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Similar to #26398, I propose to display the deprecation tab by default when there are no error logs but there are some deprecations. Commits ------- d27b158 Show the deprecations tab by default in the logger panel
Display the "Missing Translations" panel by default ... except if there are no missing translations.