diff --git a/frontend/dashboard.css b/frontend/dashboard.css index 5c3353c..3a01191 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -10,6 +10,14 @@ header { position: sticky; top: 0; z-index: 20; padding: 12px 16px; display:flex .app-menu > summary { display:none; } .app-menu-panel { display:flex; gap:10px; align-items:center; flex-wrap:wrap; } button { background: linear-gradient(180deg,#1f3a5f,#15324d); border:1px solid #2a496e; color:#e5e7eb; padding:8px 12px; border-radius:10px; cursor:pointer; } +.draft-capacity-sheet { position:fixed; inset:0; z-index:96; display:flex; align-items:flex-end; justify-content:center; background:rgba(5,12,21,.82); backdrop-filter:blur(4px); } +.draft-capacity-sheet[hidden] { display:none; } +.draft-capacity-panel { box-sizing:border-box; width:min(620px,100%); max-height:100dvh; overflow:auto; overflow-x:hidden; padding:18px; padding-bottom:calc(18px + env(safe-area-inset-bottom)); border:1px solid #b45309; border-radius:18px 18px 0 0; background:#0b1526; } +.draft-capacity-panel h3 { margin:.25rem 0; overflow-wrap:anywhere; } +.draft-capacity-oldest { margin:14px 0; padding:12px; border:1px solid #31577f; border-radius:12px; overflow-wrap:anywhere; } +.draft-capacity-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; } +.draft-capacity-actions button { min-height:44px; width:100%; } +#replace-oldest-draft { grid-column:1 / -1; border-color:#b45309; } #sign-out-all { min-height:44px; } .active-devices-sheet { position:fixed; inset:0; z-index:80; display:flex; justify-content:flex-end; background:rgba(5,12,21,.72); backdrop-filter:blur(4px); } .active-devices-sheet[hidden] { display:none; } diff --git a/frontend/dashboard.js b/frontend/dashboard.js index 8e4d7c7..99beab5 100644 --- a/frontend/dashboard.js +++ b/frontend/dashboard.js @@ -4070,6 +4070,7 @@ body: qs('#create-issue-body').value.trim(), attachment: await createIssueAttachmentController.serialize(), }; + if (showDraftCapacityDialog(unfiledCaptures)) return; const savedCapture = await unfiledCaptures.save(captureDraft); if (resumedUnfiledCaptureId) { await unfiledCaptures.completeResume(resumedUnfiledCaptureId); @@ -4094,6 +4095,7 @@ qs('#create-issue-title').focus(); } }); + bindDraftCapacityDialog(); qs('#use-shared-content').addEventListener('click', () => { issueCapture.acceptSharedContent(); qs('#shared-content-conflict').hidden = true; diff --git a/frontend/draft-capacity-dialog.js b/frontend/draft-capacity-dialog.js new file mode 100644 index 0000000..b17056a --- /dev/null +++ b/frontend/draft-capacity-dialog.js @@ -0,0 +1,65 @@ +function showDraftCapacityDialog(captures) { + const state = captures.capacity(); + if (!state.full) return false; + const oldest = state.oldest; + qs('#draft-capacity-oldest').innerHTML = '' + escapeHtml(oldest.title) + '
Review saved work, keep editing, or explicitly replace the oldest Draft.
+ +