diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index 6d657bb..a04836c 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -1938,13 +1938,15 @@ async def _build_grid_core(session_id: str, session: dict) -> dict: "bbox_pct": last_cells[0].get("bbox_pct", {}), }) - # Remove footer rows from the table + # Mark footer rows (keep in table, just tag for frontend) if footer_rows: - remove_ris = {fr["row_index"] for fr in footer_rows} - z["cells"] = [c for c in z["cells"] - if c.get("row_index") not in remove_ris] - z["rows"] = [r for r in z["rows"] - if r["index"] not in remove_ris] + footer_ris = {fr["row_index"] for fr in footer_rows} + for r in z["rows"]: + if r["index"] in footer_ris: + r["is_footer"] = True + for c in z["cells"]: + if c.get("row_index") in footer_ris: + c["col_type"] = "footer" if page_refs or footer_rows: logger.info(