'On by default' setting is confusing

Created on 2 February 2024, about 1 year ago

Problem/Motivation

I couldn't figure out what the 'On by default' setting on /admin/config/content/same-page-preview is supposed to mean. After diving into the code I discovered that it's a way to enable all node type checkboxes below at once.

Proposed resolution

Move the checkbox to the 'Content Type settings' fieldset and call it 'Enable for all content types'. Add JS that toggles the checkboxes below immediately instead of doing it in PHP, after form submit.

📌 Task
Status

Active

Version

2.1

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

  • Issue created by @dieterholvoet
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    What the "On by default" is intended to control is the ability to open the Same Page Preview iframe whenever content loads. The "preview" is "on" by default instead of being "on" whenever you click the preview button.

    For users (while using their device) would be overwhelmed by this, keeping this feature is an important consideration.

    Is your issue the nameing of the Setting or it's logical organization?

  • 🇧🇪Belgium dieterholvoet Brussels

    Mostly the naming, maybe it would be better to change the label to the same one that's used in the preview page: 'Open preview by default'. Looking at the code again, I can't seem to figure out where this setting is being used. Are you sure it's being used at all?

  • Merge request !60Change element label → (Open) created by dieterholvoet
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    It's intended to be used when the node_edit page is opened to determine if the preview should launch immediately, or when the user clicks the preview button.

  • 🇧🇪Belgium dieterholvoet Brussels

    Yes, but can you share where exactly in the code this value is read? Because I can't seem to find it.

  • 🇫🇮Finland sokru

    Its read on /admin/config/content/same-page-preview on page load and stored to localStorage. https://git.drupalcode.org/project/same_page_preview/-/blob/2.1.x/js/adm...

    I'd say the interpretation on issue summary is wrong and we should limit the scope of this issue just for the label copy.

    Whatever label we choose it should be reflected to config schema on related issue.

Production build 0.71.5 2024