create-pmos 0.436.0 → 0.437.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +12 -0
- package/workspace/guide/home.md +21 -10
- package/workspace/home-rows-test.js +188 -115
- package/workspace/lib/mention-cli.js +45 -21
- package/workspace/lib/mention-store.js +196 -27
- package/workspace/lib/news-for-you.js +8 -16
- package/workspace/lib/routes-mentions.js +7 -2
- package/workspace/lib/routes-news.js +5 -11
- package/workspace/lib/source-reads.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-briefing-depth-test.js +2 -2
- package/workspace/public/pm/cozy-home-rows.css +88 -62
- package/workspace/public/pm/cozy-news.js +8 -27
- package/workspace/public/pm/home-day.js +4 -6
- package/workspace/public/pm/home-mentions.js +327 -193
- package/workspace/skills/morning-brief.skill +2 -1
- package/workspace/skills/sources-read.skill +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* pm/cozy-home-rows.css — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas
|
|
1
|
+
/* pm/cozy-home-rows.css — the two rows at the top of Home and the Mentions Viewer (Viewer kit; canvas MnA1 to MnA6 "Mentions, calm", XvARecHome).
|
|
2
2
|
* Loaded once by home-mentions.js. Token variables only (cozy.css). The rows reuse Home's row (.hv-card, .hv-r, .hm-rm). */
|
|
3
3
|
|
|
4
4
|
/* ── the rows on Home ── */
|
|
@@ -24,69 +24,95 @@
|
|
|
24
24
|
@keyframes hr-crit { 0% { transform: scale(1); opacity: .4; } 60% { transform: scale(2.2); opacity: 0; } 100% { transform: scale(2.2); opacity: 0; } }
|
|
25
25
|
@media (prefers-reduced-motion: reduce) { .hr-rec-card .hr-rdot::after { animation: none; } }
|
|
26
26
|
|
|
27
|
-
/* ── the Mentions Viewer ── */
|
|
28
|
-
.hr-vb { display: flex; flex-direction: column; gap: 12px; }
|
|
29
|
-
.hr-ml { display: flex; flex-direction: column; }
|
|
30
|
-
.hr-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: var(--fs-3); color: var(--cz-ink); text-align: left; cursor: pointer; }
|
|
31
|
-
.hr-mi + .hr-mi { border-top: 1px solid var(--cz-hair); border-radius: 0; }
|
|
32
|
-
.hr-mi:hover { background: color-mix(in srgb, var(--cz-well) 45%, var(--cz-card)); }
|
|
33
|
-
.hr-mi:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: -2px; border-radius: 12px; }
|
|
34
|
-
.hr-mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); flex: none; }
|
|
35
|
-
.hr-mdot.read { background: transparent; }
|
|
36
|
-
.hr-mw { flex: 1; min-width: 0; }
|
|
37
|
-
.hr-mw b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
38
|
-
.hr-mw span { display: block; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
39
|
-
.hr-mcv { color: var(--cz-ink3); display: inline-flex; flex: none; }
|
|
40
|
-
|
|
41
|
-
/* the source excerpt: the thread, the ticket, the passage or the mail, with the mention outlined */
|
|
42
|
-
.hr-thr, .hr-tkt { display: flex; flex-direction: column; gap: 8px; background: var(--cz-well); border-radius: 16px; padding: 12px; }
|
|
43
|
-
.hr-msg { display: flex; gap: 10px; font-size: var(--fs-3); line-height: 1.45; }
|
|
44
|
-
.hr-msg.me { background: var(--cz-card); border-radius: 12px; padding: 8px; box-shadow: 0 0 0 1.5px var(--cz-c-9bc7f4); }
|
|
45
|
-
.hr-av { width: 28px; height: 28px; border-radius: 50%; background: var(--cz-well2); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-1); font-weight: 800; flex: none; }
|
|
46
|
-
.hr-w { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
|
|
47
|
-
.hr-w small { font-size: var(--fs-1); color: var(--cz-ink3); }
|
|
48
|
-
.hr-w small b { color: var(--cz-ink); }
|
|
49
|
-
.hr-kv { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
50
|
-
.hr-kv span { font-size: var(--fs-2); font-weight: 700; background: var(--cz-card); border-radius: 8px; padding: 3px 8px; box-shadow: 0 0 0 1px var(--cz-hair); }
|
|
51
|
-
.hr-mail { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
52
|
-
.hr-mail b { color: var(--cz-ink); font-size: var(--fs-3); }
|
|
53
|
-
.hr-quote { border-left: 3px solid var(--cz-c-9bc7f4); padding: 4px 0 4px 12px; font-size: var(--fs-2); line-height: 1.5; color: var(--cz-ink2); overflow-wrap: anywhere; }
|
|
54
|
-
.hr-chk { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-3); }
|
|
55
|
-
.hr-chk > b { font-size: var(--fs-2); color: var(--cz-ink2); }
|
|
56
|
-
.hr-cl { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
|
|
57
|
-
.hr-ok { color: var(--cz-ok); flex: none; display: inline-flex; padding-top: 1px; }
|
|
58
|
-
|
|
59
|
-
/* ── Mentions A+ (XmsMentionsGrill, XmsDeskList, XmsDeskOne) ── */
|
|
60
|
-
.hr-sum { background: color-mix(in srgb, var(--cz-well) 60%, var(--cz-card)); border-radius: 20px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
|
|
61
|
-
.hr-sumb { display: flex; align-items: center; gap: 12px; }
|
|
62
|
-
.hr-sumb .czs-p { flex: 1; min-width: 0; }
|
|
63
|
-
.hr-old { color: var(--cz-risk); font-weight: 700; }
|
|
27
|
+
/* ── the Mentions Viewer: the round solid press and the 30-day question (kept from Mentions A+) ── */
|
|
64
28
|
.hr-rp { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--cz-solid); color: var(--cz-onsolid); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
|
|
65
29
|
.hr-rp:focus-visible, .hr-ckb:focus-visible, .hr-all:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
66
|
-
.hr-mi.hr-w8 { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
|
|
67
|
-
.hr-mi .hr-mw > span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
|
|
68
|
-
.hr-mw b { display: flex; align-items: center; gap: 6px; }
|
|
69
|
-
.hr-cn { font-style: normal; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--cz-well); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
|
|
70
|
-
.hr-age { flex: none; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
|
|
71
|
-
.hr-age.late { color: var(--cz-risk); }
|
|
72
|
-
.hr-dr { font-style: normal; font-weight: 700; color: var(--cz-blueink); }
|
|
73
|
-
.hr-nc { font-style: normal; color: var(--cz-ink3); }
|
|
74
|
-
.hr-st { color: var(--cz-ink3); }
|
|
75
|
-
.hr-rd .hr-mw b { color: var(--cz-ink2); }
|
|
76
|
-
.hr-day { margin: 10px 10px 2px; font-size: var(--fs-2); font-weight: 800; color: var(--cz-ink3); }
|
|
77
|
-
.hr-day:first-child { margin-top: 2px; }
|
|
78
|
-
.hr-all { display: block; width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--cz-hair); background: none; font: inherit; font-size: var(--fs-3); font-weight: 800; color: var(--cz-blueink); cursor: pointer; }
|
|
79
30
|
.hr-ck { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--cz-riskbg); color: var(--cz-risk); font-size: var(--fs-3); font-weight: 700; }
|
|
80
31
|
.hr-ck span { flex: 1; min-width: 0; }
|
|
81
32
|
.hr-ckb { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--cz-card); color: var(--cz-ink2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
.
|
|
85
|
-
.
|
|
86
|
-
.
|
|
87
|
-
.
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
.
|
|
92
|
-
.
|
|
33
|
+
|
|
34
|
+
/* ── Mentions, calm (batch 16 item 12; canvas MnA1 to MnA6): one row per conversation, three folds, the conversation ── */
|
|
35
|
+
.mn-vb { display: flex; flex-direction: column; gap: 12px; }
|
|
36
|
+
.mn-open-card { display: flex; gap: 14px; align-items: flex-start; background: var(--cz-card); border-radius: 20px; padding: 14px 16px; box-shadow: 0 0 0 1px var(--cz-hair); }
|
|
37
|
+
.mn-open-card .ad-svg, .mn-open-card .ad-dot { flex: none; margin-top: 2px; }
|
|
38
|
+
.mn-oc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
|
|
39
|
+
.mn-oc p { margin: 0; font-size: var(--fs-4); line-height: 1.5; color: var(--cz-ink); }
|
|
40
|
+
.mn-acts { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
|
|
41
|
+
.mn-acts.sp { justify-content: space-between; flex-wrap: wrap; }
|
|
42
|
+
.mn-acts.sp > span { display: inline-flex; gap: 8px; }
|
|
43
|
+
.mn-ib { background: var(--cz-well); }
|
|
44
|
+
.mn-sb { width: 40px; height: 40px; }
|
|
45
|
+
.mn-list { display: flex; flex-direction: column; }
|
|
46
|
+
.mn-row { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 10px; }
|
|
47
|
+
.mn-row + .mn-row, .mn-list > .mn-more { border-top: 1px solid var(--cz-hair); }
|
|
48
|
+
.mn-row.sel .mn-open { background: var(--cz-bluebg); }
|
|
49
|
+
.mn-open { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 6px 0; border: 0; border-radius: 14px; background: none; font: inherit; color: var(--cz-ink); text-align: left; cursor: pointer; }
|
|
50
|
+
.mn-row.sel .mn-open { padding-bottom: 10px; }
|
|
51
|
+
.mn-open:hover { background: color-mix(in srgb, var(--cz-well) 45%, transparent); }
|
|
52
|
+
.mn-open:focus-visible, .mn-more:focus-visible, .mn-all:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
53
|
+
.mn-av { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--cz-well2); color: var(--cz-ink2); display: inline-grid; place-items: center; font-size: var(--fs-1); font-weight: 800; flex: none; }
|
|
54
|
+
.mn-bg { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--cz-card); color: var(--cz-ink3); display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--cz-card); }
|
|
55
|
+
.mn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
|
|
56
|
+
.mn-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
|
|
57
|
+
.mn-nm { flex: none; max-width: 60%; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
58
|
+
.mn-pl { flex: 0 1 auto; min-width: 0; font-size: var(--fs-2); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
59
|
+
.mn-r { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: none; }
|
|
60
|
+
.mn-n { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: var(--cz-well); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; display: inline-grid; place-items: center; }
|
|
61
|
+
.mn-age { font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink3); white-space: nowrap; }
|
|
62
|
+
.mn-age.late { color: var(--cz-risk); }
|
|
63
|
+
.mn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cz-blue); }
|
|
64
|
+
.mn-gist { font-size: var(--fs-3); line-height: 1.45; color: var(--cz-ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
|
|
65
|
+
.mn-gist em { font-style: normal; font-weight: 700; color: var(--cz-blueink); }
|
|
66
|
+
.mn-tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
67
|
+
.mn-row > .mn-dr, .mn-row > .mn-sent, .mn-row > .mn-acts, .mn-row > .hr-ck { margin-left: 54px; }
|
|
68
|
+
.mn-dr { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 14px; background: var(--cz-bluebg); font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink); }
|
|
69
|
+
.mn-dr p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
70
|
+
.mn-dr.no { background: var(--cz-well); }
|
|
71
|
+
.mn-dr.in { background: var(--cz-card); }
|
|
72
|
+
.mn-drh { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2); font-weight: 700; color: var(--cz-blueink); white-space: normal !important; }
|
|
73
|
+
.mn-dr.no .mn-drh { color: var(--cz-ink2); }
|
|
74
|
+
.mn-sent { margin: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
75
|
+
.mn-more { align-self: stretch; text-align: left; padding: 12px 6px 4px 54px; border: 0; background: none; font: inherit; font-size: var(--fs-3); font-weight: 700; color: var(--cz-blueink); cursor: pointer; }
|
|
76
|
+
.mn-all { width: 36px; height: 36px; border: 0; border-radius: 999px; background: none; color: var(--cz-ink2); display: inline-grid; place-items: center; cursor: pointer; }
|
|
77
|
+
.mn-stk { display: inline-flex; align-items: center; height: 36px; padding-right: 6px; }
|
|
78
|
+
.czs-sec.t:has(.mn-stk) > .czs-row { padding-right: 112px; }
|
|
79
|
+
.mn-stk i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--cz-well2); color: var(--cz-ink2); font-size: var(--fs-1); font-weight: 800; display: inline-grid; place-items: center; box-shadow: 0 0 0 2px var(--cz-card); }
|
|
80
|
+
.mn-stk i + i { margin-left: -6px; }
|
|
81
|
+
.mn-gap { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-2); line-height: 1.45; color: var(--cz-ink2); }
|
|
82
|
+
.mn-gap p { margin: 0; flex: 1; min-width: 0; }
|
|
83
|
+
.mn-gap b { color: var(--cz-ink); }
|
|
84
|
+
.mn-foot { margin: 4px 0 0; font-size: var(--fs-1); color: var(--cz-ink3); }
|
|
85
|
+
/* one conversation */
|
|
86
|
+
.mn-ask { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 20px; background: var(--cz-bluebg); }
|
|
87
|
+
.mn-ask.calm { background: color-mix(in srgb, var(--cz-well) 60%, var(--cz-card)); }
|
|
88
|
+
.mn-ak { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-blueink); }
|
|
89
|
+
.mn-ak.late { color: var(--cz-risk); }
|
|
90
|
+
.mn-ask.calm .mn-ak { color: var(--cz-ink3); }
|
|
91
|
+
.mn-aq { margin: 0; font-size: var(--fs-3); line-height: 1.5; color: var(--cz-ink); overflow-wrap: anywhere; }
|
|
92
|
+
.mn-ask .mn-ib { background: var(--cz-card); }
|
|
93
|
+
.mn-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 20px; background: var(--cz-card); box-shadow: 0 0 0 1px var(--cz-hair); font-size: var(--fs-3); line-height: 1.5; }
|
|
94
|
+
.mn-h { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--cz-blueink); }
|
|
95
|
+
.mn-h b { color: var(--cz-ink); }
|
|
96
|
+
.mn-st, .mn-fd { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
|
|
97
|
+
.mn-st li { display: flex; gap: 10px; align-items: flex-start; }
|
|
98
|
+
.mn-st li svg { flex: none; margin-top: 3px; color: var(--cz-blueink); }
|
|
99
|
+
.mn-st li.open svg { color: var(--cz-risk); }
|
|
100
|
+
.mn-fd { padding-left: 18px; list-style: disc; gap: 6px; }
|
|
101
|
+
.mn-watch { flex-direction: row; align-items: center; gap: 10px; }
|
|
102
|
+
.mn-watch > svg { flex: none; color: var(--cz-blueink); }
|
|
103
|
+
.mn-watch p { margin: 0; flex: 1; min-width: 0; }
|
|
104
|
+
.mn-wl { margin: 0; display: flex; gap: 8px; align-items: center; font-size: var(--fs-2); color: var(--cz-ink2); }
|
|
105
|
+
.mn-wl svg { color: var(--cz-blueink); flex: none; }
|
|
106
|
+
.mn-thr { display: flex; flex-direction: column; gap: 8px; }
|
|
107
|
+
.mn-day { margin: 6px 0 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); }
|
|
108
|
+
.mn-msg { align-self: flex-start; max-width: 80%; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 14px; background: var(--cz-card); box-shadow: 0 0 0 1px var(--cz-hair); font-size: var(--fs-3); line-height: 1.45; overflow-wrap: anywhere; }
|
|
109
|
+
.mn-msg small { font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink3); }
|
|
110
|
+
.mn-msg.me { align-self: flex-end; background: var(--cz-bluebg); box-shadow: none; }
|
|
111
|
+
/* the desktop: the list and the conversation side by side (MnA4) */
|
|
112
|
+
.mn-split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
|
|
113
|
+
.mn-col { min-width: 0; }
|
|
114
|
+
.mn-conv { position: sticky; top: 0; }
|
|
115
|
+
.mn-ch { display: flex; align-items: center; gap: 12px; }
|
|
116
|
+
.mn-cht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
117
|
+
.mn-cht b { font-size: var(--fs-4); }
|
|
118
|
+
.mn-cht small { font-size: var(--fs-2); color: var(--cz-ink3); }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* pm/cozy-news.js — New for you, the whole list in the Viewer (initiative premium-uncovered-features, E2; canvas EvInbox, HmAround; since
|
|
2
2
|
* feedback batch 16 item 5b, canvas FmA2Day, it opens from the New for you fold of Your day: "N more", or one of its rows).
|
|
3
3
|
*
|
|
4
|
-
* For your information only:
|
|
5
|
-
*
|
|
6
|
-
* Mark all seen marks them at once (POST /api/news-for-you/seen). Open on a row shows
|
|
7
|
-
*
|
|
4
|
+
* For your information only: Given to you, Finished while you were away (GET /api/news-for-you), and today's digests from the morning
|
|
5
|
+
* brief (GET /api/briefing-premium). Mentions owns every mention (batch 16 item 12), so none is here. An item leaves once it is seen: the
|
|
6
|
+
* items shown are marked seen when the card closes, and Mark all seen marks them at once (POST /api/news-for-you/seen). Open on a row shows
|
|
7
|
+
* the item: a task with its source; finished work opens where it waits. The page's meetings ring, its two legend cards, "Where
|
|
8
8
|
* the rest went" and the "Not here" note are gone (FmAudit: Your day holds the meetings, and a page that explains itself is chrome).
|
|
9
9
|
* openNews({ go?, view? }) → the body element; view: an item's id opens straight on that item */
|
|
10
10
|
import { pmGet, pmPost } from './http.js';
|
|
@@ -12,20 +12,17 @@ import { open as vwOpen, current as vwCurrent } from './cozy-viewer.js';
|
|
|
12
12
|
import { esc, svg, ICON, toast, wsParam, wsQ, skelRows, cantRead, allClear } from './cozy-evui.js';
|
|
13
13
|
import { initials, ago } from './cozy-evmodel.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
const N = { r: null, dig: null, view: '', body: null, shown: new Set(), madd: new Set(), mread: new Set(), busy: false };
|
|
15
|
+
const N = { r: null, dig: null, view: '', body: null, shown: new Set(), busy: false };
|
|
17
16
|
const homeUrl = (params) => { const q = new URLSearchParams(params); if (wsParam()) q.set('ws', wsParam()); return '/premium.html?' + q.toString(); };
|
|
18
17
|
const https = (u) => (/^https:\/\/\S+$/i.test(String(u || '')) ? u : '');
|
|
19
18
|
/** The deep link of a finished item, as the bell's was: a My work item opens its dialog; anything else opens on Home. */
|
|
20
19
|
const finHref = (it) => (/^item:/.test(it.open) ? homeUrl({ item: it.open.slice(5) }) : homeUrl(it.pws ? { open: it.open, pws: it.pws } : { open: it.open }));
|
|
21
|
-
const taskLine = (m) => (m.asks ? 'Reply to ' + String(m.who || 'the sender').split(/\s+/)[0] + ' (' + (SRC[m.source] || m.source || 'source') + ') by today' : 'Read ' + String(m.who || 'the sender').split(/\s+/)[0] + '\'s note (' + (SRC[m.source] || m.source || 'source') + ')');
|
|
22
20
|
|
|
23
21
|
function items() { return N.r && N.r.ok ? N.r.groups.flatMap((g) => g.items) : []; }
|
|
24
22
|
function rowHtml(it) {
|
|
25
|
-
const who = it.kind === '
|
|
23
|
+
const who = it.kind === 'task' ? (it.from || 'Someone') : (it.product || 'Agent');
|
|
26
24
|
const av = `<span class="ev-av${it.kind === 'finished' ? ' b' : ''}" aria-hidden="true">${esc(initials(who))}</span>`;
|
|
27
|
-
const sub = it.kind === '
|
|
28
|
-
: it.kind === 'task' ? ['From ' + (it.from || 'a source') + (it.key ? ' ' + it.key : ''), it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · ')
|
|
25
|
+
const sub = it.kind === 'task' ? ['From ' + (it.from || 'a source') + (it.key ? ' ' + it.key : ''), it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · ')
|
|
29
26
|
: [it.what, it.product, it.target, it.at ? ago(new Date(it.at).toISOString()) : ''].filter(Boolean).join(' · ');
|
|
30
27
|
return `<div class="ev-trow" data-ev-id="${esc(it.id)}"><i class="ev-dot you" aria-hidden="true"></i>${av}<div class="ev-tx"><p><b>${esc(it.title)}</b></p><p class="ev-small ev-mut">${esc(sub)}</p></div>`
|
|
31
28
|
+ `<button type="button" class="ev-ib" data-ev-open="${esc(it.id)}" aria-label="Open: ${esc(it.title)}" title="Open">${svg(ICON.open, 16)}</button></div>`;
|
|
@@ -43,18 +40,11 @@ function listHtml() {
|
|
|
43
40
|
else if (!r.ok) body = cantRead({ what: 'New for you', why: r.error || '' });
|
|
44
41
|
else if (!r.count) body = allClear('Nothing new since you last looked');
|
|
45
42
|
else body = r.groups.map((g) => `<p class="ev-lbl">${esc(g.label)}</p>` + g.items.map(rowHtml).join('')).join('');
|
|
46
|
-
const notRead = r && r.ok && r.read ? [['
|
|
43
|
+
const notRead = r && r.ok && r.read ? [['inbox', 'The agents\' results'], ['work', 'Your tasks']].filter(([k]) => r.read[k] === false).map(([, l]) => l) : [];
|
|
47
44
|
return head + body + (notRead.length ? `<p class="ev-small ev-mut" role="status">Not read: ${esc(notRead.join(', '))}.</p>` : '') + digHtml();
|
|
48
45
|
}
|
|
49
46
|
function detailHtml(it) {
|
|
50
47
|
const back = '<div class="ev-head"><button type="button" class="ev-btn sm ghost" data-ev-back>' + svg(ICON.back, 16) + 'New for you</button></div>';
|
|
51
|
-
if (it.kind === 'mention') {
|
|
52
|
-
const l = https(it.link), done = N.madd.has(it.id), read = N.mread.has(it.id);
|
|
53
|
-
return back + `<p class="ev-lbl">${esc([SRC[it.source] || it.source, it.where, ago(it.at ? new Date(it.at).toISOString() : '')].filter(Boolean).join(' · '))}${it.asks ? ' · asks you something' : ''}</p><h2 class="ev-h2">${esc(it.title)}</h2><p class="ev-q">${esc(it.text)}</p>`
|
|
54
|
-
+ (it.initiative ? `<p class="ev-small ev-mut">${esc(it.initiative)}</p>` : '')
|
|
55
|
-
+ `<div class="ev-acts">${done ? '<span class="ev-pill ok">In your tasks</span>' : '<button type="button" class="ev-btn sm pri" data-ev-act="task">Make it a task</button>'}${read ? '<span class="ev-pill">Marked read</span>' : '<button type="button" class="ev-btn sm" data-ev-act="read">Mark read</button>'}${l ? `<a class="ev-btn sm" href="${esc(l)}" target="_blank" rel="noopener noreferrer">Open in ${esc(SRC[it.source] || 'its source')}</a>` : ''}</div>`
|
|
56
|
-
+ (done ? '' : `<p class="ev-small ev-mut">Make it a task adds “${esc(taskLine(it))}” to your tasks. Mark read keeps it out of today's list. Nothing here replies or posts.</p>`);
|
|
57
|
-
}
|
|
58
48
|
const l = https(it.link);
|
|
59
49
|
return back + `<p class="ev-lbl">Given to you · ${esc(it.from || 'a source')}</p><h2 class="ev-h2">${esc(it.title.replace(/^New task: /, ''))}</h2>`
|
|
60
50
|
+ `<p class="ev-small ev-mut">${esc([it.key, it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · '))}</p>`
|
|
@@ -108,15 +98,6 @@ function wire(b, o) {
|
|
|
108
98
|
if (it.kind === 'finished') { await seen([it.id]); location.assign(finHref(it)); return; }
|
|
109
99
|
N.view = it.id; draw(); const f = b.querySelector('[data-ev-back]'); if (f) f.focus(); return;
|
|
110
100
|
}
|
|
111
|
-
if (t.dataset.evAct) {
|
|
112
|
-
const it = items().find((x) => x.id === N.view); if (!it) return;
|
|
113
|
-
N.busy = true; t.disabled = true;
|
|
114
|
-
const r = t.dataset.evAct === 'task' ? await pmPost('/api/pm-items/add', { line: taskLine(it) }) : await pmPost('/api/mentions/read', { id: it.mid, read: true });
|
|
115
|
-
N.busy = false;
|
|
116
|
-
if (!r || r.ok === false) { toast('That did not go through' + (r && r.error ? ': ' + r.error : '.')); t.disabled = false; return; }
|
|
117
|
-
if (t.dataset.evAct === 'task') { N.madd.add(it.id); toast('Added to your tasks: ' + taskLine(it).replace(/ by today$/, '')); } else { N.mread.add(it.id); toast('Marked read.'); }
|
|
118
|
-
draw();
|
|
119
|
-
}
|
|
120
101
|
};
|
|
121
102
|
void o;
|
|
122
103
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* YdE2AllClear, YdE3Evening, YdE6BigDay, YdE7Rough): the opening card is Claude's small mood face and one first-person line, with chips for
|
|
5
5
|
* the work Claude really did; Your move holds only the calls that need the PM; the rest folds:
|
|
6
6
|
* Your move the calls only the PM can make (homeList's move rows with call: true), open by default
|
|
7
|
-
* New for you (feedback batch 16 item 5b, canvas FmA2Day) the FYI items of GET /api/news-for-you:
|
|
7
|
+
* New for you (feedback batch 16 item 5b, canvas FmA2Day) the FYI items of GET /api/news-for-you: tasks given to the PM and work
|
|
8
8
|
* finished while away. The 3 newest, then "N more" (the whole list in the Viewer, cozy-news.js); ✓✓ in the fold's header
|
|
9
9
|
* marks all seen; today's digests of the morning brief are one row. No item and no digest, no fold. It replaces the New
|
|
10
10
|
* for you page of the place menu.
|
|
@@ -181,15 +181,13 @@ export function nightHtml(Y) {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
/* one New for you item (FmA2Day): the blue dot, who, the words and where it came from; a press opens it in the Viewer (cozy-news.js) */
|
|
184
|
-
const SRC = { slack: 'Slack', jira: 'Jira', confluence: 'Confluence', mail: 'Mail' };
|
|
185
184
|
const MARK2 = 'M2 12.5l4.5 4.5L15 8M9 15l2 2L22 7';
|
|
186
185
|
export const NEWS_SHOWN = 3;
|
|
187
186
|
function newsRow(it, now) {
|
|
188
|
-
const who = it.kind === '
|
|
187
|
+
const who = it.kind === 'task' ? (it.from || 'Someone') : (it.product || 'Claude');
|
|
189
188
|
const when = it.at ? ago(new Date(it.at).toISOString(), now) : '';
|
|
190
|
-
const head = it.
|
|
191
|
-
const sub = it.kind === '
|
|
192
|
-
: it.kind === 'task' ? ['Given to you' + (it.from ? ' by ' + it.from : ''), it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · ')
|
|
189
|
+
const head = it.title;
|
|
190
|
+
const sub = it.kind === 'task' ? ['Given to you' + (it.from ? ' by ' + it.from : ''), it.due ? 'due ' + it.due : '', it.initiative ? 'filed under ' + it.initiative : ''].filter(Boolean).join(' · ')
|
|
193
191
|
: ['Finished while you were away', it.target, when].filter(Boolean).join(' · ');
|
|
194
192
|
return `<button type="button" class="yd-nw" data-yd="news" data-id="${esc(it.id)}"><i class="yd-nd" aria-hidden="true"></i><span class="yd-av${it.kind === 'finished' ? ' b' : ''}" aria-hidden="true">${esc(initials(who))}</span><span class="yd-mt"><b>${esc(head)}</b><em>${esc(sub)}</em></span></button>`;
|
|
195
193
|
}
|