From 9fb32292701711ea90fe64588117852ddf26a471 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Mon, 16 Mar 2026 22:56:03 +0100 Subject: [PATCH] fix: lower tertiary gap threshold for narrow margin column detection Reduce gap threshold from max(40, 5%) to max(30, 2%) so page_ref columns (e.g. p.55/p.57) at ~56px gap are detected as tertiary columns. Co-Authored-By: Claude Opus 4.6 --- klausur-service/backend/grid_editor_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index 35b37f2..e332ab6 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -188,7 +188,7 @@ def _cluster_columns_by_alignment( # Must have significant gap to nearest significant cluster if sig_xs: min_dist = min(abs(c["mean_x"] - sx) for sx in sig_xs) - if min_dist < max(40, content_span * 0.05): + if min_dist < max(30, content_span * 0.02): continue tertiary.append(c)