Suggested user- and admin-facing interface tweaks

Created on 5 March 2024, 9 months ago
Updated 20 April 2024, 7 months ago

Problem/Motivation

After working with DANSE for a few weeks on a development site, I've tinkered with some things, mostly to improve (at least in my opinion) the user interface, especially the wording, and am offering them for consideration here.

Steps to reproduce

Install and enable module, configure for subscriptions on at least one content type, move subscription widget into node display for that content type.

Proposed resolution

1. The first group of changes concerns the notification widget on individual nodes.

  • A. The widget currently uses the node title in its sub/unsub links. Sometimes the node title can be pretty long, to the point that it runs off the page, especially on mobile. I've changed the link to replace "(node title)" with "this (content type)" in modules/content/src/Topic/TopicBase.php:
    - return (string) $this->t('Subscribe to @title when it gets @action', $args);
    + return (string) $this->t('Subscribe to this @bundle when it gets @action', $args);
    

    So instead of saying "Subscribe to Really Long Article Node Title That Runs Off The Page Especially On Mobile when it gets updated," it will say "Subscribe to this article when it gets updated."

  • B. Related, also in TopicBase.php, I changed the content type subscription links, adding the work "all," to clarify that the link will sub/unsub the user to all content of that type:
    - return (string) $this->t('Subscribe to @bundle content when it gets @action', $args);
    + return (string) $this->t('Subscribe to all @bundle content when it gets @action', $args);
    - return (string) $this->t('Unsubscribe from @bundle content when it gets @action', $args);
    + return (string) $this->t('Unsubscribe from all @bundle content when it gets @action', $args);
    

    I considered completely removing the content type sub/unsub links from the individual nodes, so that the user would have to go to the subscription tab on the user profile in order to manage content type subscriptions. I still might do that. On the one hand, I worry that users will get confused despite the addition of "all" and accidentally sub/unsub themselves from the content type when they want only to sub/unsub for the individual node. On the other hand, though, I hate to make users hunt around any more than necessary for the content type links.

  • C. At first, I couldn't find the unsubscribe link for a node that I'd subscribed to. That's because the link is way down at the bottom of the dropdown. My thinking is that the unsubscribe link(s) should be more prominent. This change in modules/content/src/Service.php simply reverses the order of the links:
    if (!empty($operations)) {
    + $operations = array_reverse($operations);
    

2. The second group of changes involves the subscriptions tab on the user profile page.

  • A. The labels in the "settings" section do not match the labels in the DANSE notification widget on the node pages, and the wording could be clearer. I've made this change in modules/content/src/Plugin/Danse/Content.php:
    - $this->t('@topic @entity_type of type @bundle', [
    + $this->t('Subscribe to @bundle @entity_type (@topic)', [
    
  • B. The "settings" title is not very informative, especially because the section is closed by default. I've changed both in src/Service.php:
    - '#title' => $this->t('Settings'),
    - '#open' => FALSE,
    + '#title' => $this->t('Content type subscriptions'),
    + '#open' => TRUE,
    

    ("Content type subscriptions" may not be quite right because of the possibility of subscriptions to things other than content. Ideas? Also, this might be better as a config setting, since some people might like it as is.)

3. The final set applies only to the administration area, specifically the DANSE tab on e.g. admin/structure/types/manage/(content type). I just want to improve the help for the "default value" checkboxes. The current working slowed me down a little during setup. The change is on modules/content/src/Plugin/Danse/ContentSettingsTrait.php:

- 'push' => $this->t('Default value for push'),
- 'force' => $this->t('Default value for force'),
- 'silent' => $this->t('Default value for silent'),
+ 'push' => $this->t('Default value for "Create push notification"'),
+ 'force' => $this->t('Default value for "Force push even if this creates duplicate notification"'),
+ 'silent' => $this->t('Default value for "Make this silent and do not create any notifications"'),

Remaining tasks

Merge request to come.

User interface changes

Change wording in various places. Reverse sort of links in notification widget. Make list default to open on user profile subscriptions tab.

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rclemings

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rclemings
  • Merge request !132.3.x β†’ (Merged) created by rclemings
  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States rclemings
  • Pipeline finished with Failed
    9 months ago
    Total: 47s
    #112194
  • Status changed to Needs work 9 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I like your improvements a lot, well done! Left a couple of comments in the MR for further discussion.

  • Pipeline finished with Success
    9 months ago
    Total: 148s
    #113189
  • Pipeline finished with Success
    9 months ago
    Total: 198s
    #113260
  • Pipeline finished with Canceled
    9 months ago
    Total: 57s
    #113262
  • Pipeline finished with Success
    9 months ago
    Total: 149s
    #113263
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Making good progress, left a couple more comments.

  • Pipeline finished with Success
    9 months ago
    Total: 145s
    #116711
  • Pipeline finished with Success
    8 months ago
    Total: 151s
    #126504
  • Pipeline finished with Failed
    8 months ago
    Total: 147s
    #139190
  • Pipeline finished with Skipped
    8 months ago
    #139351
  • Status changed to RTBC 8 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks a lot @rclemings for all your work on this one. I've just merged it into the dev release. I suggest we could mark this issue as fixed and open other follow-up issues when needed.

  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rclemings
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024