Problem/Motivation

When there's a limited amount of horizontal space, the shortcut action link will move to the next line. This looks awkward especially when only the star icon is visible.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#40 3068698-nr-bot.txt2.17 KBneeds-review-queue-bot
#39 interdiff_3068698_35-39.txt1.58 KBankithashetty
#39 3068698-39.patch2.52 KBankithashetty
#35 interdiff-26_35-3068698.txt3.43 KBgauravvvv
#35 3068698-35.patch2.56 KBgauravvvv
#31 After patch.png64.62 KBnikhilraut
#31 Before patch.png205.27 KBnikhilraut
#29 3068698-after-patch.png18.36 KBarun velusamy
#29 3068698-before-patch.png14.33 KBarun velusamy
#28 After-Patch-3068698-25.png57.17 KBManibharathi E R
#28 Before-Patch-3068698-25.png63.42 KBManibharathi E R
#26 reroll_diff_24_25.txt2.09 KBsakthivel m
#26 3068698-25.patch3.69 KBsakthivel m
#24 reroll_diff_19_24.txt2.9 KBsakthivel m
#24 3068698-24.patch3.8 KBsakthivel m
#22 After patch mobile screen.png8.93 KBAamir M
#22 After patch.png10.77 KBAamir M
#22 Before patch.png10.6 KBAamir M
#20 3068698-before_patch.png7.45 KBabhijith s
#20 3068698-after_patch.png9.9 KBabhijith s
#20 3068698-after_patch_1.png10.07 KBabhijith s
#19 interdiff_10-19.txt634 bytesranjith_kumar_k_u
#19 3068698-19.patch3.85 KBranjith_kumar_k_u
#15 before-patch-shortcut.png25.65 KBMadhu kumar
#15 After-patch-shortcut.png15.57 KBMadhu kumar
#10 3068698-10-compilefix.patch3.9 KBbnjmnm
#9 Screen Shot 2020-08-07 at 1.59.43 PM.png382.3 KBtanubansal
#8 Screen Shot 2020-08-06 at 2.11.00 PM.png43.17 KBbnjmnm
#8 Screen Shot 2020-08-06 at 2.11.15 PM.png54.23 KBbnjmnm
#8 3068698-8.patch2.7 KBbnjmnm
Screen Shot 2019-07-18 at 20.46.51.png13.46 KBlauriii
Screen Shot 2019-07-18 at 20.46.40.png10.2 KBlauriii

Comments

lauriii created an issue. See original summary.

ckrina’s picture

Status: Active » Postponed

Postponing this until the design is done.

huzooka’s picture

Project: Claro » Drupal core
Version: 8.x-1.x-dev » 8.9.x-dev
Component: Needs design » Claro theme
ckrina’s picture

Issue tags: +Needs design

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.

lauriii’s picture

Status: Postponed » Active

I'm wondering if we could use the current design with Popper.js? Moving to active to research that.

himanshu_sindhwani’s picture

bnjmnm’s picture

Status: Active » Needs review
StatusFileSize
new2.7 KB
new54.23 KB
new43.17 KB

Popper seems to work pretty well, particularly if one considers that hover and keyboard navigation is much less likely to occur at narrow widths, so it probably doesn't need to look amazing.

The JS is using regular classes as adding data attributes or js-prefixed won't be trivial - it's already formatted markup by the time it reaches claro and rebuilding it would necessitate a require_once of shortcut.module. If this approach looks good to others, that step can certainly happen.

tanubansal’s picture

StatusFileSize
new382.3 KB

@bnjmnm : After adding the patch #8, I have tested the shortcut icon on multiple pages. At the time of edit node, it appears in the next line.

bnjmnm’s picture

StatusFileSize
new3.9 KB

Looks like the compiled JS was not in the previous patch, just the es6 file. That would explain #9

tanubansal’s picture

#10 is working fine on 9.1
This can be moved to RTBC

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.

andrewmacpherson’s picture

Issue tags: +Accessibility

In the narrow screen shot in #8, the "Add to..." message partially obscures the primary local actions.

Does it satisfy WCAG SC 1.4.13 "Content on Hover or Focus"?

#8:

particularly if one considers that hover and keyboard navigation is much less likely to occur at narrow widths

That's just not true. Besides which, the likelihood doesn't matter; some users will employ a hover-pointer or keyboard.

Using a narrow-ish window and browser zoom, you can soon get to these proportions on a desktop browser. A typical situation would be 2 windows side by side with half the monitor width each (which nearly all desktop OS provides a keyboard shortcut for). On a 1920x1080 HD monitor, that amounts to 960 physical pixels, or 480 CSS pixels at 200% browser zoom.

There's also no accounting for the length of the page title, which isn't anything to do with the viewport size. With a longer page title, this situation will happen on a 1280px viewport.

volkswagenchick’s picture

Madhu kumar’s picture

StatusFileSize
new15.57 KB
new25.65 KB

patch #2 applied cleanly and working as expected , sharing screenshot for reference.

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.

ranjith_kumar_k_u’s picture

StatusFileSize
new3.85 KB
new634 bytes
abhijith s’s picture

StatusFileSize
new10.07 KB
new9.9 KB
new7.45 KB

Applied patch #19 and it works fine.

Before patch:
before

After patch:
after

after1

RTBC +1

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
new10.6 KB
new10.77 KB
new8.93 KB

Verified and tested patch #19 on Drupal 9.5.x-dev. The patch is applied successfully and looks good to me.

Testing steps:
1. Goto admin/Appearance
2. Set Claro theme in the Administration theme (Scroll down and see)
3. Save configuration
4. Observe Extend tab or any tab whichever you want
5. Check the shortcut link star mark by reducing horizontal space or with a mobile view
6. Observe the shortcut link star mark moves down when horizontal space is reduced
7. Apply the patch
8. Reload the page. (Note: Clear all caches if required)
9. Now observe the shortcut link star mark

Testing Result:
1. After applying the patch the shortcut link star mark is displayed properly even after horizontal space is reduced

Screenshots are attached for the reference
Hence moved to RTBC

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

#22 has a detailed list of steps taken (good!) but it doesn't mention reviewing the actual code. That should happen before any RTBC.

  1. +++ b/core/themes/claro/css/components/shortcut.pcss.css
    @@ -45,6 +45,7 @@
    +  z-index: 1;
    

    Is this actually needed if Popper is helping? Not sure one way or the other.

  2. +++ b/core/themes/claro/js/shortcut.es6.js
    @@ -0,0 +1,40 @@
    +      const $shortcuts = $(context).once('shortcuts').find('.shortcut-action');
    

    jQuery once is deprecated. Use drupal/once instead.

  3. +++ b/core/themes/claro/js/shortcut.es6.js
    @@ -0,0 +1,40 @@
    +        const message = element.querySelector('.shortcut-action__message');
    

    It feels like overkill for a little shortcut tooltip, but ideally we'd use data attributes as classes should be for styling only. JavaScript needs to target selectors specific to functionality.

  4. +++ b/core/themes/claro/js/shortcut.es6.js
    @@ -0,0 +1,40 @@
    +})(jQuery, Popper);
    

    When jquery once is refactored out, jQuery won't be needed either.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new3.8 KB
new2.9 KB

#24 Please review the patch

bnjmnm’s picture

Status: Needs review » Needs work

Nice! This can be refined a bit more, but I like the direction this is going in.

+++ 3068698-24.patch	2022-08-29 15:45:07.000000000 +0530
@@ -61,7 +57,7 @@
++      const $shortcuts = $(once('shortcuts', '.shortcut-action', context));

This is unnecessarily wrapping once in jQuery

you can just do

once('shortcuts', '.shortcut-action', context).forEach((element) => ....)

and remove the jQuery / $ from the file entirely.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new3.69 KB
new2.09 KB

#26 Please review the patch

anchal_gupta’s picture

Applied patch #26 and it works fine.

Manibharathi E R’s picture

StatusFileSize
new63.42 KB
new57.17 KB

Patch #26 tested and applied successfully on Drupal 9.5.x.

Before Patch:
Before-Patch
After Patch:
After-patch

arun velusamy’s picture

StatusFileSize
new14.33 KB
new18.36 KB

I have verified the patch #26 and tested it on Drupal version 9.4.x. The patch works fine. I have added the before and after screenshots for reference.

nikhilraut’s picture

Assigned: Unassigned » nikhilraut
nikhilraut’s picture

Assigned: nikhilraut » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new205.27 KB
new64.62 KB

Verified and tested patch#25 on the Drupal 9.5.x-dev version. Patch applied successfully.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 26: 3068698-25.patch, failed testing. View results

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.

mgifford’s picture

Issue tags: +wcag144

Looks like a WCAG 1.4.4 issue.

gauravvvv’s picture

StatusFileSize
new2.56 KB
new3.43 KB

Re-rolled #26, for Drupal 10. As es6 files are no longer used in D10. Also popperjs has been updated to loadjs. Attached a patch and interdiff for same. Please review.

gauravvvv’s picture

Status: Needs work » Needs review
guru2023’s picture

Assigned: Unassigned » guru2023

I will double check this issue

bnjmnm’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/claro/claro.libraries.yml
    @@ -202,6 +202,11 @@ autocomplete:
    +    - core/loadjs
    

    I don't believe loadjs is needed anywhere in this fix so this doesn't need to be added as a dependency

  2. +++ b/core/themes/claro/js/shortcut.js
    @@ -0,0 +1,39 @@
    +/**
    + * DO NOT EDIT THIS FILE.
    + * See the following change record for more information,
    + * https://www.drupal.org/node/2815083
    + * @preserve
    + **/
    

    In other words, use code from shortcut.es6.js from the earlier Drupal 9 patch in this shortcut.js file. This is a copy of the transpiled JS, and Drupal 10 no longer transpiles its JS (hence no .es6.js + .js files)

ankithashetty’s picture

Status: Needs work » Needs review
StatusFileSize
new2.52 KB
new1.58 KB

Made changes as pointed out in #38, thanks!

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new2.17 KB

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.

guru2023’s picture

Assigned: guru2023 » Unassigned
Status: Needs work » Reviewed & tested by the community
borisson_’s picture

Status: Reviewed & tested by the community » Needs work

There are issues found in #40 that have not been resolved in the meantime, is there a reason why you'd just ignore that update @Guru2023?

ranjith_kumar_k_u’s picture

The PopperJS library has been removed from the core 10.0.0
core/popperjs asset library is deprecated

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.

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.

quietone’s picture

Status: Needs work » Postponed

The Claro theme was approved for removal in #3576460: [policy, no patch] Deprecate and remove Claro.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3576668: [meta] Tasks to deprecate Claro and the removal work in #3584638: [meta] Tasks to remove the Claro theme.