Problem/Motivation

Steps to reproduce the problem:

  1. Enable the tracker (human-readable name Activity Tracker) module of Drupal core. It requires no further configuration.
  2. Create a piece of content, for example a Page or Article.
  3. Log in to the site with an other user account different from who the content has created.
  4. Visit the /activity URL path of the site. You should see a table listing the only one content.
  5. Beside its node title a colored "new" or "updated" text appears.

The <span class="marker">updated</span> element containing the status text has no gap from the <a> element containing the node title. This is bad not only for human reading, but for accessibility reasons as well.
Screenshot

Drupal core: 8.8.0-beta1
Apache: 2.2.34
PHP: 7.3.8 / Mem: 128M
MySQL: 5.7.26
mac OS: 10.13.6

Proposed resolution

Insert an extra non-breaking space (&nbsp;) character between these two elements. Advantages are that they will stay together in any circumstances (not breaking under into a new line, for example) and being theme/CSS agnostic.

Remaining tasks

Probably no further tasks are known.

User interface changes

Hopefully a minor visual improvement fixed.

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Original report by [username]

N/A

Issue fork tracker-3095533

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

Balu Ertl created an issue. See original summary.

baluertl’s picture

Attaching patch for review.

dinesh18’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.03 MB
new1.01 MB

#2 patch looks good to me. +1 to RTBC.
Here are the screenshots attached. Changing the status to RTBC.
The automated script will pass hopefully.

baluertl’s picture

StatusFileSize
new1.13 KB

@Dinesh18 thanks for the quick response. After consulting with one of my colleagues I removed the concatenation from the second place to make the code more consistent.

dinesh18’s picture

Looks better.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: 3095533-drupal-core-88x-ui-strings-touching-4.patch, failed testing. View results

baluertl’s picture

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

Status: Needs work » Reviewed & tested by the community

Setting back issue status to RTBC as tests on more modern PHP versions are passing.

hardik_patel_12’s picture

@Balu Ertl,

+++ b/core/modules/tracker/js/tracker-history.es6.js
@@ -19,7 +19,7 @@
if (timestamp > lastViewTimestamp) {
const message =
lastViewTimestamp === 0 ? newNodeString : updatedNodeString;
- $(placeholder).append(`${message}`);
+ $(placeholder).append(` ${message}`);
}
});
}

changes is not required.

hardik_patel_12’s picture

Status: Reviewed & tested by the community » Needs work
hardik_patel_12’s picture

StatusFileSize
new564 bytes
new699 bytes

Kindly follow a new patch.

hardik_patel_12’s picture

Status: Needs work » Needs review
baluertl’s picture

Status: Needs review » Reviewed & tested by the community

@Hardik_Patel_12

changes is not required.

I see your point: you state that only the .js file needs to be patched, but the .es6.js file not.

However, afaik the native (.js) file is the result of transpiling from the source (.es6.js) file regarding this change record from 20 May 2017. For more information on the background of this decision see the reasoning in this comment.

Therefore I still believe that my patch from #2 is the correct one as it modifies both files.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@Balu Ertl you're correct that the .es6.js file is the one where changes should be made and then transpiled to the .js using the dev tools.

However, as far as I can see you're rtbc'ing your own patch which is not how this works. The patch should be reviewed by someone other than the patch author and they should set it to rtbc.

One of the things missing from this issue is an analysis of how this change might affect existing sites. That said it does appear that in Drupal 7 days theme_mark would add this space and here we're removed it for no obvious reason.

Also it is very helpful if the most recent patch on the issue is the correct patch.

swatichouhan012’s picture

Assigned: baluertl » swatichouhan012
swatichouhan012’s picture

Assigned: swatichouhan012 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.25 KB
new767 bytes
new54.66 KB
new45.17 KB

Here is the new patch with interdiff and screenshot please review.

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.

kishor_kolekar’s picture

StatusFileSize
new1.26 KB

I've re-rolled patch for 9.1

alexpott’s picture

+++ b/core/modules/tracker/js/tracker-history.es6.js
@@ -19,7 +19,7 @@
-        $(placeholder).append(`<span class="marker">${message}</span>`);
+        $(placeholder).append('&nbsp;<span class="marker">${message}</span>');

Elsewhere in core we're not encoding a space as   - I'm not sure we need to. See Drupal.theme.quickeditImageDropzone for an example where we are using a space instead.

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.

richard.walker.ardc’s picture

Patch 18 works for me; any chance it can be merged?

gauravvvv’s picture

Spacing fixed with CSS. No need of &nsbp;
Adding after patch screenshot for reference. Please review.

ranjith_kumar_k_u’s picture

StatusFileSize
new29.73 KB
new30.25 KB

The above patch works fine.
Before patch
before patch

After patch
after patch

Do we need to fix this through CSS?
We can simply fix it by adding a normal space before "<span>", like the following code

Drupal.theme.quickeditImageDropzone = function (settings) {
    return "<div class=\"quickedit-image-dropzone ".concat(settings.state, "\">") + '  <i class="quickedit-image-icon"></i>' + "  <span class=\"quickedit-image-text\">".concat(settings.text, "</span>") + '</div>';
  };

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

Status: Needs review » Postponed

This extension is deprecated and scheduled for removal in Drupal 11.

This is now 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.

It will be moved to the contributed extension once the Drupal 11 branch is open.

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.

andypost’s picture

Project: Drupal core » Activity Tracker
Version: 11.x-dev » 1.0.x-dev
Component: tracker.module » Code
Status: Postponed » Needs work

MR needs rework for contrib module now

richard.walker.ardc’s picture

StatusFileSize
new571 bytes

Re-roll of patch of #18 for 10.2.6 attached.

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

rajeshreeputra’s picture

Status: Needs work » Needs review

Created MR against contrib module