From e77f6067fa38b9356d6b7b889a0c8031d5b6c7c6 Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr <139972147+ZdenekSrotyr@users.noreply.github.com> Date: Fri, 15 May 2026 20:05:21 +0200 Subject: [PATCH] feat(memory): bulk-edit batch bar on All Items tab (#129) (#325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #62 / PR #126 — that PR shipped the bulk-edit batch bar in the Review tab only and deferred the symmetric bar on All Items. This adds it. Scope: - New .batch-bar block in #tab-all with selectAllAll, selectedCountAll, and the five bulk-edit buttons (Move to category / Move to domain / Add tag / Remove tag / Set audience). - renderItemCard signature: third param widened from boolean isReview to a 'review' | 'all' | 'browse' mode enum so the Browse tab's call site can explicitly suppress the row checkbox. The earlier iteration of this PR widened the checkbox condition without auditing other callers, which left the Browse tab with orphan checkboxes that fired updateSelectionCount('all') against an invisible tab. Adversarial-review fix. - updateSelectionCount('all') toggles the *BtnAll set; renderAllItems resets the header checkbox + recomputes counts on every re-render so stale selection state can't survive a list refresh. Approve / Reject stay scoped to Review per the issue's scope decision — status-change actions belong with the per-row action buttons or the keyboard workflow in Review. Existing JS plumbing already assumed tab-aware selection (getSelectedIds(tab), toggleSelectAll(tab), openBulkEditModal reads currentTab); the All-items DOM and the *BtnAll ID set are the only additions. Tests in tests/test_admin_memory_page_all_items_batch_bar.py: - test_admin_page_renders_all_items_batch_bar — all five button IDs + the select-all checkbox + the toggleSelectAll('all') callback are present on the rendered admin page. - test_all_items_bar_omits_approve_reject — Review-only Approve / Reject IDs do not appear with the All suffix (scope guard). - test_browse_tab_omits_row_checkbox — regression guard for the Browse-tab orphan checkbox: confirms the call site uses 'browse' mode and renderItemCard omits the checkbox markup on that branch. Closes #129. --- CHANGELOG.md | 10 +++ app/web/templates/admin_corporate_memory.html | 62 +++++++++++--- ...t_admin_memory_page_all_items_batch_bar.py | 84 +++++++++++++++++++ 3 files changed, 144 insertions(+), 12 deletions(-) create mode 100644 tests/test_admin_memory_page_all_items_batch_bar.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 503a41d..dad6005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ CalVer image tags (`stable-YYYY.MM.N`, `dev-YYYY.MM.N`) are produced for every C ## [Unreleased] +### Added +- **Corporate Memory — bulk-edit batch bar on the All Items tab.** + Symmetric to the Review-tab bar shipped in #126; row checkboxes, + "Select all" header, and the five bulk-edit actions (Move to + category / Move to domain / Add tag / Remove tag / Set audience) + now appear on `/corporate-memory-admin` All Items as well. Approve + / Reject stay scoped to Review per #129's scope decision (status + flips belong with the per-row actions or the keyboard workflow). + Closes #129. + ## [0.54.19] — 2026-05-15 ### Changed diff --git a/app/web/templates/admin_corporate_memory.html b/app/web/templates/admin_corporate_memory.html index cedff12..246f1c8 100644 --- a/app/web/templates/admin_corporate_memory.html +++ b/app/web/templates/admin_corporate_memory.html @@ -967,6 +967,25 @@