From d2d958e0cddee6f139644b27fe0a99720238605a Mon Sep 17 00:00:00 2001 From: claude-dev Date: Sat, 11 Apr 2026 21:32:45 +0000 Subject: [PATCH] LayoutManager: Zusammenfassung-Kachel registrieren + Layout-Migration - zusammenfassung in DEFAULT_LAYOUT und TILE_MAP eingetragen - Toggle-Button funktioniert jetzt (Kachel ein-/ausblenden) - Migration: Gespeicherte Layouts ohne neue Kacheln werden automatisch ergaenzt (kein manueller Reset noetig) --- src/static/js/layout.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/static/js/layout.js b/src/static/js/layout.js index ba699c0..fdf58f1 100644 --- a/src/static/js/layout.js +++ b/src/static/js/layout.js @@ -10,7 +10,8 @@ const LayoutManager = { _hiddenTiles: {}, DEFAULT_LAYOUT: [ - { id: 'lagebild', x: 0, y: 0, w: 6, h: 4, minW: 4, minH: 4 }, + { id: 'zusammenfassung', x: 0, y: 0, w: 12, h: 2, minW: 4, minH: 2 }, + { id: 'lagebild', x: 0, y: 2, w: 6, h: 4, minW: 4, minH: 4 }, { id: 'faktencheck', x: 6, y: 0, w: 6, h: 4, minW: 4, minH: 4 }, { id: 'quellen', x: 0, y: 4, w: 12, h: 2, minW: 6, minH: 2 }, { id: 'timeline', x: 0, y: 5, w: 12, h: 4, minW: 6, minH: 4 }, @@ -18,6 +19,7 @@ const LayoutManager = { ], TILE_MAP: { + zusammenfassung: '#zusammenfassung-card', lagebild: '.incident-analysis-summary', faktencheck: '.incident-analysis-factcheck', quellen: '.source-overview-card', @@ -43,6 +45,12 @@ const LayoutManager = { const saved = this._load(); if (saved) { + // Migration: Neue Kacheln ergaenzen die in alten Layouts fehlen + this.DEFAULT_LAYOUT.forEach(def => { + if (!saved.find(s => s.id === def.id)) { + saved.unshift({ id: def.id, x: def.x, y: def.y, w: def.w, h: def.h, visible: true }); + } + }); this._applyLayout(saved); }