Add the ability to hide / turn off the UI per user

Created on 25 April 2025, about 21 hours ago

Problem/Motivation

As a themer the editoria11y UI often is very disturbing while creating a theme. The markup is changed, UI covers other elements.

Steps to reproduce

Proposed resolution

Multiple ideas:
1) Add a toggle switch to turn editoria11y on or off by setting a cookie. The switch should be in the admin toolbar (we use Gin, not sure if the default toolbar also has the secondary toolbar at the bottom):

2) Add a boolean setting to the user profile so I can turn editoria11y on and off. The downside to this solution is that our site builders / content creators and designers use a single Drupal account. So we need a separate account.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.2

Component

Feature and test requests

Created by

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

Comments & Activities

  • Issue created by @thomas.frobieter
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Here's a similar, more generic issue: ✨ Add an "opt-in" mode per page (e.g. for Themers) Active that keeps Editorally available, but doesn't scan and modify the pages on load, but on user click.

    I think both issues target a similar issue, but the solutions might be combined. The idea for an individual setting in the user profile (2) here might extend the other one, which might be a bit more generic.

  • πŸ‡ΊπŸ‡ΈUnited States itmaybejj

    I...don't plan to contribute my own time to this -- if it's modifying inline DOM (other than the toggle), there's presumably a problem on the page. And if that is breaking a component, the themer needs to account for it, since it will break it for front-end editors. And if the toggle is in their way, it's going to be in the editors' way too. So I don't let our themers turn it off; I want them to be putting as much thought into the editor UI as the frontend.

    As of the latest release they can hide all duplicates of a manual check on a page for themselves. They could also split out their account to a role that does not have the checker enabled. Or they could temporarily add .ed11y-element {display: none;} to the CSS...assuming they don't accidentally commit the change...

    Or they could throw this in dev JS to let them modify anything for themself at runtime, ideally wrapped in an if for drupalSettings.user.uid:

    // Tell Editoria11y to call our option override.
    var editoria11yOptionsOverride = true;
    
    var editoria11yOptions = function (parameterBag) {
        let options = parameterBag;
    
        // Dev approach 1: do not draw interface at all.
        // This overrides the GUI config for "Disable the scanner if these elements are detected."
        options['preventCheckingIfPresent'] = '.some-devel-button-that-only-themers-see';
         
       // Dev approach 2: ignore config and force polite mode.
       options['alertMode'] = 'polite'; // Override any 'assertive' config.
       options['userPrefersShut'] = true; // Override localStorage for open/closed state.
    
       // Dev approach 3: only run on click:
       options['ignoreAllIfPresent'] = '.some-devel-button-that-only-themers-see';
       // That's a library param that isn't in the GUI, the opposite of the GUI one:
       // "Hide all alerts if none of these elements are present."
    
      return options;
    }
    

    If they are the only themer on the project, they could also just add ".some-devel-button-only-themers-see" to the GUI config for "Disable the scanner if these elements are detected."

    Mostly...I just philosophically do not think putting something in the GUI that lets end-users to turn the checker on and off is a good idea; this is one of the key differentiators between Sa11y and Editoria11y. Sa11y allows more local-user control, Editoria11y is centrally managed. I found that users who could turn things off, did. And then they forgot to turn things back on.

    I would consider a merge request if it let the admins control who was able to do this.

Production build 0.71.5 2024