Recipes & Troubleshooting (FAQ)
1. The workbench appears blank or has 0px height
RedDokia fills 100% × 100% of its parent container, so give the host wrapper an explicit height:
/* Option 1: Full viewport */
.workspace-host {
width: 100vw;
height: 100vh;
}
/* Option 2: Inside a flex column */
.workspace-host {
flex: 1;
min-height: 0;
}2. Does RedDokia work with Next.js / Nuxt / SvelteKit SSR?
- React (
reddokia/react): Renders a hydration-safe emptyreddokia-react-hostduring SSR. Add'use client'in Next.js App Router. - Style Injection:
ensureRedDokiaStyles()guards ontypeof document !== 'undefined'for safe server imports.
3. Pop-out (popoutView) is blocked by the browser
Call window.open() synchronously inside a direct user click handler. If blocked, RedDokia rolls the view back to its original group automatically.
4. Strict CSP blocks inline <style> injection
Set injectStyles={false} and import reddokia/style.css, or pass a per-request styleNonce. See Strict CSP & Production for full details.
5. How do I sync WebGPU / Three.js / Chart canvases on resize?
onViewResize(events) fires once per frame with width, height, left, top, and the persistent host DOM element keyed by viewId:
onViewResize={(events) => {
const vp = events['viewport'];
if (!vp) return;
renderer.setSize(vp.width, vp.height);
}}6. I changed layoutSchema, but the old layout still loads when storageKey is set
When storageKey is provided, the saved layout in localStorage takes precedence over the initial layout prop on reload.
- Reset at runtime: Call
controller.resetLayout()to clear the saved state and restore the initiallayoutSchema. - Schema migrations: Bump the key suffix (e.g.
storageKey="my-app-layout-v2") when deploying structural changes to your default workspace.
7. How do I spawn multiple dynamic tabs that share the same component?
Register a base template view in views, then call controller.openView(newViewId, { templateId, title, params }). Each spawned tab receives its own viewId and params in RedDokiaViewRenderProps while inheriting icon, groupActions, and tabContextMenu from the template view.
8. How do I prevent <iframe> elements from swallowing pointer events during drag/resize?
While a drag or sash resize is active, RedDokia sets data-reddokia-dragging on document.body. If your panels embed third-party <iframe> widgets, add one CSS rule so pointer moves stay uninterrupted:
body[data-reddokia-dragging] iframe {
pointer-events: none;
}9. Does RedDokia work on tablets and touchscreens?
Yes. Tabs (.rd-tab), split sashes (.rd-sash), floating headers (.rd-floating-header), 8-way resize handles (.rd-floating-resize-handle), and EdgeBar buttons (.rd-edgebar__btn) all use PointerEvent with touch-action: none so touch gestures are not hijacked by page scrolling. Note that OS pop-outs (window.open) depend on desktop browser windowing support.
10. Can I lock a layout or specific groups against user edits?
Set locked: true or showHeader: false on any group in layoutSchema to build fixed dashboards where dragging, splitting, and closing are disabled. See STEP 06 · Locked & Headerless for a live demo.