<!-- AUTO-GENERATED by scripts/wi-claude-rules-sync.sh — do not edit. -->
<!-- bundle: 10-coding-journey-admin | sources: 1 .mdc files -->
---
paths:
  - "UI/**"
  - "assets/**"
  - "admin/**"
---

<!-- source: .cursor/rules/wi-admin-editor-performance.mdc -->

# WI Admin Editor Performance

When working on WI backend settings/dashboard tabs, keep the admin parent window separate from iframe/frontend pages.

## Learned Structure

- WI dashboard parent (`wp-admin/admin.php?page=webinarignition-dashboard&id=...`) does **not** need Gutenberg/block editor for GB live previews.
- GB/FSE preview cards in `UI/app/tab9.php` are real frontend pages inside `.page-preview-frame` iframes. Their frontend request supplies FSE/theme/block styles.
- Parent dashboard starts without editor/media stack by default. `inc/wi-admin-functions.php` and `inc/assets/class-admin-scripts.php` gate editor/media behind `wi_editor=1`.
- `assets/webinarignition-admin-dashboard.js` reloads once with `wi_editor=1&wi_tab=<tab>` only when a tab actually needs `wp.editor` or `wp.media`.
- Lazy rich editors are plain `textarea.wi-lazy-wpeditor` at first render, then initialized via `wiInitLazyEditorsIn(tabId)` on tab open.

## Do Not Regress

- Do not add unconditional `wp_enqueue_editor()`, `wp_enqueue_media()`, `wp-block-editor`, `wp-components`, or React/block handles to the dashboard start path.
- Do not render server-side `wp_editor()` in WI dashboard tab markup unless there is a measured reason. Prefer `textarea.wi-lazy-wpeditor`.
- Do not make iframe previews use `src` at initial page load. Use `data-src` and load when the tab becomes visible.
- Keep preview iframes muted when loaded; autoplay video in previews must not produce sound.

## QA Pattern

- Initial dashboard load should show: no `wp.editor`, no `wp.media`, no TinyMCE/Quicktags/Media-Views/block UI scripts in the parent.
- Opening tab9 should set iframe `src` only then, show spinner while loading, and render the real FSE-colored page.
- Opening editor-heavy tabs (for example emails/tab8) should reload with `wi_editor=1`, preserve the target tab, initialize TinyMCE, and keep the Insert Placeholder dropdown working.

