Problem/Motivation

Without a clearfix class, a progress bar with further elements rendered after it has the later elements run into the progress messages.

Proposed resolution

See #65

Remaining tasks

Created patch
Manual testing
Add screenshots
Review

User interface changes

Correct flow of elements underneath the progress bar.

The issue before the patch:
Issue before patch

The issue after the patch:
Issue before patch

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

Mukeysh’s picture

Status: Active » Needs review
FileSize
559 bytes

Added clearfix class to stable. Attached page for this

joachim’s picture

That's the right fix, but I'm not sure which copies of the template this should go in. There's:

core/modules/system/templates/progress-bar.html.twig
core/themes/classy/templates/misc/progress-bar.html.twig
core/themes/stable/templates/misc/progress-bar.html.twig

oriol_e9g’s picture

Issue summary: View changes
Status: Needs review » Needs work

You have added the class cleafixinstead of clearfix, see the missing R.

We need to add the clearfix to classy and stable, I have reproduced the bug in classy and stable template... so the system template can be used with arbritrary theme and we cannot be sure that the clearfix class exists. I have added the class in core/modules/system/templates because I think that could be a good default class, 99% of themes have a clearfix class from core, and the theme can overwrite the progess template to explicite remove the clearfix class if it's desired.

oriol_e9g’s picture

Status: Needs work » Needs review
FileSize
1.56 KB
joachim’s picture

The clearfix class is implemented in System module, in core/modules/system/css/components/clearfix.module.css, so that means it should probably be applied to the template in system module.

oriol_e9g’s picture

Yes, we need to add the clearfix class in the system template, probably the same bug it's reproducible in bartik and seven.

oriol_e9g’s picture

Issue tags: +Needs manual testing

Can anyone test it and set the status to RTBC?

rose.nichols’s picture

I am at DrupalCon Dublin and I am going to test this (https://www.drupal.org/contributor-tasks/manual-testing)

autopoietic’s picture

Also at drupalcon, looking at this

thpoul’s picture

Issue tags: +Dublin2016
rose.nichols’s picture

Status: Needs review » Reviewed & tested by the community

Me and autopoietic have been able to confirm that this is working correctly

rose.nichols’s picture

Issue summary: View changes
thpoul’s picture

Let's add some before and after screenshots to help the committer!

rose.nichols’s picture

Before & after screenshots attached

oriol_e9g’s picture

Issue tags: -Needs screenshots

All ready! Thanks!

rose.nichols’s picture

FileSize
130.95 KB
125.96 KB

Before
Before

After
After

rachel_norfolk’s picture

Thanks - that shows the issue (and resolution) much better!

valthebald’s picture

Version: 8.2.x-dev » 8.3.x-dev

Bumping to 8.3.x, so that we can have the issue fixed in the future versions as well

valthebald’s picture

Status: Reviewed & tested by the community » Needs review

Changing the status back to 'Needs review' just to see that the issue applies to 8.3.x

rachel_norfolk’s picture

Screenshots updated with annotations

criscom’s picture

I am going to review to review the code change in the patch in #5 right now.
I am going to follow the recommendations as posted here: https://www.drupal.org/contributor-tasks/review

valthebald’s picture

Status: Needs review » Reviewed & tested by the community

Changing back to RTBC - path applies to 8.3.x (also tested on simplytest.me), screenshots updated

Eric Heydrich’s picture

Issue summary: View changes
joachim’s picture

All the patch files have been hidden -- which patch is actually being reviewed here?

valthebald’s picture

@joachim: from #5

valthebald’s picture

Reordering files to have the patch displayed

criscom’s picture

We checked if the patch in #5 applies to all files with class="progress" and/or data-drupal-progress
grep -RF 'class="progress"' core
grep -RF 'data-drupal-progress' core

There are no other files with class="progress" and/or data-drupal-progress.

Patch stays within the scope of this issue.

Not sure about Joachim's comment in https://www.drupal.org/node/2781165#comment-11659703, though. Should we open a new issue for it?

Trying to connect with Joachim but LimeChat crashed.

joachim’s picture

Status: Reviewed & tested by the community » Needs work

Regarding my comment in #5:

> The clearfix class is implemented in System module, in core/modules/system/css/components/clearfix.module.css, so that means it should probably be applied to the template in system module.

I don't know enough about the theme system and the way in which changes to templates affect backwards compatibility to know what to do about this. It seems to me that either system module's version of this needs to be fixed here, or that system module's version can only be fixed in D9.

Can someone who's at DC maybe find a core theme developer to ask them?

valthebald’s picture

@criscom: it looks like my comment in #23 overlapped with your one. Didn't mean to cancel your intention to review the summary, sorry for that

thpoul’s picture

Status: Needs work » Reviewed & tested by the community

#29 Quoting mortendk from DrupalCon Dublin

Fix should be done in core cause stable is a theme that people should be using. No need to wait for D9.
joachim’s picture

Status: Reviewed & tested by the community » Needs work

That sounds like the system file should be fixed too...?

thpoul’s picture

From https://www.drupal.org/core/d8-bc-policy

We will change the markup and CSS that core generates for user interface and theme improvements. Specific core themes (Bartik, Seven) are considered internal and may change. The stable base themes (Stable, Classy) are considered public API, with stable templates, markup, and CSS, so themes needing BC support should extend one of those base themes.

Basically that means that changes should not be made in stable and classy. Also before and after screenshots (maybe with markup snippets) need to be done in both seven and bartik and code changes for seven and bartik

--- a/core/modules/system/templates/progress-bar.html.twig
+++ b/core/modules/system/templates/progress-bar.html.twig
@@ -13,7 +13,7 @@
  * @ingroup themeable
  */
 #}
...
+<div class="progress clearfix" data-drupal-progress>
   {% if label %}

and keep this part.

joelpittet’s picture

Assigned: Unassigned » star-szr
Status: Needs work » Needs review
Issue tags: +Needs subsystem maintainer review

This is a bug fix in classy/stable so different story than the quoted policy in #33. I'm assigning to Cottser to help sort out the policy issues on this. If it's not right in system it should be fixed there too.

joelpittet’s picture

Assigned: star-szr » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs subsystem maintainer review

Actually I'm going to make a decision on this, @Cottser is a committer too so he can veto. But due to this being a bugfix it should be in Core, Stable and Classy as it is in #5

joelpittet’s picture

Assigned: Unassigned » star-szr
Status: Reviewed & tested by the community » Needs review

I'm kind of thinking we remove the fix from Stable and leave the other two while discussing with @lauriii in person since Stable is expected to not have classes(maybe even some utility classes like clearfix? which is the part I'm fuzzy on). Leaving this up to @Cottser for the decision.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Whoops meant to leave it RTBC

lauriii’s picture

This issue would yet again benefit of solving this issue #2659890: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility since we could do classy fixes in one place and people could copy these fixes from there (or even use directly). Then we wouldn't necessarily have to fix this in Classy.

However, I don't think it is necessary to fix this in core since this is a bug, but it doesn't break any functionality. It just makes things look awkward. Are there other places that look awkward on Classy and Stable? Totally. This is more of a nice improvement for the default stylings than anything else.

star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs work

Thanks for the work so far, everyone :)

Stable (and core) shouldn't have any visual classes, only functional things, like for example js- prefixed classes. As an example, some people don't want to have a clearfix class and will want to use a CSS-only clearfix applied to different elements. Stable should let them do that.

Along the lines of what @joelpittet was saying in #36, I don't think we should be adding new clearfix classes to Stable or core. So that leaves us with Classy, Seven, and Bartik. In this particular case IMO we should just suck it up and update Bartik and Seven. Leaving Classy, Stable, and core alone and "stable". This fixes the bug for a good chunk of scenarios and is in line with the policies that have already been documented above.

joachim’s picture

Fixing only Bartik and Seven means that anyone using this element in their own theme, or a theme that inherits from Classy (which is what your meant to do) will see a broken element. So for example, the screenshots in #17 above of a client site where this element was used would remain broken. How is that a fix?

lauriii’s picture

@joachim: classy, stable or core doesn't provide any visual design and therefore isn't usable out of box. The designer who is building themes is responsible for making the site work visually.

joelpittet’s picture

Title: progress bar needs a 'clearfix' class » Progress bar needs a 'clearfix' class
Status: Needs work » Needs review

I think agree more with @joachim on here because the CSS that causes the visual bug was written in core (see referenced CSS below) and was not caught during testing.

core/modules/system/css/components/progress.module.css:34
core/themes/stable/css/system/components/progress.module.css:33

We could actually fix this entirely in CSS but the CSS would be added to Stable and Classy and core too.

Eg.

.progress:after {
  content: "";
  display: table;
  clear: both;
}

Using the .clearfix utility class seemed to be the better way to fix the problem and quickly discussed with @mortendk last week and he agreed.

Since the problem seems to be an accidental due to removal of this class, I see this as a bugfix as it is categorized.

When Stable and Classy were cut for 8.0.0 release the float: left/right were already in place but weren't tested for this use-case with items under.

I think system/Core should not be 'fixed' and represent the direction we want to go with this markup and classes. Stable IMO should be fixed due to the location of the bug.

oriol_e9g’s picture

Ok, if I collect all opinions:

Should we fix the bug?

  • In core: no
  • In classy: maybe
  • In stable: maybe

So, new patch acording this...

joachim’s picture

Status: Needs review » Needs work

> @joachim: classy, stable or core doesn't provide any visual design and therefore isn't usable out of box. The designer who is building themes is responsible for making the site work visually.

This isn't about 'making the site work visually'. Core provides styling for each of its elements, for their internal layout.

The internal layout of this element is broken, because it's crashing into elements that follow it. That's a bug in the styling that core is providing.

rachel_norfolk’s picture

Hmm - I'm a little confused by this. My understanding from way-back-when was that the purpose of Stable was to provide the 'stable' base. So, it allowed us to fix things in core and Classy, while Stable always represented a consistent point in time.

So, Core and Classy see fixes over time but Stable always gives consistent (even if 'wrong') output.

If (!) this is still true then...

We fix in Core and Classy BUT change Stable to reverse any change made in Core so that Stable is, well, stable...

lauriii’s picture

So, it allowed us to fix things in core and Classy, while Stable always represented a consistent point in time.

Classy is as frozen as is Stable. There's proposal to add unstable Classy to core to allow this kind of changes to be included #2659890: [Policy] [Plan] Drupal 9 and 10 markup and CSS backwards compatibility

jp.stacey’s picture

It would be useful to be able to point to policy documents not just on the frozenness or otherwise of core, Classy, Stable, Seven, Bartik etc: but also, what does frozen mean? When we used to freeze Drupal core for a major release, didn't we still permit bugfixes; wasn't that, in fact, the whole point? (Note that the policy page linked to doesn't even use the word "frozen", so maybe we shouldn't even use it.)

If this counts as a bugfix (and I think it's telling that, as far as I can see, nobody has changed this issue's category from "Bug report" since it was created) and if "frozen" only means "frozen to new features", then this bugfix should go in *everywhere* that's affected, and exactly where it gets changed becomes a matter of what code inherits from what, to make the change the simplest.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » Stable
Version: 10.1.x-dev » 2.0.x-dev
Component: Stable theme » Code
Issue tags: +Bug Smash Initiative

This issue was discussed in #bugsmash, with smustgrave, darvanen,and mstrelan. It was decided that this belongs in the contrib project. And that decision received support by larowlan and Tinto.

joachim’s picture

It's a core bug - it belongs in whatever has replaced the Stable theme in core.

joachim’s picture

Project: Stable » Drupal core
Version: 2.0.x-dev » 10.1.x-dev
Component: Code » Stable theme

Problem still exists in 10.1's Stable9 and Classy themes.

Gauravvvv’s picture

The Problem still exists in following themes: demo_umami, claro, stable9, starterkit_theme

I have provided a patch for same, Please review

Gauravvvv’s picture

Status: Needs work » Needs review
larowlan’s picture

Status: Needs review » Needs work

In 2023, clearfix is not the answer, regardless of the question.

I think we can fix this by moving to modern CSS, instead of using float left and right, we can make .progress display: flex and position the percentage and description using flexbox, this fix would go in system module's progress.module.css

After that, Claro's ::after attribute to add clearfix (without the clearfix class) can probably be removed too.

Umami, classy etc will all likely be fixed by changing from float to flexbox and that means we don't need any fixes in templates, which means we have no BC issues.

larowlan’s picture

Component: Stable theme » system.module
quietone’s picture

Issue summary: View changes

@larowlan, thanks for chiming in.

I have updated the remaining tasks and the proposed resolution has a link to comment #65.

joachim’s picture

Title: Progress bar needs a 'clearfix' class » Progress bar breaks flow of subsequent page elements

Thanks @larowlan. I've updated the title to describe the problem rather than the (now outdated) solution.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.