[PR #4256] [MERGED] fix: preserve editor drafts across layout changes #6308

Closed
opened 2026-10-23 04:09:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4256
Author: @olegpro171
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/preserve-editor-drafts-on-resize


📝 Commits (3)

  • 9eb2f56 fix: preserve editor drafts across layout changes
  • 67ac44b Merge branch 'staging' into codex/preserve-editor-drafts-on-resize
  • ee073a6 Merge branch 'staging' into codex/preserve-editor-drafts-on-resize

📊 Changes

2 files changed (+111 additions, -32 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+78 -0)
📝 packages/client/src/components/layout/AppShell.tsx (+33 -32)

📄 Description

Linked issue

Closes #4244

Why this change

  • Resizing the browser across the desktop/mobile breakpoint unmounted and remounted the active character or persona editor. This discarded component-local unsaved text, color, and stats changes without warning.
  • Responsive layout changes should affect only presentation and must not reset an editor that is currently in use.

What changed

  • Keep the active detail editor at one stable position in the React tree across desktop and mobile layouts, preventing responsive breakpoint changes from remounting it.
  • Apply desktop detail-pane and mobile overlay presentation to the same persistent editor host.
  • Preserve the existing mobile sheet animation, safe-area handling, and desktop main-pane behavior.
  • Add Playwright regression coverage for character and persona editor drafts across desktop-to-mobile-to-desktop transitions.

Validation

Commands run:

  • pnpm check using repository-pinned pnpm 10.33.2 — passed.

  • Source-built Docker image — built successfully.

  • Container health endpoint returned status: ok and build 2.3.5+9eb2f56e59a3; the web UI returned HTTP 200.

  • Focused responsive-editor Playwright regressions — 2 passed.

  • Full pnpm smoke:ui — 145 passed, 85 skipped, and 12 failed; both tests added by this PR passed. Five representative failures were reproduced unchanged against the unmodified staging base. The remaining seven were not individually baseline-verified.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

Tested on macOS 26.5 with Safari 26.5:

  1. Started Marinara Engine with ./start.sh --skip-update and opened http://127.0.0.1:7860.
  2. Started creating a new character card.
  3. Entered unsaved test data in the following fields:
    • Metadata: Title / comment, Phonetic name, Creator, and Creator Notes.
    • Card: Description, Personality, Backstory, Appearance, Scenario, First Message, and Example Dialogue.
    • Convo: About Me, Convo Behavior, and Image Generation Instructions.
    • Colors: Set Name Display Color, Dialogue Highlight Color, and Message Box Color to the first preset.
    • Stats: Enabled RPG Stats and created a pool named Pool 3.
    • Advanced: System Prompt, Post-History Instructions, and Depth Prompt.
  4. Resized the browser until the application entered its mobile layout.
  5. Verified that every entered value remained intact.
  6. Expanded the browser until the application returned to its desktop layout.
  7. Verified that every entered value remained intact again.
  8. Repeated the field entry and both layout transitions while editing an existing character.
  9. Repeated the applicable field entry and both layout transitions while creating a new persona.
  10. Repeated the applicable field entry and both layout transitions while editing an existing persona.

All tested unsaved values were preserved through both responsive layout transitions without prompts, resets, or visible editor replacement.

Additionally, repeated the Card-tab persistence test in light mode, saved after crossing the responsive breakpoint, exited the editor, reopened it, and verified that the entered data had been persisted.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Safari recording: editor drafts preserved across responsive layout transitions

Summary by CodeRabbit

  • Bug Fixes
    • Preserved unsaved editor title text when switching between desktop and mobile layouts.
    • Improved responsive editor behavior so active detail views remain stable during layout changes.
  • Tests
    • Added regression coverage for title preservation in character and persona editors across responsive layout switches.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4256 **Author:** [@olegpro171](https://github.com/olegpro171) **Created:** 7/29/2026 **Status:** ✅ Merged **Merged:** 7/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/preserve-editor-drafts-on-resize` --- ### 📝 Commits (3) - [`9eb2f56`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9eb2f56e59a33fed343b8a540d1d20e3fb27f4f4) fix: preserve editor drafts across layout changes - [`67ac44b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/67ac44bcfd692e390d11ec396762261152f1bea5) Merge branch 'staging' into codex/preserve-editor-drafts-on-resize - [`ee073a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee073a626c4be5bc864067add3540cdee45b4bf7) Merge branch 'staging' into codex/preserve-editor-drafts-on-resize ### 📊 Changes **2 files changed** (+111 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+78 -0) 📝 `packages/client/src/components/layout/AppShell.tsx` (+33 -32) </details> ### 📄 Description ## Linked issue Closes #4244 ## Why this change - Resizing the browser across the desktop/mobile breakpoint unmounted and remounted the active character or persona editor. This discarded component-local unsaved text, color, and stats changes without warning. - Responsive layout changes should affect only presentation and must not reset an editor that is currently in use. ## What changed - Keep the active detail editor at one stable position in the React tree across desktop and mobile layouts, preventing responsive breakpoint changes from remounting it. - Apply desktop detail-pane and mobile overlay presentation to the same persistent editor host. - Preserve the existing mobile sheet animation, safe-area handling, and desktop main-pane behavior. - Add Playwright regression coverage for character and persona editor drafts across desktop-to-mobile-to-desktop transitions. ## Validation Commands run: - `pnpm check` using repository-pinned pnpm 10.33.2 — passed. - Source-built Docker image — built successfully. - Container health endpoint returned `status: ok` and build `2.3.5+9eb2f56e59a3`; the web UI returned HTTP 200. - Focused responsive-editor Playwright regressions — 2 passed. - Full pnpm smoke:ui — 145 passed, 85 skipped, and 12 failed; both tests added by this PR passed. Five representative failures were reproduced unchanged against the unmodified staging base. The remaining seven were not individually baseline-verified. - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Tested on macOS 26.5 with Safari 26.5: 1. Started Marinara Engine with `./start.sh --skip-update` and opened `http://127.0.0.1:7860`. 2. Started creating a new character card. 3. Entered unsaved test data in the following fields: - **Metadata:** Title / comment, Phonetic name, Creator, and Creator Notes. - **Card:** Description, Personality, Backstory, Appearance, Scenario, First Message, and Example Dialogue. - **Convo:** About Me, Convo Behavior, and Image Generation Instructions. - **Colors:** Set Name Display Color, Dialogue Highlight Color, and Message Box Color to the first preset. - **Stats:** Enabled RPG Stats and created a pool named `Pool 3`. - **Advanced:** System Prompt, Post-History Instructions, and Depth Prompt. 4. Resized the browser until the application entered its mobile layout. 5. Verified that every entered value remained intact. 6. Expanded the browser until the application returned to its desktop layout. 7. Verified that every entered value remained intact again. 8. Repeated the field entry and both layout transitions while editing an existing character. 9. Repeated the applicable field entry and both layout transitions while creating a new persona. 10. Repeated the applicable field entry and both layout transitions while editing an existing persona. All tested unsaved values were preserved through both responsive layout transitions without prompts, resets, or visible editor replacement. Additionally, repeated the Card-tab persistence test in light mode, saved after crossing the responsive breakpoint, exited the editor, reopened it, and verified that the entered data had been persisted. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) [Safari recording: editor drafts preserved across responsive layout transitions](https://github.com/user-attachments/assets/5ba37126-45ab-4703-bf63-9a52b4e9f141) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Preserved unsaved editor title text when switching between desktop and mobile layouts. * Improved responsive editor behavior so active detail views remain stable during layout changes. * **Tests** * Added regression coverage for title preservation in character and persona editors across responsive layout switches. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:09:11 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6308
No description provided.