embed mode: pass embed_mode to context, add conditional body class + CSS
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- board.py: pass embed_mode=True to template context when ?embed=1
- base.html: <body class="embed-mode"> when embed_mode is true
- CSS: body.embed-mode hides .sidebar, .topbar, .unified-header,
  .header-actions; removes app-layout margin/padding; adjusts editor
  padding and max-width for peek panel
- Sidebar and header now properly hidden in iframe via CSS
This commit is contained in:
2026-07-22 10:56:29 -04:00
parent afe670bdd3
commit cd6dac9ea6
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -1005,7 +1005,8 @@ async def view_page(request: Request, page_id: int):
"page_data": page_data,
"breadcrumb_items": nav_crumbs,
"nav_workspace_id": page.get("workspace_id") or 0,
"nav_page_id": page_id}
"nav_page_id": page_id,
"embed_mode": embed}
template = env.get_template("page_editor_embed.html" if embed else "page_editor.html")
response = template.render(**ctx)
return HTMLResponse(content=response, headers={"Cache-Control": "no-store, max-age=0"})
+8 -1
View File
@@ -88,12 +88,19 @@
font-size: 13px;
}
}
/* Embed mode — hide sidebar + header for peek panels */
body.embed-mode .sidebar { display: none !important; }
body.embed-mode .topbar, body.embed-mode .unified-header { display: none !important; }
body.embed-mode .topbar-right, body.embed-mode .header-actions { display: none !important; }
body.embed-mode .app-layout { margin-left: 0 !important; padding-top: 0 !important; }
body.embed-mode .page-editor-wrapper { padding: 8px 16px !important; max-width: 100% !important; }
body.embed-mode .page-cover-area { padding-top: 0 !important; }
</style>
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/alpine.min.js" defer></script>
<script src="/static/js/sortable.min.js" defer></script>
</head>
<body hx-headers='{"X-CSRF-Token":"__CSRF_PLACEHOLDER__"}'>
<body hx-headers='{"X-CSRF-Token":"__CSRF_PLACEHOLDER__"}'{% if embed_mode %} class="embed-mode"{% endif %}>
<div class="app-layout" x-data="appState()">
<!-- ═══════════ MOBILE SIDEBAR OVERLAY ═══════════ -->