Olivero's comments should be using SDC. The file to start with is at core/themes/olivero/templates/content/comment.html.twig

Issue fork drupal-3365625

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mherchel created an issue. See original summary.

javi-er’s picture

Assigned: Unassigned » javi-er

javi-er’s picture

Status: Active » Needs review

This is ready for review now, however there are some considerations:

  1. For the component group I used "Content" but let me know if another group should be used instead (or maybe removed)?
  2. The component is still calling the olivero/comments library, because this library is also called from templates/field/field--comment.html.twig so both, the styles and JS code should be split into the lines affecting specific comments and the comments wrapper and also because I'm not sure if post css preprocessing is set up for components folder, but let me know if this should be changed.
  3. The parent variable is defined as a string although it's actually a TranslatableMarkup object, but since it will be empty for the first comment, if it's defined as a TranslatableMarkup it will throw an error for the first one.
javi-er’s picture

javi-er’s picture

Status: Needs review » Needs work

Post CSS will compile css found in components (since it's looking for everything inside the `core` folder), will move styles and move back to needs review.

javi-er’s picture

Status: Needs work » Needs review

This ready for review now, I'm interested in knowing if the approach I took for splitting the styles that affects the comments wrapper and the individual comments is the right one.

There is one selector that's using duplicated styles for rendering the user picture: .add-comment__picture. However I couldn't find this selector on the comment form, it seems like that the variable user_picture at olivero/templates/field/field--comment.html.twig is empty, even if the user has a picture. In any case, I would like to know the right approach to take when the same styles are used in two places, it could use a separate component just for the user picture or the same class in both places.

smustgrave’s picture

Status: Needs review » Needs work

Seems there were some failures in the MR.

javi-er’s picture

Status: Needs work » Needs review

@smustgrave the MR is green, the pipeline tab in it is empty and the CI job is building successfully: https://www.drupal.org/pift-ci-job/2687312

Could you specify which problems are you seeing?

smustgrave’s picture

Status: Needs review » Needs work

“Build successful” with a grey box means tests did not pass. Usually a night watch test I think.

Would check here https://dispatcher.drupalci.org/job/drupal_patches/186199/console

When the bar is green and it says xyz tests passed then it’s good.

mherchel’s picture

I don't know if this will ever pass tests. The SDC is not enabled by default within the standard profile, so when it goes to test the comments, it's going to get a WSOD.

mherchel’s picture

Just left some comments in the MR. Lots of good work here. Thanks!

smustgrave’s picture

Since these can’t be merged yet could probably update standard to include sdc? Just to see if the tests pass?

javi-er’s picture

Status: Needs work » Needs review

I did the suggested changes and some cleanup, however tests are still failing. I'm moving it to needs review to test the functionality, and the failing test can be addressed once SDC is part of core.

smustgrave’s picture

Status: Needs review » Needs work

They're failing because SDC is not part of the standard profile install. You can add the module and push up here (others have done that) and see if the tests pass. But the SDC can't be added to standard until it's marked stable.

These olivero tickets are just getting a leg up on when that happens. So SDC will be marked stable, added to standard, then all these tickets should be good to go with (hopefully) minimal tweaking if at all.

finnsky’s picture

What i see that this comment is pretty same except small details(modifiers) to

https://www.drupal.org/project/drupal/issues/3365367#comment-15527524

So probably we need to try to use one component here. And move that collapse button to separated component.

Gauravvvv made their first commit to this issue’s fork.

ahsannazir made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.