Auto-Hide Post Editor Preview

Is there a setting somewhere to auto-hide the post editor preview? Most of the time I do not need a preview of my post and would prefer if the preview was disabled by default.

As a user, there’s no setting to hide the preview by default. As an admin of a Discourse install, you can do it in a theme-component.

You’d use something like this in the header tab of your theme, or in a theme-component:

<script type="text/discourse-plugin" version="0.8">
controller = api.container.lookup('controller:composer');

controller.reopen({
  showPreview: false 
})
</script>

and that would make the composer open with the preview hidden by default.

I’d be careful about such a change though because it would apply to all the users on your community. Some of these users might actually prefer to have the preview visible by default.

7 Likes

Hi Joe, Thank you for the response. Seeing that this is a user preference, would the team consider making the editor preview enabled a toggle in Preferences > Interface > Other for a future version of Discourse? Users who have this setting toggled off will still be able to show preview for select posts as needed.

1 Like

IMO, Preview is essential and plays a vital role in understanding the final output of the post, Once such example with be images and other media, in the editor field you will see the shortcode whereas in the preview it will show the actual image and it’s alignment etc. If your forum is only text and no images then it may work but I personally prefer using images wherever required and preview seems pretty necessary for that.

4 Likes

No, there are no plans for this. Users have always been able to hide the preview using the “hide preview” link at the bottom right of the editor.

The main reasons why I would like to be able to personalize the post editor is because more often than not I do not need to see a preview of the post, it pushes the input section off-center and it wastes space on screen.

I understand there are people who need to make complex posts and therefore have no use for a personalize setting to auto-hide the preview. I feel that having the option to personalize the preview could make Discourse forums more user friendly for people who use the forum like me. I am not suggesting that there is any rush to incorporate this feature, simply that it is worth considering how different people use the forum even if it is not the most popular usage case.

Thank you for replying Jeff. Have a great weekend.

If you hide the preview, that preference is retained, and the preview will remain hidden for all future interactions with the editor. If you wish to force this on your sites audience you could hide the preview with site level CSS customizations.

2 Likes

Is the preference retained if I delete my internet history and cache? It doesn’t seem to be working for me on Chrome 70.

1 Like

It is retained per browser. Why are you deleting cache?

I like how Internet Explorer automatically deletes internet history and cache after closing the browser because it saves hard drive space without having to remember to clear space on my hard drive later. I was looking for a similar feature for Chrome and found the option to delete cookies after closing the browser. Disabling this feature allowed Discourse to remember my preference for auto-hiding the post editor preview, so I will stick with the browser setting disabled for now because auto-hiding post preview is more important to me than saving a little space on my hard drive.

3 Likes

I know that Chrome on Android has an option to clear storage for sites that you haven’t used in a while; maybe look into that?

3 Likes

Of your just a user and would like this functionality. You could use Tampermonkey with a script to disable the preview window.