diff --git a/frontend/dashboard.css b/frontend/dashboard.css index 663fb90..b0dc904 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -268,6 +268,9 @@ textarea { resize: vertical; min-height: 120px; } .retry-work-route[hidden] { display:none; } .my-work-bulk { position:sticky; bottom:0; z-index:4; margin:10px -4px -12px; padding:10px 4px; padding-bottom:calc(10px + env(safe-area-inset-bottom)); background:rgba(11,21,38,.98); border-top:1px solid #2a496e; } .my-work-bulk button { min-height:44px; width:100%; } +.my-work-bulk-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } +.my-work-bulk-actions button { min-height:44px; width:100%; } +.my-work-bulk-actions #bulk-mark-read { grid-column:1 / -1; } .my-work[data-stale="true"] { border-color:#fcd34d; } .review-sheet { position:fixed; inset:0; z-index:50; display:none; justify-content:flex-end; background:rgba(5,12,21,.72); backdrop-filter:blur(4px); } .review-sheet.open { display:flex; } diff --git a/frontend/dashboard.js b/frontend/dashboard.js index 104cd32..9a10e9e 100644 --- a/frontend/dashboard.js +++ b/frontend/dashboard.js @@ -2504,6 +2504,7 @@ }); const bulkBar = qs('#bulk-mark-read-bar'); const bulkButton = qs('#bulk-mark-read'); + const updateIds = notificationIds(visible); const selectionControls = qs('#update-selection-controls'); selectionControls.hidden = selectedWorkFilter !== 'update' || updateIds.length === 0; @@ -2515,6 +2516,9 @@ qs('#load-more-notifications').hidden = selectedWorkFilter !== 'update' || !notificationPagination.has_more; bulkButton.disabled = bulkMarkPending || selection.count === 0; + document.querySelectorAll('[data-defer-selected]').forEach(button => { + button.disabled = bulkMarkPending || selection.count === 0 || !planningOwnerLogin; + }); bulkButton.textContent = bulkConfirmationPending ? 'Confirm marking ' + selection.count + ' selected read' : 'Mark ' + selection.count + ' selected read'; @@ -5514,6 +5518,18 @@ notificationSelection.cancel(); qs('#select-updates').focus(); }); + document.querySelectorAll('[data-defer-selected]').forEach(button => button.addEventListener('click', () => { + const selection = notificationSelection.snapshot(); + const ids = new Set(selection.ids); + const selectedUpdates = lastMyWork.filter(item => item.has_update && ids.has(item.notification_id)); + const until = laterWork.presetUntil(button.dataset.deferSelected); + const result = laterWork.deferMany(selectedUpdates, until); + qs('#my-work-action-status').textContent = result === 'deferred' ? + selection.count + ' updates deferred until ' + fmt(until) + '; work stays unread and unchanged in Gitea.' : + 'Could not save Later on this device. Selection unchanged.'; + if (result === 'deferred') notificationSelection.cancel(); + refreshMyWorkView(); + })); qs('#bulk-mark-read').addEventListener('click', async () => { const selection = notificationSelection.snapshot(); if (!selection.ids.length || bulkMarkPending) return; diff --git a/frontend/index.html b/frontend/index.html index 789f2c8..9eb550d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -178,7 +178,11 @@