create-pmos 0.443.0 → 0.444.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.
Files changed (56) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-board-test.js +8 -2
  7. package/workspace/briefing-premium-insights-test.js +40 -38
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +12 -0
  10. package/workspace/goals-clear-ui-test.js +34 -20
  11. package/workspace/guide/home.md +5 -0
  12. package/workspace/intel-report-ui-test.js +1 -1
  13. package/workspace/lib/board-premium.js +1 -1
  14. package/workspace/lib/engine/boards.js +9 -2
  15. package/workspace/lib/routes-boards.js +40 -1
  16. package/workspace/live-pill-round-test.js +178 -0
  17. package/workspace/okr-goals-ui-test.js +21 -19
  18. package/workspace/package-lock.json +2 -2
  19. package/workspace/package.json +1 -1
  20. package/workspace/panels-test.js +231 -0
  21. package/workspace/premium-rec-tab-test.js +2 -1
  22. package/workspace/premium-vw-item-test.js +10 -2
  23. package/workspace/premium-vw-jira-test.js +3 -0
  24. package/workspace/public/pm/bd-ini-panel.js +3 -2
  25. package/workspace/public/pm/cozy-adler.js +21 -0
  26. package/workspace/public/pm/cozy-divider.css +32 -0
  27. package/workspace/public/pm/cozy-divider.js +45 -0
  28. package/workspace/public/pm/cozy-insights.css +14 -0
  29. package/workspace/public/pm/cozy-live-pill.css +16 -22
  30. package/workspace/public/pm/cozy-live-pill.js +28 -17
  31. package/workspace/public/pm/cozy-panels.css +59 -0
  32. package/workspace/public/pm/cozy-panels.js +524 -0
  33. package/workspace/public/pm/cozy-viewer.js +146 -70
  34. package/workspace/public/pm/goals-clear.js +9 -2
  35. package/workspace/public/pm/home-app.js +22 -11
  36. package/workspace/public/pm/home-ini.js +9 -3
  37. package/workspace/public/pm/home-today.js +4 -2
  38. package/workspace/public/pm/ini-edit.js +401 -0
  39. package/workspace/public/pm/ini-tasks.js +42 -18
  40. package/workspace/public/pm/ini-versions.js +18 -4
  41. package/workspace/public/pm/ini-view-model.js +8 -4
  42. package/workspace/public/pm/ini-view.css +88 -1
  43. package/workspace/public/pm/ini-view.js +42 -11
  44. package/workspace/public/pm/premium-board.js +8 -6
  45. package/workspace/public/pm/premium-insights.js +205 -43
  46. package/workspace/public/pm/task-card.css +2 -0
  47. package/workspace/public/pm/task-card.js +4 -1
  48. package/workspace/stage-card-tasks-test.js +396 -0
  49. package/workspace/stage-card-test.js +1 -1
  50. package/workspace/task-delete-test.js +9 -1
  51. package/workspace/task-milestones-test.js +3 -3
  52. package/workspace/task-press-test.js +12 -4
  53. package/workspace/task-views-test.js +8 -4
  54. package/workspace/test-lists/batch18-live-pill-round.json +10 -0
  55. package/workspace/test-lists/batch18-panels.json +9 -0
  56. package/workspace/test-lists/stage-card-tasks.json +6 -0
@@ -178,7 +178,7 @@ const draftTask = (id, uid) => { const R = ROWS.get(id); return R && R.d ? R.d.t
178
178
  const iniOfUid = (uid) => { for (const [id, R] of ROWS) if (R.d && R.d.tasks.some((x) => x.uid === uid)) return id; return null; };
179
179
  async function draftDates(H, uid, patch) {
180
180
  const id = iniOfUid(uid), x = id && draftTask(id, uid);
181
- const set = {}; if ('start' in patch) set.start = patch.start || ''; if ('due' in patch) set.due = patch.due || '';
181
+ const set = {}; if ('start' in patch) set.start = patch.start || ''; if ('due' in patch) set.due = patch.due || ''; if ('milestone' in patch) set.milestone = !!patch.milestone;
182
182
  const res = await write(H, '/task', { task: uid, set });
183
183
  if (!res || res.ok === false) return failed(H, res);
184
184
  took(id, res); if (H.redraw) H.redraw();
@@ -186,6 +186,16 @@ async function draftDates(H, uid, patch) {
186
186
  say(H, 'Dates saved in ' + name + (x ? ': ' + x.title : '') + '.', res.from ? async () => { const u = await write(H, '/task', { task: uid, set: res.from }); if (u && u.ok) { took(id, u); if (H.redraw) H.redraw(); } else failed(H, u, 'The undo did not land.'); } : undefined);
187
187
  return true;
188
188
  }
189
+ /** One change to a draft's task (its name or its stage), with Undo. */
190
+ async function draftSet(H, uid, set, words) {
191
+ const id = iniOfUid(uid), x = id && draftTask(id, uid);
192
+ const res = await write(H, '/task', { task: uid, set });
193
+ if (!res || res.ok === false) return failed(H, res);
194
+ took(id, res); if (H.redraw) H.redraw();
195
+ const R = ROWS.get(id), name = R && R.vs ? R.vs.show.name : 'the draft';
196
+ say(H, words + name + (x ? ': ' + x.title : '') + '.', res.from ? async () => { const u = await write(H, '/task', { task: uid, set: res.from }); if (u && u.ok) { took(id, u); if (H.redraw) H.redraw(); } else failed(H, u, 'The undo did not land.'); } : undefined);
197
+ return true;
198
+ }
189
199
  async function draftStatus(H, uid, state) {
190
200
  const id = iniOfUid(uid), x = id && draftTask(id, uid);
191
201
  const R = ROWS.get(id), name = R && R.vs ? R.vs.show.name : 'the draft';
@@ -338,11 +348,15 @@ export function wrap(h, body, shown) {
338
348
  W.dates = (uid, patch) => (isDraft(uid) ? draftDates(W, uid, patch) : h.dates && h.dates(uid, patch));
339
349
  if (h.remove) W.remove = (uid) => (isDraft(uid) ? draftDrop(W, uid) : h.remove(uid));
340
350
  W.openTask = (uid, b) => (isDraft(uid) ? undefined : h.openTask && h.openTask(uid, b));
341
- W.addTask = async (title, inp) => {
351
+ // opt (batch 18 item 16): the stage whose + took the task ({ section, name, start?, due? }); without it, the stage now
352
+ W.addTask = async (title, inp, opt) => {
342
353
  const id = idOf(), v = id && shown ? shown(id) : null;
343
354
  const now = v && v.tasks ? v.tasks.sections.find((s) => s.kind === 'stage' && s.status === 'now') : null;
344
- if (id && await draftAdd(W, id, title, inp, now ? now.key : '')) return;
345
- return h.addTask && h.addTask(title, inp);
355
+ if (id && await draftAdd(W, id, title, inp, opt && opt.section != null ? opt.section : now ? now.key : '')) return;
356
+ return h.addTask && h.addTask(title, inp, opt);
346
357
  };
358
+ // a draft's task renamed or moved in place (batch 18 item 16): the draft changes, Live is not touched
359
+ W.rename = (uid, title) => (isDraft(uid) ? draftSet(W, uid, { title }, 'Renamed in ') : h.rename && h.rename(uid, title));
360
+ W.move = (uid, m) => (isDraft(uid) ? draftSet(W, uid, { section: m.to }, 'Moved in ') : h.move && h.move(uid, m));
347
361
  return W;
348
362
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * iniView(r, ctx) → { summary, stage, tasks, vs } the whole view, as data (vs: what pm/ini-versions.js rowFor put on the row, or null)
8
8
  * ctx: { steps (Product feature's eight, the model's), today (YYYY-MM-DD, the model's day), usual ({ days } | null, the usual days in the
9
- * current stage), grill ({ open, later } | null), program ({ id, title } | null), jiraAt ('Jira · 2h ago' | ''), ask ({ title } | null: a
9
+ * current stage), grill ({ open, later } | null), program ({ id, title } | null), jiraAt ('Jira · 2h ago' | ''), jiraReadAt (the ISO time of the last Jira read: an open Jira row says "read 4 min ago"), ask ({ title } | null: a
10
10
  * session that waits on the PM, Home's; n: how many wait on this initiative), docs (count | null), linked (count | null), claude (Claude's
11
11
  * line while a session works on it, Home's), people ([{ name }]: the stakeholders) }
12
12
  * stagesOf(r, steps) → { list: [{ key, name, ms, status: done | now | next | skip, why }], cur } the initiative's OWN workflow (D99)
@@ -128,6 +128,8 @@ function rowOf(k0, today, J = null) {
128
128
  return { uid: k.uid, title: k.title, status: k.status || 'To do', closed, done: k.status === 'Done', wont: k.status === "Won't do", prog: k.status === 'In progress', late, due,
129
129
  days, lateText: late ? plural(between(d, today), 'day', 'days') + ' late' : '', item: !!k.item, ms: !!k.milestone, // ms: the ◇ flag (batch 11 item 3)
130
130
  start: k.start || '', end: k.end || '', owner: who, av: initials(k.owner),
131
+ // the open row's date chips (batch 18 item 16): each day alone; rank: the PM's order inside its stage (a task-order line)
132
+ startText: k.start ? dateY(k.start, today) : '', dueText: d ? dateY(k.end, today) : '', rank: Number.isFinite(k.rank) ? k.rank : null,
131
133
  sub: [k.status === 'In progress' ? 'In progress' : '', due, who && who !== 'You' ? who : ''].filter(Boolean).join(' · '), wbs: wbsOf(k.title), canCheck: !!k.uid && !k.draft && !J, order: k.order,
132
134
  // planned versus actual (batch 11 item 8, pm/ini-versions.js): the compared version's days where they differ, ⊕ added after it, a draft's task
133
135
  cmp: k.cmp || null, added: !!k.added, dr: !!k.draft,
@@ -150,10 +152,12 @@ export function linkRows(rows, tickets) {
150
152
  return rows.map((x) => { if (x.jkey || !x._k) return x; const J = linkOf(x.title, by); return J ? { ...rowOf(x._k, x._t, J), sec: x.sec } : x; });
151
153
  }
152
154
  const urgent = (a, b) => (b.late - a.late) || (a.end || '9999').localeCompare(b.end || '9999') || (a.order != null && b.order != null ? a.order - b.order : 0);
155
+ /* the PM's own order inside a stage (batch 18 item 16, a drag in the List) leads: the ranked tasks top to bottom, then the rest by urgency */
156
+ const ranked = (a, b) => (a.rank != null && b.rank != null ? a.rank - b.rank : a.rank != null ? -1 : b.rank != null ? 1 : urgent(a, b));
153
157
  /** A section's rows: open ones first by urgency; past 5 open, the 3 most urgent then the rest folded by the next WBS level; done fold last
154
158
  * (Won't do joins it), then the archived ones, which only the List draws, folded after Done (batch 9 item 5b). */
155
159
  export function bodyOf(rows, archived = []) {
156
- const open = rows.filter((x) => !x.closed).sort(urgent), done = rows.filter((x) => x.closed);
160
+ const open = rows.filter((x) => !x.closed).sort(ranked), done = rows.filter((x) => x.closed);
157
161
  if (open.length <= 5) return { top: open, groups: [], done, archived };
158
162
  const top = open.slice(0, 3), rest = open.slice(3), by = new Map();
159
163
  for (const x of rest) { const k = x.wbs ? x.wbs.top : ''; if (!by.has(k)) by.set(k, []); by.get(k).push(x); }
@@ -161,7 +165,7 @@ export function bodyOf(rows, archived = []) {
161
165
  const groups = [...by.entries()].map(([k, xs]) => {
162
166
  const codes = xs.map((x) => x.wbs && x.wbs.code).filter(Boolean).sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
163
167
  const label = !k ? 'Other open tasks' : heads.get(k) ? k + ' ' + heads.get(k) : codes.length > 1 ? codes[0] + ' to ' + codes[codes.length - 1] : codes[0] || k;
164
- return { key: k || '-', label, rows: xs.sort(urgent), n: xs.length };
168
+ return { key: k || '-', label, rows: xs.sort(ranked), n: xs.length };
165
169
  });
166
170
  // one group only says nothing the count does not: then it is "N more open"
167
171
  if (groups.length === 1) groups[0].label = plural(rest.length, 'more open', 'more open');
@@ -292,7 +296,7 @@ export function iniView(r, ctx = {}) {
292
296
  summary.wf = r.wf || { id: PF_ID, name: 'Product feature', icon: 'feature' };
293
297
  summary.program = ctx.program || null;
294
298
  const today2 = (n) => String(n).padStart(2, '0');
295
- return { vs: r.__vs || null, links: r.__vs && r.__vs.draft ? null : r.links || null, id: r.id || null, key: r.key, title: r.title, today: today.getFullYear() + '-' + today2(today.getMonth() + 1) + '-' + today2(today.getDate()), summary, stage, tasks, docs: ctx.docs != null ? ctx.docs : null, linked: linkedOf(r), jiraAt: jira ? ctx.jiraAt || '' : '',
299
+ return { vs: r.__vs || null, links: r.__vs && r.__vs.draft ? null : r.links || null, id: r.id || null, key: r.key, title: r.title, today: today.getFullYear() + '-' + today2(today.getMonth() + 1) + '-' + today2(today.getDate()), summary, stage, tasks, docs: ctx.docs != null ? ctx.docs : null, linked: linkedOf(r), jiraAt: jira ? ctx.jiraAt || '' : '', jiraRead: ctx.jiraReadAt || '',
296
300
  // split or merge (batch 11 item 14): Claude's suggestion for it, and where its work went when it was merged
297
301
  suggest: r.suggest || null, merged: mergedOf(r),
298
302
  // what Claude proposes under the one blue ✦, and what a ✓ kept from elsewhere (batch 12 items 2, 3 and 4; pm/ini-props.js)
@@ -593,7 +593,8 @@ button.lk-mt:hover { color: var(--cz-ink) !important; }
593
593
  .iv-tr.drag { opacity: .45; }
594
594
  .ig-key { font-family: var(--cz-mono); font-size: var(--fs-1); font-weight: 700; color: var(--cz-ink3); background: var(--cz-well); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
595
595
  .ig-tk { text-align: left; }
596
- .ig-tk .iv-tt em, .ivt-n .iv-tt em, .ivk-d .iv-tt em { font-style: normal; font-family: var(--cz-mono); font-size: var(--fs-2); color: var(--cz-ink3); }
596
+ /* a ticket's own key is grey mono; a task linked to a ticket keeps its key blue, as the List draws it (em.lk) */
597
+ .ig-tk .iv-tt em:not(.lk), .ivt-n .iv-tt em:not(.lk), .ivk-d .iv-tt em:not(.lk) { font-style: normal; font-family: var(--cz-mono); font-size: var(--fs-2); color: var(--cz-ink3); }
597
598
  .ig-tkd { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); margin-top: 1px; }
598
599
  .ig-sq { width: 12px; height: 12px; border-radius: 3px; flex: none; margin: 4px 3px 0; background: var(--cz-ink3); }
599
600
  .ig-sq.doing { background: var(--cz-blue); }
@@ -1008,3 +1009,89 @@ button.iv-mt.iv-wf { padding: 0 !important; margin: 0 !important; }
1008
1009
  }
1009
1010
  html.ad-still .mi-svg *, html.ad-still .iv-card.adl, html.ad-still .iv-card.adl .iv-ask .ad-svg { animation: none !important; }
1010
1011
  html.ad-still .mi-svg .mi-vn { stroke-dashoffset: 0; }
1012
+ /* the date picker as a phone's bottom sheet (batch 18 item 16, StA3Dates, StA4Milestone): its title and ✕, the task's name under it */
1013
+ .tkc .tkc-dp .ivd-h { display: flex; align-items: center; gap: 8px; height: 40px; font-size: var(--fs-4); color: var(--cz-ink); }
1014
+ .tkc .tkc-dp .ivd-h .iv-ib { margin-left: auto; }
1015
+ .tkc .tkc-dp .ivd-s { margin: 0 0 10px; font-size: var(--fs-2); font-weight: 600; color: var(--cz-ink3); }
1016
+ .tkc.ivq.vs-pop.sheet .tkc-dp { width: 100%; }
1017
+ /* a milestone on the Tasks Timeline (batch 18 item 16, StA9Timeline): its ◇ on its date and the date beside it, no bar */
1018
+ .ivt-ms.lb { pointer-events: none; }
1019
+ .ivt-ms.lb b { margin-left: 11px; }
1020
+ .ivt-d.drag + .ivt-ms.lb { opacity: 0; }
1021
+
1022
+ /* ── a task changed where it sits in the List (batch 18 item 16, agreed A; canvas In development St*) ──
1023
+ * One line per task (StA1Rows): the box, the title, its days at the right (a phone: the due day only), the owner's face on a desktop. A title
1024
+ * press opens the row in place (StA2Edit): the name field, then one quiet line: status, Start – Due, ⋯ right after the dates (StA8Desk). */
1025
+ .iv-tr.q { align-items: center; position: relative; box-sizing: border-box; }
1026
+ .iv-tr.q .iv-bxw { align-self: center; }
1027
+ .iv-tr.q > .w { flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
1028
+ .iv-tr.q .iv-tn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
1029
+ .iv-tr.q .iv-tt { display: block !important; flex: 0 1 auto; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 600; }
1030
+ .iv-tr.q .iv-rm { flex: none; display: inline-flex; align-items: center; gap: 0; min-height: 0; max-width: 55%; white-space: nowrap; }
1031
+ .iv-tr.q .iv-dc { margin: 0 !important; white-space: nowrap; }
1032
+ .iv-dms { display: inline-flex; margin-right: 4px; color: var(--cz-ink2); }
1033
+ .iv-rav { width: 24px; height: 24px; margin-left: 10px; background: var(--cz-well); color: var(--cz-ink2); }
1034
+ /* the grip (a desktop, on hover): it sits in the row's left gutter */
1035
+ .iv-grip { position: absolute; left: -26px; top: 50%; width: 20px; height: 28px; margin-top: -14px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink3); cursor: grab; opacity: 0; border-radius: 6px; touch-action: none; }
1036
+ .iv-tr.q:hover .iv-grip { opacity: 1; }
1037
+ .iv-grip:hover { background: var(--cz-well); color: var(--cz-ink2); }
1038
+ @media (hover: none), (pointer: coarse) { .iv-grip { display: none; } }
1039
+ @media (max-width: 760px) {
1040
+ .iv-dst, .iv-rav, .iv-tr.q .iv-late, .iv-tr.q .vs-sl { display: none; }
1041
+ }
1042
+ /* the open row: a soft blue wash across the list's width */
1043
+ .iv-tr.iv-ed { box-sizing: border-box; flex-wrap: nowrap; align-items: flex-start; background: var(--cz-bluebg); margin: 0 -14px 0 -46px; padding: 10px 14px 12px 46px !important; width: calc(100% + 60px); border-top: 0 !important; }
1044
+ .iv-tr.iv-ed .iv-bxw { margin-top: 11px; }
1045
+ .iv-tr.iv-ed + .iv-tr { border-top: 0 !important; }
1046
+ .iv-tr.iv-ed > .w { gap: 8px; }
1047
+ .iv-edf { display: flex; }
1048
+ .iv-edn { flex: 1; min-width: 0; height: 40px; border-radius: 12px; border: 1.5px solid var(--cz-blue); background: var(--cz-card); color: var(--cz-ink); padding: 0 12px; font: inherit; font-size: var(--fs-3); }
1049
+ .iv-edn:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cz-blue) 22%, transparent); }
1050
+ .iv-ed.jr .iv-tt { white-space: normal; font-weight: 700; }
1051
+ .iv-edj { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--cz-ink2); }
1052
+ .iv-edj span { color: var(--cz-ink3); font-weight: 600; }
1053
+ .iv-edl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
1054
+ .iv .iv-edc { height: 34px; padding: 0 12px !important; border-radius: 999px !important; background: var(--cz-card) !important; display: inline-flex !important; align-items: center; gap: 6px; color: var(--cz-ink) !important; font-size: var(--fs-2); box-shadow: 0 0 0 1px var(--cz-hair); white-space: nowrap; }
1055
+ .iv .iv-edc small { color: var(--cz-ink3); font-weight: 700; font-size: var(--fs-1); }
1056
+ .iv .iv-edc b { font-weight: 800; }
1057
+ .iv .iv-edc:hover, .iv .iv-edc[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--cz-blue); }
1058
+ .iv .iv-edc.dash { background: transparent !important; box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 55%, var(--cz-card)) !important; color: var(--cz-ink2) !important; font-weight: 700; }
1059
+ .iv .iv-edc.ms[aria-expanded="true"], .iv .iv-edc.ms:not(.dash) { box-shadow: 0 0 0 1.5px var(--cz-blue); }
1060
+ .iv .iv-edst { padding: 0 8px 0 10px !important; gap: 2px; color: var(--cz-ink2) !important; }
1061
+ .iv-eds { color: var(--cz-ink3); font-weight: 700; }
1062
+ /* a phone keeps the line on one row: the chips drop their Start / Due words (the order says it; the names stay in aria-label) */
1063
+ @media (max-width: 760px) {
1064
+ .iv-edl { gap: 4px; flex-wrap: nowrap; }
1065
+ .iv .iv-edc { padding: 0 9px !important; }
1066
+ .iv .iv-edd small { display: none; }
1067
+ .iv-edl .iv-edm { min-width: 44px; }
1068
+ }
1069
+ .iv-edm { color: var(--cz-ink2); }
1070
+ /* + on an open stage: between the count and the chevron (StA1Rows) */
1071
+ .iv-ws.pl > .n { margin-right: 40px; }
1072
+ .iv-wsw > .iv-plus { position: absolute; right: 34px; top: 50%; margin: -16px 0 0 !important; z-index: 2; }
1073
+ .iv-plus.on { background: var(--cz-bluebg); color: var(--cz-blueink); }
1074
+ /* the add field at the top of the stage (StA5Add) */
1075
+ .iv-addin { margin: 0 -14px 0 -46px; padding: 10px 14px 4px 46px; background: var(--cz-bluebg); gap: 10px; }
1076
+ .iv-addin .iv-cb { margin-top: 0 !important; border-style: solid; }
1077
+ .iv-addin input { border: 1.5px solid var(--cz-blue); }
1078
+ .iv-addd { margin: 0 -14px 0 -46px; padding: 4px 14px 12px 46px; background: var(--cz-bluebg); }
1079
+ /* the drag (StA10Drag): the row lifts and follows the pointer; its slot stays as a dashed ghost; the target stage lights up; a blue line marks the drop */
1080
+ .iv-tr.iv-ghost { outline: 1.5px dashed color-mix(in srgb, var(--cz-ink3) 50%, var(--cz-card)); outline-offset: -2px; opacity: .55; }
1081
+ .iv-fly { position: fixed; z-index: 1001; left: var(--fly-x, 0); top: var(--fly-y, 0); width: var(--fly-w, 320px); pointer-events: none; background: var(--cz-card); border-radius: 12px; padding: 7px 12px !important;
1082
+ box-shadow: 0 18px 40px -16px rgba(42,46,53,.45), 0 0 0 1px var(--cz-hair); display: flex; align-items: center; gap: 12px; font-family: var(--cz-sans); color: var(--cz-ink); }
1083
+ .iv-fly .iv-grip { position: static; opacity: 1; margin: 0; color: var(--cz-blueink); }
1084
+ .iv-fly .iv-tt { font-size: var(--fs-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1085
+ .iv-fly > .w { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
1086
+ .iv-fly .iv-rm { font-size: var(--fs-2); color: var(--cz-ink3); margin-left: auto; }
1087
+ .iv-wbs { position: relative; }
1088
+ .iv-dl { position: absolute; left: var(--dl-x, 14px); right: 12px; top: var(--dl-y, 0); height: 2px; margin-top: -1px; background: var(--cz-blue); pointer-events: none; z-index: 3; }
1089
+ .iv-dl::before { content: ""; position: absolute; left: -5px; top: -4px; width: 6px; height: 6px; border-radius: 50%; border: 2px solid var(--cz-blue); background: var(--cz-card); }
1090
+ .iv-ws.iv-tgt { background: var(--cz-bluebg) !important; }
1091
+ .iv-dtip { position: fixed; z-index: 1002; left: var(--fly-x, 0); top: var(--fly-y, 0); pointer-events: none; background: var(--cz-solid); color: var(--cz-onsolid); font-family: var(--cz-sans); font-size: var(--fs-2); font-weight: 700; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
1092
+ body.iv-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
1093
+ /* ⋯ of the open row (StA2bMore) */
1094
+ .tkc.ivq .ive-m .o.dl:hover { color: var(--cz-red); }
1095
+ .tkc.ivq .ive-m .ck { color: var(--cz-ink2); }
1096
+ /* the open row has its own status chip: the box's caret stays out */
1097
+ .iv-tr.iv-ed .iv-car { display: none !important; }
@@ -43,6 +43,7 @@ import { cardHtml as smCard, mergedHtml as smMerged } from './split-merge.js';
43
43
  import * as MI from './mission.js'; // the initiative as a mission, the stage line's place (batch 18 item 1)
44
44
  import * as AD from './cozy-adler.js'; // Adler on the card: his face for the ask, his full body for a real win
45
45
  import * as MD from './metric-drafts.js'; // the success measure Claude drafts from the PRD (batch 15 item 1, canvas Iq9Initiative)
46
+ import * as ED from './ini-edit.js'; // a task changed where it sits in the List: open in place, ⋯, + per stage, drag (batch 18 item 16)
46
47
 
47
48
  const CSS = new URL('./ini-view.css', import.meta.url).href;
48
49
  if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) {
@@ -170,6 +171,7 @@ function msCardHtml(v, o) { const h = msListHtml(v, o); return h ? `<section cla
170
171
  const cardHasAdler = (v) => AD.prefs()['adler.amount'] !== 'off' && ((v.summary.tone === 'you' && !!v.summary.primary) || !!v.summary.claude);
171
172
 
172
173
  /* ── the WBS ── */
174
+ const GRIP = 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01';
173
175
  function taskHtml(x, o, arch) {
174
176
  // the box marks done in one press; its caret opens the status picker right under it (an archived task has only the caret)
175
177
  const car = o.quick && x.uid ? `<button type="button" class="iv-car" data-iv-stat="${esc(x.uid)}" data-st="${esc(x.status)}" data-ms="${x.ms ? 1 : 0}" aria-haspopup="dialog" aria-label="${esc('Change the status: ' + x.title)}" title="Status">${SVG(P.down, 10, 2.6)}</button>` : '';
@@ -179,7 +181,23 @@ function taskHtml(x, o, arch) {
179
181
  // a task linked to the Jira ticket it names looks like the ticket rows beside it (batch 14 item 6): the Jira square, the key in blue.
180
182
  // A key PMOS has not read is only text: a plain task with its box (0.442.0 hotfix)
181
183
  const name = TV.keyName(x);
182
- const t = (o.openTask && x.uid && !x.dr ? `<button type="button" class="iv-tt" data-iv-task="${esc(x.uid)}">${name}</button>` : `<b class="iv-tt">${name}</b>`) + TV.msGlyph(x) + TV.addedMark(x);
184
+ // batch 18 item 16 (StA2Edit): with quick changes on, a title press opens the row in place (one at a time); the task card moved to its ⋯
185
+ const edit = o.quick && x.uid && !arch && !!o.ivId;
186
+ if (edit && ED.openOf(o.ivId) === x.uid) return ED.rowHtml(x, o, chk, name);
187
+ // an open task drags inside its stage and to another stage (StA10Drag): a grip on hover on a desktop, a long press on the title on a phone
188
+ const lift = edit && o.stageMode && !x.closed;
189
+ const t = (edit ? `<button type="button" class="iv-tt" data-iv-edit="${esc(x.uid)}"${lift ? ' data-drag="1"' : ''}>${name}</button>` : o.openTask && x.uid && !x.dr ? `<button type="button" class="iv-tt" data-iv-task="${esc(x.uid)}">${name}</button>` : `<b class="iv-tt">${name}</b>`)
190
+ + (edit && TV.msInDate(x) ? '' : TV.msGlyph(x)) + TV.addedMark(x);
191
+ if (edit) {
192
+ // one line (StA1Rows): the title, then at the right its days (a phone: the due day only; nothing without dates), the late days, the
193
+ // links' marks and the owner's face (a desktop)
194
+ const parts = [x.days ? TV.dateBtn(x, o) + (x.lateText ? `<span class="iv-late">, ${esc(x.lateText)}</span>` : '') + TV.slipHtml(x) : TV.msNoDate(x) ? TV.dateBtn(x, o) : '', LK.metaHtml(x, o.lk, o.quick)].filter(Boolean);
195
+ const av = x.av && x.owner && x.owner !== 'You' ? `<span class="iv-av iv-rav" role="img" aria-label="${esc('Owner: ' + x.owner)}" title="${esc(x.owner)}">${esc(x.av)}</span>` : '';
196
+ const grip = lift ? `<span class="iv-grip" data-iv-grip="${esc(x.uid)}" title="Drag to move" aria-hidden="true">${SVG(GRIP, 16, 3)}</span>` : '';
197
+ // Your groups (batch 11 item 20): a task still drags to another of the PM's groups
198
+ const gd = o.gdrag && !x.dr ? ` draggable="true" data-ig-drag="${esc(x.uid)}"` : '';
199
+ return `<div class="iv-tr q${x.closed ? ' done' : ''}${x.wont ? ' wo' : ''}" data-iv-r="${esc(x.uid)}"${gd}>${grip}${chk}<span class="w"><span class="iv-tn">${t}</span>${parts.length || av ? `<span class="iv-rm">${parts.join('<span class="iv-sep" aria-hidden="true"> · </span>')}${av}</span>` : ''}</span></div>`;
200
+ }
183
201
  // the meta: In progress, the dates (a press: the start and due picker opens under them), the late days, the owner
184
202
  let meta = x.sub ? `<span class="${x.late ? 'w' : ''}">${esc(x.sub)}</span>` : '';
185
203
  if (o.quick && x.uid) {
@@ -204,8 +222,10 @@ function bodyHtml(v, sec, o) {
204
222
  const byEp = new Map(); for (const k of sec.jira.open) { const e = k.epic || ''; if (!byEp.has(e)) byEp.set(e, []); byEp.get(e).push(k); }
205
223
  const all = isOpen(v, sec.key + ':tk', false), shown = all ? sec.jira.open : sec.jira.open.slice(0, 3);
206
224
  // the title opens the ticket; with quick changes on, its dates are a press too: the start and due kept in PMOS (batch 11 item 23)
207
- h += shown.map((k) => o.quick
208
- ? `<div class="iv-tr iv-tkr"><span class="iv-jq" aria-hidden="true"></span><span class="w"><button type="button" class="iv-tt" data-iv-ticket="${esc(k.key)}"><em>${esc(k.key)}</em> ${esc(k.title)}</button><span class="iv-rm"><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span>${k.days ? '<span class="iv-sep" aria-hidden="true"> · </span>' : ''}${TV.dateBtn(TV.jiraRow(k), o)}</span></span></div>`
225
+ // batch 18 item 16 (StA6Jira): its title opens it in place: Jira's title and status read-only, the start and due kept in PMOS
226
+ h += shown.map((k) => o.quick && o.ivId && ED.openOf(o.ivId) === k.key ? ED.ticketHtml(k, o)
227
+ : o.quick
228
+ ? `<div class="iv-tr iv-tkr"><span class="iv-jq" aria-hidden="true"></span><span class="w"><button type="button" class="iv-tt" ${o.ivId ? 'data-iv-edit' : 'data-iv-ticket'}="${esc(k.key)}"><em>${esc(k.key)}</em> ${esc(k.title)}</button><span class="iv-rm"><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span>${k.days ? '<span class="iv-sep" aria-hidden="true"> · </span>' : ''}${TV.dateBtn(TV.jiraRow(k), o)}</span></span></div>`
209
229
  : `<button type="button" class="iv-tr iv-tk" data-iv-ticket="${esc(k.key)}"><span class="iv-jq" aria-hidden="true"></span><span class="w"><b class="iv-tt"><em>${esc(k.key)}</em> ${esc(k.title)}</b><span class="${k.warn ? 'w' : ''}">${esc(k.sub)}</span></span></button>`).join('');
210
230
  if (sec.jira.open.length > shown.length) h += `<button type="button" class="iv-more" data-iv-fold="${esc(sec.key + ':tk')}" aria-expanded="false">${esc((sec.jira.open.length - shown.length) + ' more open' + (byEp.size > 1 ? ' · by epic' : ''))}${SVG(P.right, 14, 2)}</button>`;
211
231
  h += `<p class="iv-q">${esc(sec.jira.done + ' of ' + sec.jira.total + ' done in Jira' + (sec.jira.at ? ' · ' + sec.jira.at : ''))}</p>`;
@@ -245,30 +265,39 @@ function markOf(sec) {
245
265
  }
246
266
  function sectionHtml(v, sec, o, inner) {
247
267
  const key = 'sec:' + (sec.key || 'none'), op = isOpen(v, key, sec.open);
268
+ // a stage of the List by stage (batch 18 item 16): the drag's target, and on an open stage the + that adds a task into it (StA5Add)
269
+ const st = o.stageMode && !sec.stages && (sec.kind === 'stage' || sec.kind === 'none'), sk = esc(sec.key || '');
248
270
  const has = sec.top.length || sec.groups.length || sec.done.length || (sec.archived || []).length || sec.jira || (sec.stages && sec.stages.length) || (sec.tk && sec.tk.length) || sec.tkEmpty;
249
271
  const name = sec.label || sec.name;
250
- const row = `<button type="button" class="iv-ws${sec.kind === 'past' || sec.kind === 'later' ? ' mut' : ''}${inner ? ' in' : ''}" ${has ? `data-iv-fold="${esc(key)}" aria-expanded="${op}"` : 'disabled'}>${markOf(sec)}`
272
+ const plus = st && op && has ? ED.plusHtml(sec, v.id || v.key || '', o) : '';
273
+ const row = `<button type="button" class="iv-ws${sec.kind === 'past' || sec.kind === 'later' ? ' mut' : ''}${inner ? ' in' : ''}${plus ? ' pl' : ''}"${st ? ` data-iv-sec="${sk}"` : ''} ${has ? `data-iv-fold="${esc(key)}" aria-expanded="${op}"` : 'disabled'}>${markOf(sec)}`
251
274
  + `<span class="w"><b>${esc(name)}</b>${sec.sub ? `<small class="${sec.subWarn ? 'w' : ''}">${esc(sec.sub)}</small>` : ''}</span>${sec.epicKey ? `<span class="ig-key">${esc(sec.epicKey)}</span>` : ''}${sec.count ? `<span class="n${sec.warn ? ' w' : ''}">${esc(sec.count)}</span>` : ''}${has ? chev(op) : ''}</button>`;
252
275
  // a group's own presses sit beside its fold: ⋯ on the PM's own group, the send icon on an epic (batch 11 item 20)
253
- const tools = G.toolsHtml(sec), head = tools ? `<div class="iv-wsw">${row}${tools}</div>` : row;
276
+ const tools = G.toolsHtml(sec) + plus, head = tools ? `<div class="iv-wsw">${row}${tools}</div>` : row;
254
277
  // the PM's own groups and Not in a group take a dragged task
255
278
  const drop = (h) => (sec.mine != null && o.gdrag ? `<div class="ig-dz" data-ig-drop="${esc(sec.mine || '')}">${h}</div>` : h);
256
279
  if (!op || !has) return drop(head);
257
280
  // the folded lines (past stages, Later) open into their own stages, each a section of its own
258
- const body = sec.stages ? sec.stages.map((s) => sectionHtml(v, s, o, true)).join('') : bodyHtml(v, sec, o);
259
- return drop(head + `<div class="iv-wl">${body}</div>`);
281
+ const body = sec.stages ? sec.stages.map((s) => sectionHtml(v, s, o, true)).join('') : (st ? ED.addHtml(sec, v.id || v.key || '') : '') + bodyHtml(v, sec, o);
282
+ return drop(head + `<div class="iv-wl"${st ? ` data-iv-sec="${sk}"` : ''}>${body}</div>`);
260
283
  }
261
284
  function tasksHtml(v0, o) {
262
285
  // the grouping the PM picked (batch 11 item 20): every view draws its groups as it draws the stages
263
286
  const v = G.view(v0), T = v.tasks;
264
- const add = o.add ? `<button type="button" class="iv-ib" data-iv-add aria-label="Add a task to ${esc(v.title)}" title="Add a task">${SVG(P.plus, 16, 2.2)}</button>` : '';
287
+ // + sits on each open stage (batch 18 item 16, say it once); the header keeps it while there is no stage list to add into (no task yet,
288
+ // or the tasks grouped another way)
289
+ const stageMode = !!o.quick && (!T.by || T.by === 'stage') && !T.only;
290
+ const add = o.add && (T.empty || !stageMode) ? `<button type="button" class="iv-ib" data-iv-add aria-label="Add a task to ${esc(v.title)}" title="Add a task">${SVG(P.plus, 16, 2.2)}</button>` : '';
265
291
  // the view switch shows once there is a task to see another way (zero is silence)
266
292
  const mode = T.empty ? 'list' : TV.viewMode();
267
293
  // planned versus actual (batch 11 item 8): the version chip and the end slip after the count; Make live (seal) while a draft is shown
268
294
  const cnt = VS.countText(v.vs, T.count, T.open + T.done);
269
295
  // links (batch 11 item 15): the blue ✦ (proposals), the grey ✦ (quiet moves), the late count, between the count and the version chip
270
296
  const lk = T.empty ? null : LK.of(v);
271
- o = { ...o, lk };
297
+ // the List by stage edits in place (batch 18 item 16): ivId names the open row's initiative, stageMode turns on the + and the drag
298
+ const ivId = o.quick ? v.id || v.key || '' : '';
299
+ if (ivId) ED.stagesSet(ivId, v0, v);
300
+ o = { ...o, lk, ivId, stageMode, addIn: !!(o.add && o.quick), jiraRead: v.jiraRead || v0.jiraRead || '' };
272
301
  const head = `<div class="iv-th"><b>Tasks</b>${cnt ? `<span class="n">${esc(cnt)}</span>` : ''}${LK.headHtml(lk)}${VS.headHtml(v.vs)}<span class="iv-sp"></span>${T.empty ? '' : G.headHtml(v) + TV.viewBtnHtml(mode) + TV.fullBtnHtml(mode)}${VS.liveHtml(v.vs)}${add}</div>`
273
302
  + (o.adding ? `<form class="iv-addf" data-iv-addform><input id="ivAddTask" type="text" maxlength="160" autocomplete="off" placeholder="A task for ${esc(v.title)}${o.addHint ? esc(', ' + o.addHint) : ''}" aria-label="New task"><button type="submit" class="iv-go" aria-label="Add the task" title="Add (Enter). Esc cancels.">${SVG(P.check, 16, 2.2)}</button></form>` : '');
274
303
  // while Claude looks for a new initiative elsewhere, Tasks waits for what it finds (PiA1)
@@ -342,7 +371,7 @@ export function viewHtml(v, o = {}) {
342
371
  export function wireView(body, h) {
343
372
  if (!body) return;
344
373
  const idOf = () => { const n = body.querySelector('[data-iv]'); return n ? n.dataset.iv : null; };
345
- body.__iv = LK.wrap(VS.wrap(h, body, (id) => SHOWN.get(id)), idOf);
374
+ body.__iv = LK.wrap(VS.wrap(ED.writes({ ...h, __id: idOf }), body, (id) => SHOWN.get(id)), idOf);
346
375
  // the one blue ✦ after the title (pm/ini-props.js), drawn again with each draw of the initiative
347
376
  const chip = () => { const id = idOf(); if (id && VIEWED.has(id)) PP.sync(VIEWED.get(id), body.__iv || {}); drafts(id); };
348
377
  // the success measure Claude drafted: read once per page load, the view draws again when it arrives
@@ -392,6 +421,7 @@ export function wireView(body, h) {
392
421
  if (d.md && MD.press(b, { redraw: H.redraw, toast: H.toast })) { e.preventDefault(); return; }
393
422
  if (VS.press(b, d, root, H)) return;
394
423
  if (G.press(b, d, root, H)) return;
424
+ if (ED.press(b, d, root, H, e)) return;
395
425
  if (LK.press(b, d, root, { ...H, __dates: (x) => TV.press(x, { ivtBar: x.dataset.ivtBar }, root, H, e) })) return;
396
426
  if (TV.press(b, d, root, { ...H, __v: SHOWN.get(id), __g: G.api(root, H) }, e)) return;
397
427
  if (d.ivFold) { e.preventDefault(); const k = id + '|' + d.ivFold; FOLD.set(k, b.getAttribute('aria-expanded') !== 'true'); if (H.redraw) H.redraw(); return; }
@@ -422,6 +452,7 @@ export function wireView(body, h) {
422
452
  if (t && H.addTask) H.addTask(t, inp);
423
453
  });
424
454
  G.wireDrag(body);
455
+ ED.wire(body);
425
456
  TV.wireDrag(body, () => { LK.draw(body, true); const n = body.querySelector('[data-iv]'); if (n) LK.sweep(n.dataset.iv, body.__iv || {}); });
426
457
  body.addEventListener('keydown', (e) => { if (e.key === 'Escape' && e.target.id === 'ivAddTask') { e.stopPropagation(); const H = body.__iv || {}; if (H.addCancel) H.addCancel(); } });
427
458
  }
@@ -492,4 +523,4 @@ function showIn(b, id, H, key, uid) {
492
523
  }
493
524
 
494
525
  /** For the tests: forget every fold the PM opened or shut. */
495
- export const resetFolds = () => { LINE.clear(); FOLD.clear(); TV.resetViews(); VS.resetVersions(); LK.resetLinks(); G.resetGroups(); };
526
+ export const resetFolds = () => { LINE.clear(); FOLD.clear(); TV.resetViews(); VS.resetVersions(); LK.resetLinks(); G.resetGroups(); ED.reset(); };
@@ -1045,15 +1045,17 @@ function openTask(r, k) {
1045
1045
  }
1046
1046
  /** A new task from the initiative view's + (the same box Home's page draws): POST /api/boards/tasks/add. → true when it was added.
1047
1047
  * section: the stage it finishes (the Next cell's +, "Add what finishes <stage>"): the task is placed under it (POST /api/boards/tasks/edit). */
1048
- async function addTask(r, title, section, dates) {
1048
+ async function addTask(r, title, section, dates, name) {
1049
1049
  const body = { ws: r.ws || M.board.ws, board: r.boardId || M.board.id };
1050
- const res = await pmPost('/api/boards/tasks/add', { ...body, initiative: r.id, title }).catch(() => null);
1050
+ // dates: a gap's + (batch 11 item 13) fills the task's start and due with the gap's days ahead; section: the stage it goes under (the
1051
+ // add route places it, batch 18 item 16)
1052
+ const res = await pmPost('/api/boards/tasks/add', { ...body, initiative: r.id, title, ...(dates && dates.start ? { start: dates.start } : {}), ...(dates && dates.due ? { due: dates.due } : {}), ...(section ? { section } : {}) }).catch(() => null);
1051
1053
  if (!res || res.ok === false) { say((res && res.error) || 'The task was not added.'); return false; }
1052
1054
  const uid = res.item && res.item.uid;
1053
- // dates: a gap's + (batch 11 item 13) fills the task's start and due with the gap's days ahead
1054
- if (dates && uid) { const s1 = await pmPost('/api/boards/tasks/edit', { ...body, task: uid, start: dates.start, due: dates.due }).catch(() => null); if (!s1 || s1.ok === false) { say('Task added, but not its dates: ' + ((s1 && s1.error) || 'the server did not say why') + '.'); load(); return true; } }
1055
- if (section && uid) { const s2 = await pmPost('/api/boards/tasks/edit', { ...body, task: uid, section }).catch(() => null); if (!s2 || s2.ok === false) { say('Task added, but not under its stage: ' + ((s2 && s2.error) || 'the server did not say why') + '.'); load(); return true; } }
1056
- say('Task added.'); load();
1055
+ // the + on a stage (batch 18 item 16, StA5Add): "Added to Build" with Undo
1056
+ if (name && uid) say('Added to ' + name + '.', async () => { const u = await pmPost('/api/boards/tasks/delete', { ...body, task: uid, why: 'undo of add' }).catch(() => null); if (!u || u.ok === false) say((u && u.error) || 'The undo did not land.'); load(); });
1057
+ else say('Task added.');
1058
+ load();
1057
1059
  return true;
1058
1060
  }
1059
1061
  /** The Next cell's icon (pm/bd-next.js): draft with Claude in Home's chat, move to the next stage, add a task to the stage, link the epic, read Jira. */