diff --git a/frontend/detail-defer.js b/frontend/detail-defer.js new file mode 100644 index 0000000..943da0c --- /dev/null +++ b/frontend/detail-defer.js @@ -0,0 +1,25 @@ +function createDetailDefer({ + laterWork, + session, + close, + refresh, + focus, + announce, + formatTime = value => new Date(value).toLocaleString(), +}) { + return { + defer(item, preset) { + if (!item) return false; + const until = laterWork.presetUntil(preset); + if (!laterWork.defer(item, until)) return false; + const inSession = session.active(); + if (!inSession) close(); + refresh(); + announce('Deferred until ' + formatTime(until) + '. It stays unread and unchanged in Gitea.'); + if (!inSession) focus(); + return true; + }, + }; +} + +if (typeof module !== 'undefined' && module.exports) module.exports = createDetailDefer; diff --git a/frontend/index.html b/frontend/index.html index e171104..74625ed 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -84,6 +84,11 @@ textarea { resize: vertical; min-height: 120px; } .my-work-card-title { display:block; margin:5px 0; font-weight:650; } .later-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; } .later-actions button { min-height:44px; width:100%; } +.detail-defer { grid-column:1/-1; max-width:100%; } +.detail-defer summary, .detail-defer button { min-height:44px; display:flex; align-items:center; justify-content:center; } +.detail-defer summary { cursor:pointer; border:1px solid #60a5fa; border-radius:10px; font-weight:700; } +.detail-defer-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; margin-top:8px; } +.review-sheet-actions { position:sticky; bottom:0; z-index:3; padding:10px 4px; padding-bottom:calc(10px + env(safe-area-inset-bottom)); background:rgba(11,21,38,.98); border-top:1px solid #2a496e; } .mark-update-read { min-height:44px; width:100%; } .read-update { min-height:44px; width:100%; display:flex; align-items:center; justify-content:center; } .load-more-notifications { min-height:44px; width:100%; margin-top:10px; } @@ -514,6 +519,7 @@ textarea { resize: vertical; min-height: 120px; } Open in Gitea +
Defer