Problem/Motivation

As noted by @alexpott in this review of the announcements feed, the current implementation does not store per-user notification settings, and the mark as read functionality is fairly limited and could be overlooked without a user actually *reading* the content.

I think the code above leads to unexpected behaviour. By marking everything as seen here it means if someone quickly navigates through the announcement page then all of the announcements will be marked as seen. We also have some javascript that pretends to mark the announcement as read but really it only does a visual change. Ideally that would behave more like an inbox mark as read ie. we'd be posting something back to the site to mark the announcement as read.

Also the way the limit behaves feels wrong. If there are 10 announcements and you view the page you'll see all 10. Then if another announcement is posted the last announcement will disappear. If that contained information that you wanted to recall you might be very frustrated that there is no way to view older announcements.

I realise that some of this behaviour has been debated in the contrib module for example https://www.drupal.org/project/announce/issues/3249644 but the UX of new and limit don't feel right.

However, implementing a proper solution would require:

  • New DB tables OR relying on userData service to never be deleted
  • Wiring up the controller
  • New AJAX endpoints
  • New JS for the new mark as read behavior

Proposed resolution

These are all good things to do, but because there is an outstanding proposal to convert this whole feature to be part of a more modern dashboard implementation, it seems like the next best step might be:

  • Wait for the Dashboard contributors to implement a generic notification/mark as read strategy
  • Implement that for Announcements when it is converted to this Dashboard feature.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Comments

hestenet created an issue. See original summary.

hestenet’s picture

hestenet’s picture

Issue summary: View changes

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.