feat: continue Today after ownership exits (#449)
This commit is contained in:
1 parent
f781410e80
commit
0280077e45
10 files changed
+100
-21
No files matched your search
+39
-5
@@ -917,6 +917,14 @@
|
||||
announce: message => { qs('#my-work-action-status').textContent = message; },
|
||||
advance: () => runTodayTransition('complete'),
|
||||
});
|
||||
async function completeOwnershipExitToday(item) {
|
||||
if (!item || !todayWork.remove(item)) return null;
|
||||
todaySync.enqueue('remove', todayWork.identity(item));
|
||||
todaySync.flush();
|
||||
refreshMyWorkView({ reconcileSession:false });
|
||||
warmTodayOffline();
|
||||
return await runTodayTransition('complete');
|
||||
}
|
||||
function setCommentNextVisibility(kind) {
|
||||
const item = kind === 'issue' ? selectedIssue : selectedPull;
|
||||
qs('#send-' + kind + '-comment-next').hidden = !item || !workSession.checkpointed(item);
|
||||
@@ -1947,6 +1955,7 @@
|
||||
qs('#issue-handoff-recipient').innerHTML = '<option value="">Select a teammate</option>';
|
||||
qs('#issue-handoff-recipient').disabled = true;
|
||||
qs('#confirm-issue-handoff').disabled = true;
|
||||
qs('#confirm-issue-handoff').textContent = workSession.checkpointed(item) ? 'Hand off & next' : 'Confirm handoff';
|
||||
qs('#load-issue-handoff').disabled = false;
|
||||
qs('#issue-handoff-status').textContent = 'Load teammates to transfer ownership.';
|
||||
qs('#issue-planning').open = false;
|
||||
@@ -1974,6 +1983,7 @@
|
||||
qs('#close-issue').textContent = offlineDetail ?
|
||||
(workSession.active() ? 'Queue close & next' : 'Queue issue closure') :
|
||||
(workSession.active() ? 'Close & next' : 'Close issue');
|
||||
qs('#release-issue').textContent = workSession.checkpointed(item) ? 'Release & next' : 'Release assignment';
|
||||
qs('#close-issue-sheet').focus();
|
||||
try {
|
||||
const detail = offlineDetail || await issueController.load(item);
|
||||
@@ -3679,6 +3689,7 @@
|
||||
qs('#release-issue').addEventListener('click', async () => {
|
||||
if (!selectedIssue || !window.confirm('Release ' + selectedIssue.key + ' from your My Work?')) return;
|
||||
const releasing = selectedIssue;
|
||||
const continuingSession = workSession.checkpointed(releasing);
|
||||
const button = qs('#release-issue');
|
||||
button.disabled = true;
|
||||
qs('#issue-sheet-status').textContent = 'Releasing assignment…';
|
||||
@@ -3688,9 +3699,20 @@
|
||||
lastContextSnapshot, releasing.repository, releasing.number
|
||||
);
|
||||
closeIssueSheet();
|
||||
paintMyWork(lastContextSnapshot);
|
||||
qs('#my-work-action-status').textContent = releasing.key + ' released.' +
|
||||
(confirmed.available ? ' It is available in Find Work.' : ' Other assignees remain.');
|
||||
if (continuingSession) {
|
||||
const transitionResult = await completeOwnershipExitToday(releasing);
|
||||
if (transitionResult === 'opened') {
|
||||
qs('#my-work-action-status').textContent = releasing.key + ' released. Next work item opened.';
|
||||
} else if (transitionResult === 'gated') {
|
||||
qs('#my-work-action-status').textContent = releasing.key + ' released. Choose the next ready Today item.';
|
||||
} else if (transitionResult === null) {
|
||||
qs('#my-work-action-status').textContent = releasing.key + ' released, but Today still needs completion.';
|
||||
}
|
||||
} else {
|
||||
paintMyWork(lastContextSnapshot);
|
||||
qs('#my-work-action-status').textContent = releasing.key + ' released.' +
|
||||
(confirmed.available ? ' It is available in Find Work.' : ' Other assignees remain.');
|
||||
}
|
||||
} catch (error) {
|
||||
qs('#issue-sheet-status').textContent = error.message + ' The issue remains in My Work; retry.';
|
||||
button.disabled = false;
|
||||
@@ -3734,6 +3756,7 @@
|
||||
const recipient = qs('#issue-handoff-recipient').value;
|
||||
if (!selectedIssue || !recipient || !window.confirm('Hand off ' + selectedIssue.key + ' to @' + recipient + '?')) return;
|
||||
const handingOff = selectedIssue;
|
||||
const continuingSession = workSession.checkpointed(handingOff);
|
||||
const button = qs('#confirm-issue-handoff');
|
||||
button.disabled = true;
|
||||
qs('#issue-handoff-status').textContent = 'Confirming handoff…';
|
||||
@@ -3743,8 +3766,19 @@
|
||||
lastContextSnapshot, handingOff.repository, handingOff.number
|
||||
);
|
||||
closeIssueSheet();
|
||||
paintMyWork(lastContextSnapshot);
|
||||
qs('#my-work-action-status').textContent = handingOff.key + ' handed off to @' + recipient + '.';
|
||||
if (continuingSession) {
|
||||
const transitionResult = await completeOwnershipExitToday(handingOff);
|
||||
if (transitionResult === 'opened') {
|
||||
qs('#my-work-action-status').textContent = handingOff.key + ' handed off to @' + recipient + '. Next work item opened.';
|
||||
} else if (transitionResult === 'gated') {
|
||||
qs('#my-work-action-status').textContent = handingOff.key + ' handed off to @' + recipient + '. Choose the next ready Today item.';
|
||||
} else if (transitionResult === null) {
|
||||
qs('#my-work-action-status').textContent = handingOff.key + ' handed off to @' + recipient + ', but Today still needs completion.';
|
||||
}
|
||||
} else {
|
||||
paintMyWork(lastContextSnapshot);
|
||||
qs('#my-work-action-status').textContent = handingOff.key + ' handed off to @' + recipient + '.';
|
||||
}
|
||||
} catch (error) {
|
||||
qs('#issue-handoff-status').textContent = error.message + ' The issue remains in My Work; retry.';
|
||||
button.disabled = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const BASE = new URL('./', self.location.href).pathname;
|
||||
importScripts(BASE + 'static/background-issue-sync.js');
|
||||
const CACHE = 'stackchain-dashboard-shell-v76';
|
||||
const CACHE = 'stackchain-dashboard-shell-v77';
|
||||
const OFFLINE_LEASE_URL = new URL(BASE + '__offline-session-lease', self.location.origin).href;
|
||||
const OUTAGE_STATUSES = new Set([500, 502, 503, 504]);
|
||||
const NAVIGATION_TIMEOUT_MS = self.__STACKCHAIN_NAVIGATION_TIMEOUT_MS || 4000;
|
||||
|
||||
Reference in new issue
Block a user