feat: surface deadline-critical work in Attention (#273)
This commit is contained in:
1 parent
3decdb4cac
commit
98d6a29fa0
4 files changed
+88
-7
No files matched your search
@@ -313,6 +313,58 @@ process.stdout.write(JSON.stringify(queue.map(item => ({{title:item.title,reason
|
||||
]
|
||||
|
||||
|
||||
def test_attention_includes_only_assigned_deadline_and_priority_critical_work():
|
||||
payload = {
|
||||
"user": {"login": "timmy"},
|
||||
"issues": [
|
||||
{"number": 1, "title": "Assigned P0", "repository": "stackchain/api",
|
||||
"labels": ["P0"], "assignees": ["timmy"], "due_date": "2026-08-10T23:59:59Z"},
|
||||
{"number": 2, "title": "Assigned overdue", "repository": "stackchain/api",
|
||||
"labels": [], "assignees": ["timmy"], "due_date": "2026-08-06T23:59:59Z"},
|
||||
{"number": 3, "title": "Assigned due today", "repository": "stackchain/api",
|
||||
"labels": [], "assignees": ["timmy"], "due_date": "2026-08-07T23:59:59Z"},
|
||||
{"number": 4, "title": "Assigned future", "repository": "stackchain/api",
|
||||
"labels": [], "assignees": ["timmy"], "due_date": "2026-08-10T23:59:59Z"},
|
||||
{"number": 5, "title": "Unassigned P0", "repository": "stackchain/api",
|
||||
"labels": ["critical"], "assignees": [], "due_date": "2026-08-10T23:59:59Z"},
|
||||
{"number": 6, "title": "Unassigned overdue", "repository": "stackchain/api",
|
||||
"labels": [], "assignees": [], "due_date": "2026-08-06T23:59:59Z"},
|
||||
],
|
||||
"pull_requests": [
|
||||
{"number": 7, "title": "Updated review", "repository": "stackchain/web",
|
||||
"labels": [], "assignees": [], "work_reasons": ["review_requested"]},
|
||||
],
|
||||
"notifications": [
|
||||
{"id": 70, "number": 7, "repository": "stackchain/web", "unread": True,
|
||||
"subject_type": "PullRequest", "url": "https://forge.example/web/pulls/7"},
|
||||
],
|
||||
}
|
||||
script = f"""
|
||||
const buildMyWork = require({json.dumps(str(MY_WORK))});
|
||||
const items = buildMyWork({json.dumps(payload)}, new Date('2026-08-07T12:00:00Z'));
|
||||
const attention = buildMyWork.filterMyWork(items, 'attention');
|
||||
process.stdout.write(JSON.stringify({{
|
||||
titles: attention.map(item => item.title),
|
||||
count: buildMyWork.countMyWork(items).attention,
|
||||
reasons: Object.fromEntries(attention.map(item => [item.title, item.attention_reason])),
|
||||
}}));
|
||||
"""
|
||||
result = subprocess.run(
|
||||
["node", "-e", script], check=True, capture_output=True, text=True
|
||||
)
|
||||
|
||||
assert json.loads(result.stdout) == {
|
||||
"titles": ["Assigned P0", "Updated review", "Assigned overdue", "Assigned due today"],
|
||||
"count": 4,
|
||||
"reasons": {
|
||||
"Assigned P0": "P0 priority",
|
||||
"Updated review": "Unread update",
|
||||
"Assigned overdue": "Overdue",
|
||||
"Assigned due today": "Due today",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_confirmed_issue_labels_replace_snapshot_and_reprioritize_queue():
|
||||
payload = {
|
||||
"user": {"login": "timmy"},
|
||||
|
||||
@@ -91,10 +91,10 @@ async function dispatchNotificationClick(route) {{
|
||||
return json.loads(completed.stdout)
|
||||
|
||||
|
||||
def test_session_resume_flow_ships_in_a_new_shell_cache():
|
||||
def test_deadline_attention_flow_ships_in_a_new_shell_cache():
|
||||
source = WORKER.read_text()
|
||||
|
||||
assert "stackchain-dashboard-shell-v18" in source
|
||||
assert "stackchain-dashboard-shell-v19" in source
|
||||
|
||||
|
||||
def test_background_sync_event_flushes_closed_app_issue_outbox_only_for_its_tag():
|
||||
|
||||
Reference in new issue
Block a user