Make the mobile Queues summary truthful #744
|
|
@ -605,7 +605,7 @@ textarea { resize: vertical; min-height: 120px; }
|
||||||
.mobile-task-action { min-width:0; min-height:44px; padding:6px 2px; border:0; border-radius:8px; background:transparent; display:grid; place-items:center; gap:2px; font-size:12px; }
|
.mobile-task-action { min-width:0; min-height:44px; padding:6px 2px; border:0; border-radius:8px; background:transparent; display:grid; place-items:center; gap:2px; font-size:12px; }
|
||||||
.mobile-task-action[hidden] { display:none; }
|
.mobile-task-action[hidden] { display:none; }
|
||||||
.mobile-task-action[aria-current="page"] { color:#bfdbfe; background:#17365a; outline:1px solid #31577f; }
|
.mobile-task-action[aria-current="page"] { color:#bfdbfe; background:#17365a; outline:1px solid #31577f; }
|
||||||
.mobile-task-count { min-width:18px; min-height:18px; padding:1px 5px; border-radius:999px; background:#31577f; font-size:11px; line-height:16px; }
|
.mobile-task-count { min-width:18px; min-height:18px; max-width:100%; padding:1px 5px; border-radius:999px; background:#31577f; font-size:10px; line-height:16px; white-space:nowrap; }
|
||||||
.mobile-task-deadline { padding:1px 5px; border-radius:999px; color:#fef3c7; background:#92400e; font-size:10px; line-height:14px; }
|
.mobile-task-deadline { padding:1px 5px; border-radius:999px; color:#fef3c7; background:#92400e; font-size:10px; line-height:14px; }
|
||||||
.attention-interruption:not([hidden]) { max-width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 12px; padding:10px 12px; border:1px solid #31577f; border-radius:10px; background:#102641; }
|
.attention-interruption:not([hidden]) { max-width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 12px; padding:10px 12px; border:1px solid #31577f; border-radius:10px; background:#102641; }
|
||||||
.attention-interruption button { min-height:44px; flex:0 0 auto; }
|
.attention-interruption button { min-height:44px; flex:0 0 auto; }
|
||||||
|
|
|
||||||
|
|
@ -987,7 +987,7 @@
|
||||||
<button class="mobile-task-action" data-mobile-task="find" type="button">Find</button>
|
<button class="mobile-task-action" data-mobile-task="find" type="button">Find</button>
|
||||||
<button class="mobile-task-action" data-mobile-task="new" type="button">New</button>
|
<button class="mobile-task-action" data-mobile-task="new" type="button">New</button>
|
||||||
<button class="mobile-task-action" data-mobile-task="search" type="button">Search</button>
|
<button class="mobile-task-action" data-mobile-task="search" type="button">Search</button>
|
||||||
<button class="mobile-task-action" data-mobile-task="queues" type="button" aria-label="Queues, 0 items"><span>Queues <span class="mobile-task-count" id="mobile-queue-count" hidden>0</span></span><span class="mobile-task-deadline" id="mobile-deadline-count" hidden>0 due</span></button>
|
<button class="mobile-task-action" data-mobile-task="queues" type="button" aria-label="Queues: no active queues; no upcoming deadlines"><span>Queues <span class="mobile-task-count" id="mobile-queue-count" hidden>0 active</span></span><span class="mobile-task-deadline" id="mobile-deadline-count" hidden>0 due</span></button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="footer">Creative AI-imbued UI • stackchain-dashboard</div>
|
<div class="footer">Creative AI-imbued UI • stackchain-dashboard</div>
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@
|
||||||
function updateQueues(counts) {
|
function updateQueues(counts) {
|
||||||
const names = 'today agenda attention update later draft'.split(' ');
|
const names = 'today agenda attention update later draft'.split(' ');
|
||||||
const normalized = Object.fromEntries(names.map(name => [name, Math.max(0, Number(counts?.[name]) || 0)]));
|
const normalized = Object.fromEntries(names.map(name => [name, Math.max(0, Number(counts?.[name]) || 0)]));
|
||||||
const total = ['today', 'attention', 'later', 'draft'].reduce((sum, name) => sum + normalized[name], 0);
|
const actionableNames = ['today', 'attention', 'update', 'later', 'draft'];
|
||||||
|
const active = actionableNames.reduce((total, name) => total + (normalized[name] > 0 ? 1 : 0), 0);
|
||||||
Object.entries(options.queueCounts || {}).forEach(([name, element]) => {
|
Object.entries(options.queueCounts || {}).forEach(([name, element]) => {
|
||||||
element.textContent = String(normalized[name] || 0);
|
element.textContent = String(normalized[name] || 0);
|
||||||
});
|
});
|
||||||
|
|
@ -105,8 +106,8 @@
|
||||||
'aria-label', 'Updates, ' + normalized.update + ' unread conversations'
|
'aria-label', 'Updates, ' + normalized.update + ' unread conversations'
|
||||||
);
|
);
|
||||||
if (options.queueBadge) {
|
if (options.queueBadge) {
|
||||||
options.queueBadge.textContent = String(total);
|
options.queueBadge.textContent = active + ' active';
|
||||||
options.queueBadge.hidden = total === 0;
|
options.queueBadge.hidden = active === 0;
|
||||||
}
|
}
|
||||||
if (options.deadlineBadge) {
|
if (options.deadlineBadge) {
|
||||||
options.deadlineBadge.textContent = normalized.agenda + ' due';
|
options.deadlineBadge.textContent = normalized.agenda + ' due';
|
||||||
|
|
@ -116,10 +117,16 @@
|
||||||
if (normalized.agenda > 0) options.queueRows.agenda.setAttribute('data-deadlines', 'true');
|
if (normalized.agenda > 0) options.queueRows.agenda.setAttribute('data-deadlines', 'true');
|
||||||
else options.queueRows.agenda.removeAttribute('data-deadlines');
|
else options.queueRows.agenda.removeAttribute('data-deadlines');
|
||||||
}
|
}
|
||||||
const deadlineLabel = normalized.agenda > 0
|
const label = active === 0 && normalized.agenda === 0
|
||||||
? ', ' + normalized.agenda + ' upcoming deadlines'
|
? 'Queues: no active queues; no upcoming deadlines'
|
||||||
: '';
|
: 'Queues: Today ' + normalized.today
|
||||||
buttons.queues?.setAttribute('aria-label', 'Queues, ' + total + ' items' + deadlineLabel);
|
+ ', Agenda ' + normalized.agenda + ' due'
|
||||||
|
+ ', Attention ' + normalized.attention
|
||||||
|
+ ', Updates ' + normalized.update
|
||||||
|
+ ', Later ' + normalized.later
|
||||||
|
+ ', Drafts ' + normalized.draft
|
||||||
|
+ '; ' + active + ' active ' + (active === 1 ? 'queue' : 'queues');
|
||||||
|
buttons.queues?.setAttribute('aria-label', label);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {start, select, refreshVisibility, updateAttention, updateQueues, updateWork};
|
return {start, select, refreshVisibility, updateAttention, updateQueues, updateWork};
|
||||||
|
|
|
||||||
|
|
@ -314,14 +314,22 @@ queues.click(); rows.recaps.click();
|
||||||
const closedAfterUtility = !sheet.open;
|
const closedAfterUtility = !sheet.open;
|
||||||
queues.click(); close.click();
|
queues.click(); close.click();
|
||||||
const populated = {{
|
const populated = {{
|
||||||
|
badge:badge.textContent, badgeHidden:badge.hidden,
|
||||||
deadline:deadline.textContent, deadlineHidden:deadline.hidden,
|
deadline:deadline.textContent, deadlineHidden:deadline.hidden,
|
||||||
agendaDue:rows.agenda.attributes['data-deadlines'] || null,
|
agendaDue:rows.agenda.attributes['data-deadlines'] || null,
|
||||||
badgeLabel:queues.attributes['aria-label'],
|
badgeLabel:queues.attributes['aria-label'],
|
||||||
}};
|
}};
|
||||||
|
dock.updateQueues({{today:0, agenda:0, attention:0, update:7, later:0, draft:0}});
|
||||||
|
const updatesOnly = {{
|
||||||
|
badge:badge.textContent, badgeHidden:badge.hidden,
|
||||||
|
deadlineHidden:deadline.hidden,
|
||||||
|
badgeLabel:queues.attributes['aria-label'],
|
||||||
|
}};
|
||||||
dock.updateQueues({{today:0, agenda:0, attention:0, update:0, later:0, draft:0}});
|
dock.updateQueues({{today:0, agenda:0, attention:0, update:0, later:0, draft:0}});
|
||||||
process.stdout.write(JSON.stringify({{
|
process.stdout.write(JSON.stringify({{
|
||||||
opened, closedAfterSelect, closedAfterUtility, selected, utilities,
|
opened, closedAfterSelect, closedAfterUtility, selected, utilities,
|
||||||
badge:badge.textContent, populated,
|
badge:badge.textContent, populated, updatesOnly,
|
||||||
|
clearedBadgeHidden:badge.hidden,
|
||||||
clearedDeadlineHidden:deadline.hidden,
|
clearedDeadlineHidden:deadline.hidden,
|
||||||
clearedAgendaDue:rows.agenda.attributes['data-deadlines'] || null,
|
clearedAgendaDue:rows.agenda.attributes['data-deadlines'] || null,
|
||||||
clearedBadgeLabel:queues.attributes['aria-label'],
|
clearedBadgeLabel:queues.attributes['aria-label'],
|
||||||
|
|
@ -340,12 +348,25 @@ process.stdout.write(JSON.stringify({{
|
||||||
"closedAfterUtility": True,
|
"closedAfterUtility": True,
|
||||||
"selected": ["update"],
|
"selected": ["update"],
|
||||||
"utilities": ["recaps:trigger"],
|
"utilities": ["recaps:trigger"],
|
||||||
# Updates are a drill-down within Attention and must not inflate the aggregate badge.
|
"badge": "0 active",
|
||||||
"badge": "0",
|
"populated": {
|
||||||
"populated": {"badgeLabel": "Queues, 10 items, 5 upcoming deadlines", "deadline": "5 due", "deadlineHidden": False, "agendaDue": "true"},
|
"badge": "5 active",
|
||||||
|
"badgeHidden": False,
|
||||||
|
"badgeLabel": "Queues: Today 2, Agenda 5 due, Attention 1, Updates 5, Later 3, Drafts 4; 5 active queues",
|
||||||
|
"deadline": "5 due",
|
||||||
|
"deadlineHidden": False,
|
||||||
|
"agendaDue": "true",
|
||||||
|
},
|
||||||
|
"updatesOnly": {
|
||||||
|
"badge": "1 active",
|
||||||
|
"badgeHidden": False,
|
||||||
|
"deadlineHidden": True,
|
||||||
|
"badgeLabel": "Queues: Today 0, Agenda 0 due, Attention 0, Updates 7, Later 0, Drafts 0; 1 active queue",
|
||||||
|
},
|
||||||
|
"clearedBadgeHidden": True,
|
||||||
"clearedDeadlineHidden": True,
|
"clearedDeadlineHidden": True,
|
||||||
"clearedAgendaDue": None,
|
"clearedAgendaDue": None,
|
||||||
"clearedBadgeLabel": "Queues, 0 items",
|
"clearedBadgeLabel": "Queues: no active queues; no upcoming deadlines",
|
||||||
"counts": {"today": "0", "agenda": "0", "attention": "0", "update": "0", "later": "0", "draft": "0", "recaps": "0"},
|
"counts": {"today": "0", "agenda": "0", "attention": "0", "update": "0", "later": "0", "draft": "0", "recaps": "0"},
|
||||||
"updateLabel": "Updates, 0 unread conversations",
|
"updateLabel": "Updates, 0 unread conversations",
|
||||||
"queueFocuses": 3,
|
"queueFocuses": 3,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user