Make UI messages more easily alterable

Created on 29 May 2020, about 5 years ago
Updated 3 June 2025, 3 days ago

Problem/Motivation

When trying to customize some native UI, e.g. the node creation workflow, it is a common need to have to change or remove UI messages. If the text just needs to be tweaked, string overrides may be used, although this may have unintended side-effects, since they affect the UI globally. OTOH, if you need to alter the variables appearing in the message, or even removing it altogether possibly depending on some condition, the only ways to achieve this are to either retrieve all messages, change/remove the target one, and add them back or to alter them right before rendering. Both approaches are cumbersome and potentially fragile.

Proposed resolution

Introduce an easy way to target individual messages and alter/remove them by simply interacting with the messenger service as you do when adding messages in the first place, while retaining the ability to display the same message multiple times.

A possible solution would be to require developers to provide additional metadata besides the message text, e.g. a message provider and a key, like we do for emails. This would allow to target individual messages or even all the messages provided by a module, for instance.

Remaining tasks

  • Research/list the most common use cases in which this is needed, to ensure we are not adding too much flexibility at the cost of DX.
  • Propose an actual solution including a BC layer to keep existing code working and validate it
  • Write a patch
  • Reviews

User interface changes

None

API changes

None expected, only additions.

Data model changes

None

Release notes snippet

TBD

Feature request
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇮🇹Italy plach Venezia

Live updates comments and jobs are added and updated live.
  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024