fix: contexte menu — window._wsData global + exposé avant await
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- @contextmenu.prevent passe par window._wsData (global) au lieu du scope Alpine
  → contourne tout problème de résolution de scope Alpine
- window._wsData = this déplacé AVANT le await fetch(...) dans init()
  → disponible immédiatement, pas après la réponse API
- Conserve @click.self pour fermer le menu en cliquant sur le fond
This commit is contained in:
2026-07-12 18:05:20 -04:00
parent 40a5d4edeb
commit 9ee0079a02
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ async def lifespan(_app: FastAPI):
app = FastAPI(
title="FlowDeck",
version="2.4.4",
version="2.4.5",
docs_url="/docs" if settings.log_level == "DEBUG" else None,
redoc_url=None,
lifespan=lifespan,
+3 -1
View File
@@ -341,7 +341,7 @@
@dragleave="onDragLeave($event)"
@drop.prevent="onDrop($event)"
@keydown="onKeydown($event)"
@contextmenu.prevent="onContextMenu($event)"
@contextmenu.prevent="if(window._wsData) window._wsData.onContextMenu($event)"
@click.self="ctxMenu.visible = false"
tabindex="0"
x-ref="layout">
@@ -1005,6 +1005,8 @@ document.addEventListener('alpine:init', function() {
async init() {
try {
// Expose globally for event handlers (BEFORE await)
window._wsData = this;
var url = '/api/local-workspace/tree';
if (this.currentFolder && this.currentFolder > 0) {
url += '?folder=' + this.currentFolder;