Problem/Motivation

This is very minor, but Visual Inline has a general_settings.visual_default_view_mode setting, but if you switch to Visual Inline (HTML) that setting is no longer available, and drupal's default view mode becomes the default that's shown, and this means that by switching to Diff Plus, you lose a feature.

Steps to reproduce

- Install Drupal 11 + Diff Plus
- Go to /admin/config/content/diff/general
- See that when you enable Visual Inline (HTML5) extra settings are revealed for default view mode
- Set the default view mode to something other than "default" e.g. "Teaser" or "Full content"
- Go compare two revisions of a piece
- Switch between "Visual Inline" and "Visual Inline (HTML5)" and notice that a different view mode is used for each which might be confusing/not-desirable

Proposed resolution

Option 1:

I think it makes sense to me for "Visual Inline (HTML5)" to share the general_settings.visual_default_view_mode setting for Visual Inline - this would require a form alter so it's exposed on /admin/config/content/diff/general and a one line change to src/Plugin/diff/Layout/VisualInlineHtml5DiffLayout.php:

$default_view_mode = $this->requestStack->getCurrentRequest()->query->get('view_mode') ?: 'default';

... becomes...

$default_view_mode = $this->requestStack->getCurrentRequest()->query->get('view_mode') ?: $this->configFactory->get('diff.settings')->get('general_settings.visual_default_view_mode') ?: 'default';

Option 2:

We give "Visual Inline (HTML5)" its own default view mode setting.

Remaining tasks

- Agree an approach
- Raise an MR
- Review
- Approve
- Merge

User interface changes

- A setting on /admin/config/content/diff/general when "Visual Inline (HTML5)" is enabled
- The chosen default being used, and being at the top when comparing revisions with Visual Inline (HTML5)

API changes

N/A

Data model changes

N/A

Comments

jacobupal created an issue. See original summary.

jacobupal’s picture

Issue summary: View changes
jacobupal’s picture

Issue summary: View changes
Status: Active » Needs review