diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index d4744ec..7ee1694 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -1736,6 +1736,17 @@ async def _build_grid_core( if fixed != text: cell["text"] = fixed + # --- Debug: log cell counts per column before empty-column removal --- + for z in zones_data: + if z.get("zone_type") == "content": + from collections import Counter as _Counter + _cc = _Counter(c.get("col_index") for c in z.get("cells", [])) + _cols = z.get("columns", []) + logger.info( + "pre-empty-col-removal zone %d: %d cols, cells_per_col=%s", + z.get("zone_index", 0), len(_cols), dict(sorted(_cc.items())), + ) + # --- Remove empty columns (no cells assigned) --- for z in zones_data: cells = z.get("cells", [])