Skip to content

feat(design-mode): exit to pure-code mode when LP wasn't open at entry#2862

Merged
abose merged 6 commits intomainfrom
ai
Apr 28, 2026
Merged

feat(design-mode): exit to pure-code mode when LP wasn't open at entry#2862
abose merged 6 commits intomainfrom
ai

Conversation

@abose
Copy link
Copy Markdown
Member

@abose abose commented Apr 28, 2026

No description provided.

abose added 6 commits April 28, 2026 14:49
The design-mode toggle now remembers whether live preview was open when
entering. If LP was already open the exit behavior is unchanged — LP
stays visible at its prior width. If LP was closed and got opened only
because design mode needed it, exiting closes LP again and main-toolbar
shrinks back to the icon-bar width, returning the user to the pure
code-editing layout they started from.

The skipToolbarRestore path (LP was just closed by the user via
toolbar-go-live) is unaffected — no double-close.

Updates section-5 tests so the two branches are explicit mirrors of
each other: LP-was-open keeps LP visible with toolbar at LP width;
LP-wasn't-open closes LP with toolbar at icon-bar width.
Clicking #toolbar-go-live while in design mode now exits design mode
and leaves Live Preview open, instead of hiding LP and dropping back to
pure code mode. Outside design mode the button still toggles LP as
before.

Implemented as a capture-phase click listener on #toolbar-go-live that
stops propagation when editorCollapsed is true and calls
_setEditorCollapsed(false, { keepLivePreviewOpen: true }), forcing the
exit path to keep LP regardless of the entry-state snapshot.

Section-6 tests now cover both branches: in design mode the click
exits with LP visible at LP width; outside design mode the click hides
LP normally. Uses native el.click() so the capture-phase listener
actually fires (jQuery's synthetic .trigger("click") would skip it).
@sonarqubecloud
Copy link
Copy Markdown

@abose abose merged commit 014d954 into main Apr 28, 2026
14 of 21 checks passed
@abose abose deleted the ai branch April 28, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant