Overview

When creating an image style with crop and hovering on the crop anchor, a hover effect is shown on the whole row instead of on the particular box.

Steps to Reproduce

  1. Navigate to Configuration > Image styles
  2. Add a new image style
  3. Add Image style name > Create new style
  4. Add new image effect > Crop > Add
  5. View issue when hovering over Anchor selection within the crop style configuration form - notice when hovering on a cell, the whole row is highlighted

Screenshot of issue

Screenshot of issue

Solution

Added this in /workspace/DrupalPod/web/core/themes/claro/css/components/tables.pcss.css

.image-anchor tr :not(:hover) {
background-color: #ffffff;
}
.image-anchor tr :hover > div {
background-color: transparent;
}

Screenshot of solution

Screenshot of solution

CommentFileSizeAuthor
#105 3101460-105.patch1.86 KBlauriii
#101 97-101-interdiff.txt2.33 KBtrackleft2
#101 3101460-101-move-anchor-styles-to-image-admin.patch1.74 KBtrackleft2
#97 92-97-interdiff.txt1.35 KBtrackleft2
#97 3101460-97-fix-nitpick.patch1 KBtrackleft2
#96 custom-commands-failed.png113.21 KBbnjmnm
#92 3101460-92-fix-cell-hover-style.patch1 KBdanahertzberg
#91 Screenshot 2023-06-07 at 2.57.33 PM.png89.45 KBdanahertzberg
#89 Screenshot 2023-06-07 at 2.24.23 PM.png92.78 KBdanahertzberg
#85 3101460_85.patch1.48 KBdsandhya
#85 after-box-hover-patch.png36.18 KBdsandhya
#82 interdiff-79_82.txt1.09 KBgauravvvv
#82 3101460-82.patch2.32 KBgauravvvv
#79 rerolldiff_72-79.txt1.5 KBayush.khare
#79 3101460-79.patch3.1 KBayush.khare
#78 3101460-nr-bot.txt146 bytesneeds-review-queue-bot
#76 After_Patch_Hover_Effect.png99.95 KBgaurav-mathur
#76 After_Patch.png99.91 KBgaurav-mathur
#76 Before_Patch_Hover_Effect.png100.33 KBgaurav-mathur
#76 Before_Patch.PNG20.92 KBgaurav-mathur
#72 3101460-72.patch3.32 KBnitin shrivastava
#71 3101460-71.patch3.04 KBsakthivel m
#70 after patch - 9.5.png101.19 KBdeepalij
#70 before patch - 9.5.png95.3 KBdeepalij
#67 interdiff_60_67.txt4.52 KBameymudras
#67 3101460-67.patch3.12 KBameymudras
#64 After patch IS.mp4351.26 KBAamir M
#64 Before patch IS.mp4161.27 KBAamir M
#64 After patch IS.png45.74 KBAamir M
#64 Before patch IS.png45.86 KBAamir M
#62 3101460-after-patch.png132.49 KBpradipmodh13
#62 3101460-before-patch.png162.83 KBpradipmodh13
#61 After Patch.png159.6 KBrinku jacob 13
#61 Before Patch.png140.78 KBrinku jacob 13
#60 3101460-60.patch5.44 KBameymudras
#53 After Patch 3101460 Without hover.png242.68 KBchetanbharambe
#53 After Patch 3101460 Hover.png250.71 KBchetanbharambe
#53 Before Patch 3101460 Without hover.png272.76 KBchetanbharambe
#53 Before Patch 3101460 Hover.png281.09 KBchetanbharambe
#52 after--patch.png31.84 KBvikashsoni
#52 before-patch--.png40.84 KBvikashsoni
#50 interdiff_37-50.txt3.93 KBkostyashupenko
#50 3101460-50.patch5.4 KBkostyashupenko
#43 After patch 4.png322.62 KBchetanbharambe
#43 After patch 3.png319.3 KBchetanbharambe
#43 After Patch 2.png314.39 KBchetanbharambe
#43 After patch 1.png322.87 KBchetanbharambe
#43 before patch 24th.png392.34 KBchetanbharambe
#37 onClick_onHover_tableCell.gif3.23 MBkiran.kadam911
#37 interdiff_25-37.txt3.08 KBkiran.kadam911
#37 hover-effect-3101460-37.patch5.61 KBkiran.kadam911
#31 patch#25.png16.6 KBricha_porwal
#31 patch#19.png15.84 KBricha_porwal
#25 interdiff_23-25.txt3.05 KBkiran.kadam911
#25 hover-effect-3101460-25.patch3.28 KBkiran.kadam911
#23 interdiff_20-23.txt256 byteskiran.kadam911
#23 hover-effect-3101460-23.patch3.81 KBkiran.kadam911
#21 interdiff_10-20.txt2.2 KBkiran.kadam911
#20 onClick_table_cell.gif2.22 MBkiran.kadam911
#20 hover-effect-3101460-20.patch3.84 KBkiran.kadam911
#19 onHover_background_none.gif2.2 MBkiran.kadam911
#19 interdiff_10-19.txt892 byteskiran.kadam911
#19 hover-effect-3101460-19.patch1.02 KBkiran.kadam911
#15 interdiff_10-15.txt1.06 KBkomalk
#15 hover-effect-3101460-15.patch804 byteskomalk
#15 before-patch.png64.09 KBkomalk
#15 after-patch.png75.67 KBkomalk
#10 interdiff_5-10.txt984 byteskostyashupenko
#10 hover-effect-3101460-10.patch1.09 KBkostyashupenko
#5 hover-effect-3101460-5.patch572 bytesmonymirza
#6 hover-effect-after-apply-patch.png17.01 KBvinodhini.e
#6 hover-effect-before-patch.png16.86 KBvinodhini.e
Screenshot 2019-12-17 at 12.25.09 PM.png32.67 KBmeenakshig

Issue fork drupal-3101460

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

Meenakshi.g created an issue. See original summary.

meenakshig’s picture

Issue summary: View changes
meenakshig’s picture

Title: Incorrect hover effect while creating image style. » Hover effect while creating image style.
lauriii’s picture

Issue tags: +Usability

This behavior is the same as in Seven so this is not a regression. This is the standard behavior of tables. We might want to consider changing this in the future if we think it would improve the UX.

monymirza’s picture

Assigned: Unassigned » monymirza
Status: Active » Needs review
StatusFileSize
new572 bytes

CSS improved. ready for review.

vinodhini.e’s picture

StatusFileSize
new16.86 KB
new17.01 KB

I applied patch #5, It's working for me.
I am attaching a screenshot before and after applying the patch. Thank you!

vinodhini.e’s picture

Status: Needs review » Reviewed & tested by the community
chris matthews’s picture

Version: 8.8.x-dev » 8.9.x-dev
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/themes/claro/css/components/tables.css
    @@ -333,3 +333,12 @@ td.priority-medium {
    +/* hover improve. #3101460 */
    

    We don't add comments like this with issue numbers in.

  2. +++ b/core/themes/claro/css/components/tables.css
    @@ -333,3 +333,12 @@ td.priority-medium {
    +.image-anchor tr:hover, .image-anchor tr:focus {
    +  background: none;
    +}
    +
    +.image-anchor tr td:hover, .image-anchor tr td:focus {
    +  background: #f0f5fd;
    +}
    

    Claro's css is created from .pcss files - these would need to be updated and this should be the compiled outcome - if this is what we desire.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new1.09 KB
new984 bytes
monymirza’s picture

Status: Needs review » Reviewed & tested by the community

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.

xjm’s picture

Tagging for frontend framework manager review since #4 is ambiguous about whether we should make this change. Thanks!

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs frontend framework manager review

I'm not 100% sure if the new hover effect is correct either. Having hover effect on the cell could be confused with the hover effect on the option element. I'm wondering if we should either make this work so that there's no hover effect on the table cell at all, or so that the table cell can be clicked for selecting the option.

komalk’s picture

Status: Needs work » Needs review
StatusFileSize
new75.67 KB
new64.09 KB
new804 bytes
new1.06 KB

#14

If there's no hover effect on the table cell.

Review the patch also attached the screen shot for the reference if there
is no hover effect on the table cell.

bnjmnm’s picture

Status: Needs review » Needs work
+++ b/core/themes/claro/css/components/tables.pcss.css
@@ -141,7 +141,6 @@ thead tr {
 tr:hover,
 tr:focus {
   color: var(--color-text);
-  background: var(--color-bgblue-hover);
 }

This hover styling should not be removed completely. For example, this hover effect is used to good effect on table rows in admin/content and this should not be removed. This change should be more targeted so the hover still exists where it is wanted.

bnjmnm’s picture

Assigned: monymirza » Unassigned
kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
kiran.kadam911’s picture

StatusFileSize
new1.02 KB
new892 bytes
new2.2 MB

Hello,

Kindly review the attached patch.

Option 1:
As per comment #14 no hover effect on the table cell at all & #16 onhover of table td removed background color for targeted element only.

Thanks!

kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.84 KB
new2.22 MB

Hello,

Kindly review the attached patch.

Option 2:
As per comment #14 table cell can be clicked for selecting the option with hover background color.

Thanks!

kiran.kadam911’s picture

StatusFileSize
new2.2 KB

Forget to add interdiff(interdiff_10-20), hence adding here.

ambuj_gupta’s picture

Assigned: Unassigned » ambuj_gupta
kiran.kadam911’s picture

StatusFileSize
new3.81 KB
new256 bytes

Updated patch for #20 work with interdiff.

Thanks!

bnjmnm’s picture

Status: Needs review » Needs work

It's not yet clear if this should be targeting Drupal core instead of just Claro, since the reported symptom is not unique to Claro.

I still want to share feedback as it's the kind of information that will make contributing to Claro easier. I'm not 100% it will get this closer to completion since it may be best to convert this to a core issue.

  1. +++ b/core/themes/claro/claro.info.yml
    @@ -22,6 +22,7 @@ libraries:
      - core/drupal.message
      - core/normalize
      - claro/global-styling
    + - claro/image-anchor
    

    There's no reason to include this library on every page. It could just extend the image/admin library, which would mean it's only loaded where needed.

  2. +++ b/core/themes/claro/claro.theme
    @@ -21,6 +21,15 @@
    +/**
    + * Implements hook_theme_suggestions_HOOK_alter() for form templates.
    + */
    +function claro_theme_suggestions_form_alter(array &$suggestions, array $variables) {
    +  if ($variables['element']['#form_id'] == 'image_effect_form') {
    +    $suggestions[] = 'form__image_effect_form';
    +  }
    +}
    +
    
    +++ b/core/themes/claro/templates/form/form--image-effect-form.html.twig
    @@ -0,0 +1,18 @@
    +{#
    +/**
    + * @file
    + * Default theme implementation for a 'form' element.
    + *
    + * Available variables
    + * - attributes: A list of HTML attributes for the wrapper element.
    + * - children: The child elements of the form.
    + *
    + * @see template_preprocess_form()
    + *
    + * @ingroup themeable
    + */
    +#}
    +{{ attach_library('claro/image-anchor') }}
    +<form{{ attributes }}>
    +  {{ children }}
    +</form>
    

    If you are using a theme hook to suggest a new template, and the only difference is adding a library, unless I"m missing something it's going to be more efficient to add the library in a form_alter hook and eliminate the need for an additional template.

    Although the template probably shouldn't be used at all, I want to point out that the @ingroup themeable and the "Default theme implementation " in the opening comments are not accurate if the template is in a theme. Templates in themes have no @ingroup and this isn't a "Default theme implementation for a 'form' element.". Reference other templates in themes to see how this is typically formatted.

  3. 
    diff --git a/core/themes/claro/js/image-anchor.js b/core/themes/claro/js/image-anchor.js
    new file mode 100644
    
    +++ b/core/themes/claro/js/image-anchor.js
    +++ b/core/themes/claro/js/image-anchor.js
    @@ -0,0 +1,17 @@
    

    Drupal JS should be added via .es6.js files, which are then compiled into .js files.This would also not pass JS code standards, which scan the .es6.js files. More info here: #2815083: Drupal core now using ES6 for JavaScript development

kiran.kadam911’s picture

Status: Needs work » Needs review
StatusFileSize
new3.28 KB
new3.05 KB

Thanks, @bnjmnm for option 2 patch review. Got to know good things from your comment and which will make contributing claro easier for me onwards.

Kindly review the attached updated patch for option 2(table cell can be clicked for selecting the option with the hover background color).
option 1 is #19

Two options provided whichever is finalized we can use that patch.

Thanks!

Status: Needs review » Needs work

The last submitted patch, 25: hover-effect-3101460-25.patch, failed testing. View results

kiran.kadam911’s picture

Status: Needs work » Needs review
kiran.kadam911’s picture

Issue tags: +Bug Smash Initiative
ambuj_gupta’s picture

Assigned: ambuj_gupta » Unassigned
richa_porwal’s picture

Assigned: Unassigned » richa_porwal
richa_porwal’s picture

StatusFileSize
new15.84 KB
new16.6 KB

Option 1 :- Tested and Verified by applying patch #19. And it's working as expected. As part of this patch the hover effect is removed from the tiles and the user is only able to select by clicking on radio button.

Option 2 :- Tested and Verified by applying patch #25. As part of this patch, the hover effect is only for the tiles. We are able to select the options by clicking any where inside the tiles.

richa_porwal’s picture

Assigned: richa_porwal » Unassigned
Status: Needs review » Reviewed & tested by the community
richa_porwal’s picture

rajandro’s picture

#25 (hover-effect-3101460-25.patch) is showing 24 coding standards violation message, we need to address those, isn't it?

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Discussed this on the usability call earlier this week. They liked the most recent approach where the radio button can be activated by clicking the table cell because it makes it easier to click the input. There's still two different hover effects for when the table cell is being hovered and when the radio button is being hovered. Since there's no difference in clicking the table cell and the radio button, we should unify the hover effect for the two different states.

kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.61 KB
new3.08 KB
new3.23 MB

Thanks, @lauriii for finalizing the approach to go ahead.

Kindly review the attached patch. As per #35 removing two hover(table cell & radio) and keeping only one hover on table cell. See the below GIF

Thanks!

ambuj_gupta’s picture

Assigned: Unassigned » ambuj_gupta
samiullah’s picture

@ambuj_gupta are u working on this issue

ambuj_gupta’s picture

Assigned: ambuj_gupta » Unassigned

No @samiullah, i am not working on this issue. I just forgot to unassigned.

deepalij’s picture

Assigned: Unassigned » deepalij
chetanbharambe’s picture

Assigned: deepalij » chetanbharambe
chetanbharambe’s picture

StatusFileSize
new392.34 KB
new322.87 KB
new314.39 KB
new319.3 KB
new322.62 KB

Patch #37 is applied successfully.

Testing Steps Followed:
- Go to Configuration -> Image Style -> Click edit in front of Large -> Add Scale and Crop effect from dropdown
- See the hover changes

Looks good to me.
Can be a move to RTBC
Please refer attached screenshots.

chetanbharambe’s picture

Assigned: chetanbharambe » Unassigned
Status: Needs review » Reviewed & tested by the community
quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

Thanks everyone for moving this issue along.

The patch in #37 has coding standard errors, see https://www.drupal.org/pift-ci-job/1781667

It is good to see that the issue summary has before and after screenshots. However, there are 4 after screenshot with no explanation of their context. The issue summary should also include the proposed resolution and any remaining tasks. I suggest using dreditor to add issue summary template and then to complete that. Having a complete and up to date Issue Summary helps the committers!

Setting NW for coding standards, issue summary update and I don't see that a code review has been done on the latest patch.

lauriii’s picture

The CSS linting errors on DrupalCI are not relevant because Drupal has moved from using CSSLint into using Stylelint. Agreed that the issue summary could use an update. I think it would be good idea to also discuss this in one of the UX calls before committing.

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.

kiran.kadam911’s picture

kostyashupenko’s picture

StatusFileSize
new5.4 KB
new3.93 KB

Fixed coding standard issues

gauravvvv’s picture

Status: Needs work » Needs review
vikashsoni’s picture

StatusFileSize
new40.84 KB
new31.84 KB

Patch applied working correctly sharing ref...

Thanks .......

chetanbharambe’s picture

Verified and tested patch #50.
Patch applied successfully and looks good to me.

Testing Steps:
# Go to Configuration -> Image Style -> Click edit in front of Large -> Add Scale and Crop effect from dropdown
# See the hover changes

Test Results:
# The user is able to see the hover effect while creating image style but the square cell is not clickable. Earlier it's working but in Patch #50 It's not working.

Please refer attached screenshots.
Looks good to me.
Can be a move to +1RTBC.

chetanbharambe’s picture

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.

kristen pol’s picture

Checked and patch in #50 still applies cleanly to Drupal 9.3 and 9.4 and applies with offsets to Drupal 10 (see below).

Styling was updated per #46 in latest patch but these have not been addressed from that comment:

Agreed that the issue summary could use an update. I think it would be good idea to also discuss this in one of the UX calls before committing.

so still needs:

  • Maintainers to discuss in UX meeting
  • Issue summary update
  • If approach is approved, still needs testing on Drupal 9.4 and 10
[drupal-10.0.x-dev/10.0.x] [drupal-10.0.x-dev]$ patch -p1 < 3101460-50.patch 
patching file core/themes/claro/claro.info.yml
patching file core/themes/claro/claro.libraries.yml
Hunk #1 succeeded at 304 (offset 1 line).
patching file core/themes/claro/css/components/tables.css
patching file core/themes/claro/css/components/tables.pcss.css
Hunk #1 succeeded at 241 (offset -2 lines).
patching file core/themes/claro/js/image-anchor.es6.js
patching file core/themes/claro/js/image-anchor.js
kristen pol’s picture

Hiding screenshots so it's easier to see patches.

ckrina’s picture

Status: Needs review » Needs work

This a good improvement for the UX, thanks! But I think there's still one small thing missing on hover: I'd expect to see the cursor to convert to pointer when hover to show that it is an interactive element, as with the default radio element.

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.

ameymudras’s picture

Status: Needs work » Needs review
StatusFileSize
new5.44 KB

Included a patch which would change the pointer on hover

rinku jacob 13’s picture

StatusFileSize
new140.78 KB
new159.6 KB

Reviewed and tested patch #60 for 9.5.x. Adding Screenshots for the reference. Need +1 RTBC

pradipmodh13’s picture

StatusFileSize
new162.83 KB
new132.49 KB

Reviewed and tested patch #60 for 9.5.x.
Adding Screenshots for the reference.
Thanks ameymudras.

Aamir M’s picture

Assigned: Unassigned » Aamir M
Aamir M’s picture

Assigned: Aamir M » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new45.86 KB
new45.74 KB
new161.27 KB
new351.26 KB

Verified and tested patch #60 on Drupal 9.5.x-dev. Patch applied successfully and looks good to me.

Testing steps:
1. Go to admin/Appearance
2. Set Claro theme in the Administration theme (Scroll down and see)
3. Save configuration
4. Go to Configuration > Image Style > Click edit in front of Large > Add Scale and Crop effect from dropdown > Add
5. See the hover effect
6. Apply the patch
7. Reload the page. (Note: Clear all caches if required)
8. Now observe the hover effect

Testing Result:
1. After applying the patch the hover effect is changed

Refer to screenshots and videos for reference
Can be moved to RTBC

quietone’s picture

Removing credit for duplicate screenshots on same patch, per How is credit granted for Drupal core issues.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/themes/claro/css/components/tables.pcss.css
    @@ -254,3 +254,40 @@ td.priority-medium {
    +}
    ...
    +}
    

    This is quite a bit of styling for a very specific widget. To fix the ui bug all that is needed is

    	+.image-anchor tr:hover,
    +.image-anchor tr:focus {
    +  background: none;
    +}

    and I'd likely commit that (and I'm a FEFM so I could commit it...)

    This is introducing a new UI pattern that makes non-interactive elements behave interactively. This would require looking into the accessibility implications.

    If there's a feeling it will truly benefit Drupal it could be explored in a followup issue, but lets just disable the row hover change. The element that should change on hover (the radio input), does change on hover.

  2. +++ b/core/themes/claro/js/image-anchor.es6.js
    @@ -0,0 +1,17 @@
    +        .once('imageAnchor')
    

    jQuery once is deprecated in Drupal. Use the drupal/once library instead.

ameymudras’s picture

Status: Needs work » Needs review
StatusFileSize
new3.12 KB
new4.52 KB

Thanks @bnjmnm as per your suggestion I have removed the extra styling from the table.pcss.css and updated the js to make use of drupal/once

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.

kristen pol’s picture

Issue tags: +Needs manual testing

Thanks for updating. Tagging for manual testing the new patch.

deepalij’s picture

StatusFileSize
new95.3 KB
new101.19 KB

Patch #67 applied successfully on Drupal 9.5.x-dev.

The hover effect is displaying correctly after applying the patch
Before patch:
before

After patch:
after

But, the patch failed to apply on Drupal 10.1.x-dev as its giving an error as shown below:

Checking patch core/themes/claro/claro.info.yml...
error: while searching for:
    - claro/media_library.theme
  media_library/widget:
    - claro/media_library.theme

quickedit_stylesheets:
  - css/components/quickedit.css

error: patch failed: core/themes/claro/claro.info.yml:164
error: core/themes/claro/claro.info.yml: patch does not apply
Checking patch core/themes/claro/claro.libraries.yml...
Hunk #1 succeeded at 287 (offset -19 lines).
Checking patch core/themes/claro/css/components/tables.css...
Hunk #1 succeeded at 282 (offset -27 lines).
Checking patch core/themes/claro/css/components/tables.pcss.css...
Hunk #1 succeeded at 231 (offset -23 lines).
Checking patch core/themes/claro/js/image-anchor.es6.js...
Checking patch core/themes/claro/js/image-anchor.js...

Needs to be re-roll for Drupal 10.1.x-dev

sakthivel m’s picture

StatusFileSize
new3.04 KB

#71 Please review the patch for 10.1.x-dev

nitin shrivastava’s picture

StatusFileSize
new3.32 KB

try to fix #71

deepalij’s picture

Applied patch #72 on Drupal 10.1.x-dev version
The patch applied cleanly.

The issue has been fixed. The hover effect is displaying correctly after applying the patch.
Screenshots are as per the #70

RTBC +1

avpaderno’s picture

Title: Hover effect while creating image style. » Hover effect is shown on the full row instead of a single box
Issue summary: View changes
gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
StatusFileSize
new20.92 KB
new100.33 KB
new99.91 KB
new99.95 KB

Patch #60 applied successfully on Drupal 9.5.x-dev and looks good to me.
After applying the patch the hover effect is changed.
Refer to screenshots.

kristen pol’s picture

@gaurav-mathur Please look at previous comments before testing. 1) The latest patch is in #72, 2) It was already tested in #73 so you are duplicating effort, and 3) you shouldn't assign Drupal core issues to yourself. Thanks.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new146 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

ayush.khare’s picture

StatusFileSize
new3.1 KB
new1.5 KB

Reroll #72 for 10.1.x

avpaderno’s picture

Status: Needs work » Needs review
andypost’s picture

Status: Needs review » Needs work
+++ b/core/themes/claro/js/image-anchor.es6.js
@@ -0,0 +1,18 @@
+  Drupal.behaviors.imageAnchor = {

+++ b/core/themes/claro/js/image-anchor.js
@@ -0,0 +1,19 @@
+ * DO NOT EDIT THIS FILE.

es6 files no longer needed for 10.x https://www.drupal.org/node/3305487

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new2.32 KB
new1.09 KB

Removed image-anchor.es6.js file. Attached interdiff for same. Please review

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Was tagged for issue summary update in #45 which still needs to happen from what I can tell.

Did not review.

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.

dsandhya’s picture

StatusFileSize
new36.18 KB
new1.48 KB

patch is created for hovering on the anchor instead of on the particular box a hover effect plz review

bnjmnm’s picture

Issue tags: +Novice, +Pittsburgh2023

Re #85 it was already established that a solution applied to the entire table would cause regressions in tables such as the one in admin/content. It can be annoying to read through all the comments in a long issue, but taking that time to read save you from wasting time on an approach that has already been rejected.

HINT: #66 mentions a way to address this that will not cause regressions and is something that I'd be willing to commit, so I'd encourage someone to take advantage of that answer key being hidden in plain sight.

danahertzberg’s picture

Looking at this one at DrupalCon 2023

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

danahertzberg’s picture

Issue summary: View changes
StatusFileSize
new92.78 KB

Updated summary with steps to reproduce

danahertzberg’s picture

Added this in /workspace/DrupalPod/web/core/themes/claro/css/components/tables.pcss.css

.image-anchor tr :not(:hover) {
background-color: #ffffff;
}
.image-anchor tr :hover > div {
background-color: transparent;
}

It works! :D

danahertzberg’s picture

StatusFileSize
new89.45 KB

Fixed issue screenshot!

danahertzberg’s picture

StatusFileSize
new1 KB

This patch applies to Drupal 9.5.x
Needs testing on Drupal 11.x

danahertzberg’s picture

Status: Needs work » Needs review
danahertzberg’s picture

Issue summary: View changes
trackleft2’s picture

Status: Needs review » Reviewed & tested by the community

Applied the patch cleanly to core 11.x c8806a02991f04233f859d2ef8870363172a2186

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new113.21 KB

@trackleft2 This is definitely not ready for RTBC. Applying cleanly is far from the only criteria taken into account when making this decision. A patch with unwanted changes can apply cleanly! In addition, every patch uploaded to a Drupal issue has a suite of automated tests run. All of these tests must pass for an issue to be committable.

In this case, it is getting a "custom commands failed" error. That means the patch is not even passing general code formatting tests. Clicking that message will take you to a page that lists the specific reasons those checks failed and point the contributor towards what must be changed to get it working.

trackleft2’s picture

StatusFileSize
new1 KB
new1.35 KB

New patch and interdiff

trackleft2’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update, -UX, -Needs subsystem maintainer review, -Needs manual testing

Cleaned up the tags some.

Did remove the submaintainer review tag as not sure that's needed. This is about fixing a hover effect and not how image style functions.

Following the issue summary steps I was able to confirm the issue on Drupal 11.x with a standard profile install.
Applying patch #97 when hovering over individual squares those squares are highlighted vs the whole row.
Saved the image style, edited by moving location and everything is working as expected.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

Spotted some additional things that are likely easy to address.

  1. +++ b/core/themes/claro/css/components/tables.css
    --- a/core/themes/claro/css/components/tables.pcss.css
    +++ b/core/themes/claro/css/components/tables.pcss.css
    

    Although the changes work when added here, it's better if they are added to image.admin.pcss.css as that's where the other .image-anchor styles are, including ones for .image-anchor <tr>, so it will keep related styles nearby and reduce repetition.

  2. +++ b/core/themes/claro/css/components/tables.pcss.css
    @@ -141,6 +141,12 @@ tr.color-error:focus {
    +.image-anchor tr :hover>div {
    

    There should be a space on each side of the >. If this was the only thing I'd just fix it on commit - not worth un-RTBCing for just that.

trackleft2’s picture

OK, I've renamed image.admin.css to image.admin.pcss.css and per the recommendation.

Removed the styles from core/themes/claro/css/components/tables.pcss.css
Added the styles to modules/image/css/image.admin.pcss.css

trackleft2’s picture

Status: Needs work » Needs review

OK, I've renamed image.admin.css to image.admin.pcss.css and per the recommendation.

Removed the styles from core/themes/claro/css/components/tables.pcss.css
Added the styles to modules/image/css/image.admin.pcss.css

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

There actually isn't a image.admin.pcss.css file in the images module.

But changes have been moved and point 2 in #100 appear to have been addressed. Remarking.

danahertzberg’s picture

Thank you for the help @smustgrave and @trackleft2!!

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.86 KB

Tried to address #100 on top of #97.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Still seems to be working.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 105: 3101460-105.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Random failure

  • bnjmnm committed 5d3e0717 on 11.x
    Issue #3101460 by trackleft2, kostyashupenko, danahertzberg, Gauravvvv,...
bnjmnm’s picture

Status: Reviewed & tested by the community » Fixed

It's been tough, but after 3.5 years, 108 comments, and enough screenshots to feed a small nation, the combined efforts of 37 contributors have resulted in the image styles page getting this cool slice of CSS.

+.image-anchor td:not(:hover) {
+  background-color: var(--color-white);
+}
+
+.image-anchor td:hover > div {
+  background-color: transparent;
+}

And tbh I almost dug in to see if the CSS could get a little more optimized but you know what? This works, it's an infrequently visited area of a site, not likely to result in conflicts or scalability issues. Enjoy the nicer hover in that snazzy grid!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.