ContentPreviewSelector for templates should not show when code editor is open

Created on 16 September 2025, 15 days ago

Overview

To reproduce:
1. Add a new content template then open the template in the editor frame.
2. Click Add in the sidebar (+ icon) and click "Create code component" to create a new code component
3. Creating a code component should open up the code editor. You can see that the content preview navigation is rendered in the top.

Proposed resolution

We use the selector selectEditorFrameContext to determine whether we are on a template or entity. The TopBar correctly checks whether we are on a template to show the <ContentPreviewSelector/>. However the value is incorrectly set to 'template' when the code editor is open because it doesn't get updated.

I believe all we need is in code-editor/Preview.tsx, inside the useEffect without dependencies, we want to call setEditorFrameContext and set it to something else.

This might require introducing a third enum to EditorFrameContext in uiSlice.ts. Either an "undefined" which acts as neither or adding a "CODE" enum.

User interface changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States hooroomoo

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

Merge Requests

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