From 7a2c6d3f2a48fc451460747bcd49dda3c4b87ffd Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 3 Mar 2026 16:12:19 +0000 Subject: [PATCH] feat: sequential numbering on focus items within domain groups Display-only row numbers (1, 2, 3...) scoped per domain group. Numbers update instantly on drag-and-drop reorder via JS renumber. Co-Authored-By: Claude Opus 4.6 --- templates/focus.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/templates/focus.html b/templates/focus.html index c3f1122..bc843da 100644 --- a/templates/focus.html +++ b/templates/focus.html @@ -17,13 +17,13 @@
- + {% for domain in hierarchy %} - {% for item in domain.rows %} +
+ @@ -36,6 +36,7 @@
{{ loop.index }} {% with reorder_url="/focus/reorder", item_id=item.id, extra_fields={"focus_date": focus_date|string} %}{% include 'partials/reorder_arrows.html' %}{% endwith %}
@@ -215,6 +216,17 @@ }); }); + // Renumber rows within each domain group + function renumberFocusRows() { + document.querySelectorAll('.focus-drag-group').forEach(function(tbody) { + var rows = tbody.querySelectorAll('.focus-drag-row'); + rows.forEach(function(row, i) { + var numCell = row.querySelector('.focus-row-num'); + if (numCell) numCell.textContent = i + 1; + }); + }); + } + // Drag-and-drop reorder within domain groups var dragRow = null; var dragGroup = null; @@ -277,6 +289,7 @@ } else { tbody.insertBefore(dragRow, row); } + renumberFocusRows(); }); }); })();