@double_geste/agent-standup 1.37.0 → 1.39.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/public/index.html CHANGED
@@ -26,13 +26,22 @@
26
26
  .sp { flex:1 }
27
27
  .tok { font-size:11px; font-weight:600; padding:3px 9px; border-radius:99px; background:var(--panel2); color:#c3c6d4; white-space:nowrap } .tok:hover { color:#fff }
28
28
  .tbadge { position:absolute; top:30px; right:6px; display:flex; gap:4px; z-index:2; pointer-events:none } .tbadge span { font-size:10.5px; padding:1px 7px; border-radius:99px; background:rgba(14,15,24,.78); backdrop-filter:blur(6px) }
29
- .tbadge .e { color:#ff7b72 } .tbadge .w { color:#79c0ff } .tbadge .s { color:#ffb347 } .tbadge .q { color:#9aa3bd }
29
+ .tbadge .e { color:#ff7b72 } .tbadge .w { color:#79c0ff } .tbadge .s { color:#ffb347 } .tbadge .q { color:#9aa3bd } .tbadge [data-tip] { pointer-events:auto; cursor:help }
30
+ #btip { position:fixed; z-index:30; top:0; left:0; width:max-content; max-width:min(360px, calc(100vw - 16px)); padding:12px 12px 10px; border-radius:12px; background:rgba(22,25,40,.97); border:1px solid rgba(255,255,255,.09); box-shadow:0 18px 48px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3); backdrop-filter:blur(10px); color:var(--text); font-size:12.5px; line-height:1.45; pointer-events:none; opacity:0; transform:translateY(-4px); transition:opacity .14s ease, transform .14s ease; visibility:hidden }
31
+ #btip.on { opacity:1; transform:none; visibility:visible } #btip.k-e { --c:#ff7b72; --cb:rgba(255,123,114,.15) } #btip.k-w { --c:#79c0ff; --cb:rgba(121,192,255,.15) } #btip.k-l { --c:#d2a8ff; --cb:rgba(210,168,255,.15) } #btip.k-s { --c:#ffb347; --cb:rgba(255,179,71,.15) } #btip.k-q { --c:#9aa3bd; --cb:rgba(154,163,189,.15) }
32
+ #btip .bh { display:flex; align-items:center; gap:8px; padding:0 2px } #btip .bi { flex:none; width:24px; height:24px; border-radius:7px; display:grid; place-items:center; font-size:12.5px; background:var(--cb); color:var(--c) } #btip .bt { font-weight:650; font-size:13px; white-space:nowrap } #btip .bn { padding:0 7px; border-radius:99px; background:var(--cb); color:var(--c); font-size:11px; font-weight:700; line-height:18px } #btip .ba { margin-left:auto; padding-left:14px; color:var(--dim); font-size:11.5px; white-space:nowrap }
33
+ #btip ul { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:6px } #btip li { padding:7px 9px 8px; border-radius:8px; background:rgba(255,255,255,.045); box-shadow:inset 2px 0 0 var(--c); min-width:0 } #btip .r1 { display:flex; align-items:center; gap:8px } #btip .rk { font-weight:600 } #btip .rn { min-width:0; color:var(--dim); font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #btip .rt { margin-left:auto; padding-left:10px; color:var(--dim); font-size:11px; font-variant-numeric:tabular-nums; white-space:nowrap }
34
+ #btip .pill { font-size:10.5px; font-weight:650; padding:1px 6px; border-radius:5px; background:rgba(255,255,255,.08); color:#cfd6e6 } #btip code { display:block; margin-top:3px; font:11.5px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#d6dcea; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
35
+ #btip .ro { margin-top:5px; padding:5px 7px; border-radius:6px; background:rgba(255,123,114,.08); font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#ffc1bb } #btip .ro div { overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #btip .bf { margin:8px 2px 0; color:var(--dim); font-size:11px } #btip .bf + .bf { margin-top:2px }
36
+ @media (prefers-reduced-motion:reduce) { #btip { transition:none } }
30
37
  .tile.slow { border-color:#ff9f1c !important; animation:slowp 1.6s ease-in-out infinite } @keyframes slowp { 50% { box-shadow:0 0 0 4px rgba(255,159,28,.35) } }
31
38
  .tile.quiet { opacity:.72 }
32
39
  .tag .tk { color:#aab2c5; font-size:10px } .tag .tk:empty { display:none }
33
40
  .tile.focus .tag .tk, #pcam .tag .tk { font-size:11.5px; color:#cfd6e6 } body:not(.compact):not(.presenting) .tile.focus .tag .tk:not(:empty)::after { content:' ' attr(data-w) } /* what an agent has used so far, readable where there is room: the large tile (with the word) and the camera of the one who shares a screen */
34
41
  .keys { padding:6px 10px 4px; color:var(--dim); font-size:10.5px; line-height:1.5 }
35
42
  /* the status of the session: a pill in the header of a wide window, a line of its own under the header from 1080 px down (#sline), where it stays readable in the narrowest side panel. Two lines at most, the whole text in the tooltip */
43
+ #attn { flex:none; display:flex; align-items:center; gap:8px; width:100%; min-width:0; padding:5px 12px; border-bottom:1px solid #ff8a80; background:#c0392b; color:#fff; font-weight:600; font-size:12.5px; text-align:left } #attn[hidden] { display:none } #attn:hover { filter:brightness(1.1) } #attn:focus-visible { outline:2px solid #fff; outline-offset:-3px }
44
+ #attn .aw { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #attn .am { flex:none; padding:0 8px; border-radius:99px; background:rgba(0,0,0,.25); font-size:11.5px } #attn .ak { flex:none; opacity:.8; font-weight:500; font-size:11px } /* what needs you, here or in another session: one line in every view, a click goes there (G) */
36
45
  #pill, #sline { font-weight:600; background:var(--panel2); color:var(--dim); cursor:default; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2 }
37
46
  #pill { display:-webkit-box; font-size:11px; letter-spacing:.04em; line-height:1.3; padding:3px 9px; border-radius:12px; max-width:min(34vw,440px) } #sline { display:none; flex:none; font-size:12px; line-height:1.4; padding:5px 12px; border-bottom:1px solid var(--line) }
38
47
  :is(#pill, #sline).go { cursor:pointer } :is(#pill, #sline).go:hover { filter:brightness(1.15) } :is(#pill, #sline).off { color:#fff; background:#b3261e; box-shadow:inset 0 0 0 1.5px #ff8a80 } :is(#pill, #sline).blocked { color:#fff; background:#c0392b } :is(#pill, #sline).stalled { color:#1b1d27; background:#ffb347 }
@@ -40,17 +49,19 @@
40
49
  @media (max-width:1080px) { #pill { display:none } #sline { display:-webkit-box } } @media (max-width:760px) { #sline::after { content:attr(data-sub); font-weight:400; opacity:.8 } } @media (max-width:400px) { #sline { -webkit-line-clamp:3 } }
41
50
  @media (min-width:1081px) { header .brand { min-width:150px } #pill { flex-shrink:20 } .tok, .ctxp { flex-shrink:0 } } /* wide: a long status gives way before the name and the counters */
42
51
  /* several sessions at once (live): the sessions of the moment as tabs under the header, the one the call is in among them, each with its state; and a visitor from another session that needs you, who takes you there on a click */
43
- #tabs { display:none; flex:none; align-items:center; gap:5px; padding:4px 10px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none } #tabs::-webkit-scrollbar { display:none } #tabs:not(:empty) { display:flex }
52
+ #tabs { display:none; flex:none; align-items:center; gap:5px; padding:4px 10px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none } #tabs::-webkit-scrollbar { display:none } #tabs:not(:empty) { display:flex } #tabs .why { margin-left:auto; flex:none; padding-left:10px; color:var(--dim); font-size:11px; white-space:nowrap; cursor:default } body.narrow #tabs .why { display:none }
44
53
  .stab { flex:0 1 auto; min-width:92px; max-width:190px; display:flex; align-items:center; gap:5px; padding:2px 9px; border-radius:99px; border:1px solid var(--line); color:var(--dim); font-size:11.5px; line-height:1.5; white-space:nowrap } .stab span { overflow:hidden; text-overflow:ellipsis } .stab i { flex:none; font-style:normal; font-size:9px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:0 5px; border-radius:99px; border:1px solid currentColor; opacity:.85 } .stab:hover { color:var(--text); border-color:var(--accent) }
45
- .stab.on { flex-shrink:0; max-width:min(320px,62vw); background:var(--panel2); color:var(--text); font-weight:600; border-color:var(--accent) } .stab.turn:not(.on) { color:var(--accent) } .stab.blocked:not(.on) { color:#fff; background:#c0392b; border-color:#ff8a80; font-weight:600 } .stab.all { flex:none; min-width:0; padding:2px 8px } /* a narrow panel: the tabs keep a readable width and the row scrolls */
54
+ .stab.on { flex-shrink:0; max-width:min(320px,62vw); background:var(--panel2); color:var(--text); font-weight:600; border-color:var(--accent) } .stab.turn:not(.on) { color:var(--accent) } .stab.blocked:not(.on) { color:#fff; background:#c0392b; border-color:#ff8a80; font-weight:600 } .stab.gave:not(.on) { color:#ffb347 } .stab.all { flex:none; min-width:0; padding:2px 8px } /* a narrow panel: the tabs keep a readable width and the row scrolls */
46
55
  #visit { position:absolute; right:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(380px,calc(100% - 24px)); cursor:pointer } #visit.on { display:flex; animation:visit .45s cubic-bezier(.2,1.3,.4,1) } @keyframes visit { from { transform:translateX(120%) } } body.react #visit { bottom:140px }
47
56
  #visit .vsay { position:relative; min-width:0; background:#fff; color:#1b1d27; border-radius:11px 11px 2px 11px; padding:7px 10px; font-size:12.5px; line-height:1.35; box-shadow:0 4px 14px rgba(0,0,0,.4); overflow-wrap:anywhere } #visit .vsay small { display:block; color:#5a6072; font-size:11px; margin-bottom:2px } #visit .vgo { display:inline-block; margin-top:5px; padding:1px 10px; border-radius:99px; background:var(--accent); color:#0b1020; font-weight:600; font-size:11.5px }
48
- #askc { position:absolute; left:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(460px,calc(100% - 24px)) } #askc.on { display:flex; animation:askc .45s cubic-bezier(.2,1.3,.4,1) } @keyframes askc { from { transform:translateX(-120%) } } @media (prefers-reduced-motion:reduce) { #askc.on { animation:none } } body.react #askc { bottom:140px } #center:has(#visit.on) #askc { bottom:118px } #center:has(#askc.on) #pcap { display:none } /* the menu the session waits on, in the lead's words, until it is answered */
49
- #askc .awho { flex:none; width:72px; height:54px; border-radius:12px; overflow:hidden; border:2px solid #ff5252; box-shadow:0 4px 14px rgba(0,0,0,.45); background:#222 } #askc .awho svg { width:100%; height:100%; display:block }
50
- #askc .asay { position:relative; min-width:0; max-height:min(52vh,420px); overflow:auto; background:#fff; color:#1b1d27; border-radius:11px 11px 11px 2px; padding:8px 30px 9px 12px; font-size:13px; line-height:1.4; box-shadow:0 4px 14px rgba(0,0,0,.4); overflow-wrap:anywhere } #askc small { display:block; color:#5a6072; font-size:11px; margin-bottom:3px } #askc .ak-t { color:#c62828; font-weight:600 }
51
- #askc .aq { font-weight:600; margin:3px 0 3px } #askc .ahow { color:#5a6072; font-weight:400; font-size:11.5px } #askc ol { margin:0 0 4px; padding-left:22px } #askc li { margin:1px 0 } #askc li span { color:#5a6072; font-size:11.5px } #askc .aab { margin:2px 0 }
52
- #askc pre { margin:4px 0; padding:6px 8px; background:#f1f2f6; border-radius:6px; font:12px/1.4 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap; max-height:180px; overflow:auto } #askc .afoot { margin-top:6px; padding-top:5px; border-top:1px solid #e6e7ee; color:#5a6072; font-size:11.5px }
53
- #askc .ax { position:absolute; top:4px; right:4px; width:24px; height:24px; border:0; border-radius:50%; background:transparent; color:#5a6072; cursor:pointer; font-size:13px; line-height:24px } #askc .ax:hover { background:#eceef4 } #askc .ax:focus-visible { outline:2px solid var(--accent); outline-offset:1px }
57
+ #askc { position:absolute; left:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(520px,calc(100% - 24px)) } #askc.on { display:flex; animation:askc .45s cubic-bezier(.2,1.3,.4,1) } @keyframes askc { from { transform:translateX(-120%) } } @media (prefers-reduced-motion:reduce) { #askc.on { animation:none } } body.react #askc { bottom:140px } #center:has(#visit.on) #askc { bottom:118px } #center:has(#askc.on) #pcap { display:none } /* the menu the session waits on, in the lead's words, until it is answered */
58
+ #askc .awho { flex:none; width:72px; height:54px; border-radius:12px; overflow:hidden; border:2px solid #ff5252; box-shadow:0 4px 14px rgba(0,0,0,.45); background:#222 } #askc .awho svg { width:100%; height:100%; display:block } @media (max-width:520px) { #askc .awho { display:none } }
59
+ #askc .asay { min-width:0; display:flex; flex-direction:column; max-height:min(60vh,480px); overflow:hidden; background:#fff; color:#1b1d27; border-radius:12px 12px 12px 3px; font-size:13px; line-height:1.45; box-shadow:0 6px 20px rgba(0,0,0,.42); overflow-wrap:break-word } /* a head and a foot that stay, the menu between them scrolls */
60
+ #askc .ahd { flex:none; display:flex; align-items:center; gap:6px; padding:7px 6px 6px 12px; border-bottom:1px solid #eceef4; color:#5a6072; font-size:11.5px } #askc .ahd span:first-child { min-width:0; flex:1 } #askc .ak-t { flex:none; color:#c62828; font-weight:600; font-variant-numeric:tabular-nums } #askc .abody { min-height:0; overflow:auto; overscroll-behavior:contain; padding:9px 12px 11px; scrollbar-width:thin } #askc .aab { margin:0 0 4px }
61
+ #askc .aqs + .aqs { margin-top:11px; padding-top:10px; border-top:1px solid #eceef4 } #askc .aqh { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:4px; font-size:11px; color:#5a6072 } #askc .atag { padding:1px 8px; border-radius:99px; background:#eef1ff; color:#3949ab; font-weight:600 } #askc .anum { font-variant-numeric:tabular-nums } #askc .aq { margin:0 0 8px; font-size:13.5px; font-weight:500; text-wrap:pretty }
62
+ #askc .aops { list-style:none; margin:0; padding:0; display:grid; gap:5px } #askc .aops li { display:grid; grid-template-columns:20px 1fr; gap:9px; align-items:start; padding:6px 9px; border:1px solid #e6e7ee; border-radius:8px; background:#f8f9fc } #askc .aops i { width:20px; height:20px; margin-top:1px; border-radius:50%; background:#1b1d27; color:#fff; font:700 11px/20px system-ui,sans-serif; text-align:center } #askc .multi .aops i { border-radius:5px } #askc .aops b { display:block; font-weight:600 } #askc .aops span { display:block; margin-top:1px; color:#5a6072; font-size:12px; line-height:1.4; text-wrap:pretty } /* a round number for one choice, a square one for several, as radio buttons and boxes */
63
+ #askc pre { margin:0; padding:7px 9px; background:#f1f2f6; border-radius:7px; font:12px/1.45 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap } #askc .afoot { flex:none; padding:6px 12px 7px; border-top:1px solid #eceef4; background:#f7f8fb; color:#5a6072; font-size:11.5px }
64
+ #askc .ax { flex:none; width:24px; height:24px; border:0; border-radius:50%; background:transparent; color:#5a6072; cursor:pointer; font-size:13px; line-height:24px } #askc .ax:hover { background:#eceef4 } #askc .ax:focus-visible { outline:2px solid var(--accent); outline-offset:1px }
54
65
  #visit .vwho { flex:none; width:88px; height:66px; border-radius:12px; overflow:hidden; border:2px solid var(--accent); box-shadow:0 4px 14px rgba(0,0,0,.45); background:#222 } #visit.blocked .vwho { border-color:#ff5252 } #visit.speaking .vwho { box-shadow:0 0 0 3px rgba(124,156,255,.4), 0 4px 14px rgba(0,0,0,.45) } #visit .vwho svg { width:100%; height:100%; display:block }
55
66
  #visit .vx { position:absolute; top:-9px; left:-9px; width:20px; height:20px; border-radius:50%; background:var(--panel2); border:1px solid var(--line); color:var(--dim); font-size:11px; line-height:18px } #visit .vx:hover { color:var(--text) }
56
67
  @keyframes pulse { 50% { opacity:.3 } }
@@ -74,19 +85,20 @@
74
85
  .rr { display:flex; flex-direction:column; gap:2px; padding:6px 9px; border-radius:9px; border-left:3px solid transparent; background:var(--panel2); cursor:pointer; min-width:0 }
75
86
  .rr:hover { background:#2a2f45 } .rr.sel { outline:1px solid var(--accent) }
76
87
  .rr .n { display:flex; align-items:center; gap:7px; min-width:0 } .rr .dot { width:9px; height:9px; border-radius:50%; flex:none } .rr b { font-size:12.5px } .rr .ro { color:var(--dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
77
- .rr .st { font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
88
+ .rr .st { font-size:11.5px; overflow:hidden; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical } /* two lines before it is cut; the whole text is in the tooltip */
78
89
  .rr .rt { margin-left:auto; flex:none; padding-left:6px; color:#aab2c5; font-size:10.5px; white-space:nowrap } .rr.left { opacity:.72; padding-top:4px; padding-bottom:4px } .rr.left:hover { opacity:1 } /* what each agent has used so far; those who left the call keep their line, and their count with it */
79
90
  .rr.k-working { border-left-color:var(--gold) } .rr.k-working .st { color:var(--gold) } .rr.k-waiting { border-left-color:#8fd3ff } .rr.k-waiting .st { color:#8fd3ff }
80
91
  .rr.k-blocked { border-left-color:#ff5252; background:rgba(192,57,43,.28) } .rr.k-blocked .st { color:#fff; font-weight:700 } .rr.k-stalled { border-left-color:#ffb347 } .rr.k-stalled .st { color:#ffb347; font-weight:700 }
81
- .rr.k-done { opacity:.82 } .rr.k-done .st { color:var(--ok) } .rr.turn { opacity:1; border-left-color:var(--accent) } .rr.turn .st { color:var(--accent); font-weight:700 } .rr.k-idle .st { color:var(--dim) } .rr.speaking { box-shadow:0 0 0 2px rgba(124,156,255,.5) }
92
+ .rr.k-done { opacity:.82 } .rr.k-done .st { color:var(--ok) } .rr.turn { opacity:1; border-left-color:var(--accent) } .rr.turn .st { color:var(--accent); font-weight:700 } .rr.turn.gave { border-left-color:#ffb347 } .rr.turn.gave .st { color:#ffb347 } .rr.k-idle .st { color:var(--dim) } .rr.speaking { box-shadow:0 0 0 2px rgba(124,156,255,.5) }
82
93
  #boardv { flex:1; overflow:auto; padding:16px 18px; display:none }
83
94
  .bsum { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; font-size:12.5px } .bsum span { padding:3px 10px; border-radius:99px; background:var(--panel2); border:1px solid var(--line) }
84
95
  .bgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:10px }
85
96
  .bcard { text-align:left; background:var(--panel2); border:1px solid var(--line); border-radius:12px; padding:11px 13px; display:flex; flex-direction:column; gap:5px; cursor:pointer }
86
- .bcard:hover { border-color:var(--accent) } .bcard.blocked { border-color:#ff5252; box-shadow:0 0 0 2px rgba(255,82,82,.25) } .bcard.working { border-color:rgba(240,160,32,.7) } .bcard.waiting { border-color:rgba(110,190,255,.8) } .bcard.idle { opacity:.8 }
97
+ .bcard:hover { border-color:var(--accent) } .bcard.blocked { border-color:#ff5252; box-shadow:0 0 0 2px rgba(255,82,82,.25) } .bcard.gave { border-color:#ffb347 } .bcard.gave .bq { border-left-color:#ffb347 } .bcard.working { border-color:rgba(240,160,32,.7) } .bcard.waiting { border-color:rgba(110,190,255,.8) } .bcard.idle { opacity:.8 }
87
98
  .bcard .bt { font-weight:600; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical } .bcard .bp, .bcard .bm { color:var(--dim); font-size:11.5px }
88
99
  .bcard .stc { align-self:flex-start } .bcard .bh { display:flex; align-items:center; gap:6px; min-width:0 } .bcard .bh .stc { overflow:hidden; text-overflow:ellipsis }
89
100
  .bcard .bq { font-size:12.5px; color:var(--text); border-left:2px solid #ff5252; padding-left:8px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical }
101
+ .bfilt { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px } .bft { padding:2px 11px; border-radius:99px; border:1px solid var(--line); color:var(--dim); font-size:12px } .bft:hover { color:var(--text) } .bft.on { color:var(--text); border-color:var(--accent); background:var(--panel2) } .bft i { font-style:normal; opacity:.7 } details.bidle > summary { cursor:pointer; list-style:none } details.bidle > summary::-webkit-details-marker { display:none } details.bidle:not([open]) > summary::after { content:'▸'; margin-left:2px; opacity:.6 }
90
102
  .bsec { margin-bottom:18px } .bhd { display:flex; align-items:center; gap:7px; margin:0 0 9px; font-size:12.5px; font-weight:700; color:var(--dim) } .bhd.blocked { color:#ff8a80 } .bhd.turn { color:var(--text) }
91
103
  .bhd .bl { display:inline-block } .bhd .bl::first-letter { text-transform:uppercase } .bhd i { font-style:normal; font-weight:600; font-size:11.5px; padding:0 7px; border-radius:99px; background:var(--panel2); border:1px solid var(--line) }
92
104
  .bdone summary { cursor:pointer; list-style:none } .bdone summary::-webkit-details-marker { display:none } .bdone summary::after { content:'▸' } .bdone[open] summary::after { content:'▾' } .bdone .bcard { opacity:.7 }
@@ -123,6 +135,7 @@
123
135
  .prop.cheer { animation:cheer 1.1s ease-out both } @keyframes cheer { 0% { transform:scale(.3) translateY(10px); opacity:0 } 40% { transform:scale(1.25); opacity:1 } 100% { transform:translateY(-14px); opacity:0 } }
124
136
  /* ---------- screen sharing (presentation mode) ---------- */
125
137
  #present { display:none; flex:0 1 auto; min-height:96px; overflow:hidden; position:relative; height:clamp(190px,46vh,430px); background:radial-gradient(ellipse at 50% 0,#1b2033,#0b0d14); border-bottom:1px solid var(--line); padding:12px 16px; justify-content:center }
138
+ body.focusl #present { height:clamp(240px,58vh,900px) } body.focusl #present.pic { height:clamp(260px,68vh,1000px) } body.focusl #present.pin { height:clamp(240px,74vh,1000px) } /* Focus layout: the shared screen gets the room the characters gave up */
126
139
  #present.on { display:flex; animation:fadein .3s } #present.pic { height:clamp(220px,60vh,640px) }
127
140
  .pwin { flex:0 1 900px; display:flex; flex-direction:column; border-radius:10px; overflow:hidden; background:#0d1117; box-shadow:0 18px 50px rgba(0,0,0,.6), 0 0 0 2px rgba(240,160,32,.55) }
128
141
  .pbar { display:flex; align-items:center; gap:6px; padding:7px 10px; background:#1c1f2b; font-size:11.5px; color:#9aa0b4 } .pbar i { width:10px; height:10px; border-radius:50%; display:inline-block }
@@ -189,8 +202,9 @@
189
202
  .tag b, .tag span { background:rgba(14,15,24,.78); backdrop-filter:blur(6px); padding:2px 9px; border-radius:99px; font-size:11.5px; white-space:nowrap }
190
203
  .tag span { color:#e3e6f0; font-size:10.5px; overflow:hidden; text-overflow:ellipsis; min-width:0 }
191
204
  .status { position:absolute; top:6px; right:6px; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:99px; background:rgba(14,15,24,.8); backdrop-filter:blur(6px) }
205
+ #stage .tile .status { white-space:normal; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.3; border-radius:10px } #stage .tile .status:empty { display:none } /* what a tile is doing: two lines before it is cut */
192
206
  .status.working { color:var(--gold) } .status.done { color:var(--ok) } .status.turn { color:#0b1020; background:var(--accent) }
193
- .status.waiting { color:#8fd3ff } .status.blocked { color:#fff; background:#c0392b; font-weight:700 } .status.stalled { color:#1b1d27; background:#ffb347; font-weight:700 }
207
+ .status.waiting { color:#8fd3ff } .status.blocked { color:#fff; background:#c0392b; font-weight:700 } .status.stalled, .status.gave { color:#1b1d27; background:#ffb347; font-weight:700 }
194
208
  .tile.waiting { border-color:rgba(110,190,255,.85) } .tile.blocked { border-color:#ff5252 !important; animation:slowp 1.2s ease-in-out infinite } .tile.stalled { border-color:#ffb347 !important }
195
209
  /* the header's status chips are styled by id: "board" is also the class the Sessions view puts on <body>, and a rule on .board used to hide the whole page in a narrow window */
196
210
  #board { display:flex; gap:6px; font-size:11.5px; flex-wrap:nowrap; min-width:0; overflow:hidden } #board em { font-style:normal } #board span { flex:none; padding:2px 8px; border-radius:99px; background:var(--panel2); border:1px solid var(--line); white-space:nowrap }
@@ -218,7 +232,8 @@
218
232
  @keyframes flash2 { 40% { opacity:.9 } }
219
233
  .puff { position:fixed; left:0; top:0; z-index:9; pointer-events:none; border-radius:50% }
220
234
  #toasts { position:absolute; left:12px; bottom:12px; z-index:6; display:flex; flex-direction:column; gap:6px; pointer-events:none }
221
- .toast.offer { pointer-events:auto; animation:none; display:flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; order:9 } .toast.offer .btn { padding:3px 10px; font-size:12px; white-space:nowrap } .toast.offer .ic { font-size:11px; padding:2px 6px } /* the offer of the real voices: stays until answered, under the passing toasts */
235
+ .toast.offer { pointer-events:auto; animation:none; display:flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; order:9 } .toast.offer .btn { padding:3px 10px; font-size:12px; white-space:nowrap } .toast.offer .ic { font-size:11px; padding:2px 6px }
236
+ #packNoteI { width:48px; height:36px; border-radius:4px; object-fit:cover; flex:none; cursor:pointer; margin-left:-6px } /* the offer of the real voices: stays until answered, under the passing toasts */
222
237
  .toast { background:rgba(27,29,39,.92); border:1px solid var(--line); border-radius:99px; padding:5px 12px; font-size:12px; animation:toast 3s ease forwards } @keyframes toast { 0% { opacity:0; transform:translateY(6px) } 10%, 80% { opacity:1; transform:none } 100% { opacity:0 } }
223
238
  .eye { transform-box:fill-box; transform-origin:center; animation:blink 4.6s infinite; animation-delay:var(--d,0s) } @keyframes blink { 0%,94%,100% { transform:scaleY(1) } 97% { transform:scaleY(.08) } }
224
239
  .brow { transform-box:fill-box; transform-origin:center; transition:transform .25s } .tile.speaking .brow { animation:brow .7s ease-in-out infinite } @keyframes brow { 50% { transform:translateY(-1.1px) } }
@@ -239,10 +254,11 @@
239
254
  .fly { position:fixed; left:0; top:0; font-size:28px; z-index:8; pointer-events:none; filter:drop-shadow(0 3px 4px rgba(0,0,0,.5)) }
240
255
 
241
256
  /* ---------- overlays ---------- */
242
- #gate, #empty { position:absolute; inset:0; z-index:4; display:none; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; padding:24px; background:rgba(18,19,26,.82); backdrop-filter:blur(3px) }
243
- #gate.on, #empty.on { display:flex } #empty { background:var(--bg) } #empty.on ~ #gate { display:none } /* no session at all: nothing to join, the empty state and its demo button are what there is to see */
244
- body:has(#gate.on) .toast.offer, body:has(#empty.on) .toast.offer { display:none !important } /* the lines that offer something wait for the call: over the join screen of a small panel they covered its button, and the click fell on theirs */
245
- #gate h2, #empty h2 { margin:0; font:800 22px "Comic Sans MS","Chalkboard SE",system-ui,sans-serif } #gate p, #empty p { margin:0; color:var(--dim); max-width:380px } #eP b { color:var(--text) }
257
+ #empty { position:absolute; inset:0; z-index:4; display:none; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; padding:24px; background:var(--bg) }
258
+ #empty.on { display:flex } #empty.on ~ #gate { display:none } /* no session at all: the empty state and its demo button are what there is to see */
259
+ #gate { position:absolute; top:10px; left:50%; transform:translateX(-50%); z-index:7; display:none } #gate.on { display:block } #gate .cta { padding:7px 16px; font-size:13px; box-shadow:0 6px 20px rgba(0,0,0,.45); white-space:nowrap } /* the call plays at once, silent: this chip (or any click) turns its sound on, which a browser allows only after one */
260
+ body:has(#empty.on) .toast.offer { display:none !important } /* the lines that offer something wait for the call */
261
+ #empty h2 { margin:0; font:800 22px "Comic Sans MS","Chalkboard SE",system-ui,sans-serif } #empty p { margin:0; color:var(--dim); max-width:380px } #eP b { color:var(--text) }
246
262
  .cta { background:var(--accent); color:#0b1020; font-weight:700; padding:10px 22px; border-radius:99px; font-size:14px } .cta:hover { filter:brightness(1.1) } .cta:empty { display:none }
247
263
  .btn { background:var(--panel2); border:1px solid var(--line); padding:6px 12px; border-radius:8px } .btn:hover { border-color:var(--accent) }
248
264
  #menu { position:absolute; top:52px; right:10px; z-index:12; width:280px; background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 40px rgba(0,0,0,.55); padding:6px; display:none; max-height:calc(100vh - 62px); max-height:calc(100dvh - 62px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin } /* never taller than the window: it scrolls instead of being cut off */
@@ -288,7 +304,7 @@
288
304
  #prefs .flash { animation:flash 1.6s ease } @keyframes flash { 0%, 40% { background:rgba(124,156,255,.28) } }
289
305
  #prefs .pfoot { display:flex; justify-content:flex-end; padding:12px 10px 0; margin-top:8px; border-top:1px solid var(--line) } #prefsReset.sure { border-color:#ff7a6b; color:#ffb4a8 }
290
306
  #menuTip { position:fixed; z-index:13; max-width:260px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #menuTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #menuTip .btn { display:block; margin:8px 0 0 auto } /* once, after the menu moved */
291
- #rateTip, #coffeeTip { position:fixed; z-index:13; max-width:280px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #rateTip::before, #coffeeTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #rateTip .rtb, #coffeeTip .rtb { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; margin-top:8px } #rateYes, #coffeeYes { border-color:var(--accent) } /* once, on the third day: a star (desktop app, command line) */
307
+ #rateTip, #coffeeTip, #usageTip { position:fixed; z-index:13; max-width:280px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #rateTip::before, #coffeeTip::before, #usageTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #rateTip .rtb, #coffeeTip .rtb, #usageTip .rtb { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; margin-top:8px } #usageTip { max-width:360px } #rateYes, #coffeeYes, #usageYes { border-color:var(--accent) } /* once, on the third day: a star (desktop app, command line) */
292
308
  a.artist { color:#f5c04a; text-underline-offset:2px } #menuShop:empty { display:none } #menuShop { margin:2px 0 8px; font-size:12px; line-height:1.5; color:#c3c6d4 } /* the Halloween pack, for those who do not have it */
293
309
  #recap { position:fixed; inset:0; z-index:15; background:rgba(5,6,12,.88); display:none; overflow:auto; padding:28px 16px } #recap.on { display:block }
294
310
  #recap .box { max-width:860px; margin:0 auto; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px 26px }
@@ -326,6 +342,7 @@
326
342
  <button class="ic" id="bMenu" title="Réglages">⚙</button>
327
343
  </header>
328
344
  <div id="sline"></div>
345
+ <button id="attn" hidden></button>
329
346
  <div id="tabs" role="tablist" aria-label="Sessions"></div>
330
347
 
331
348
  <div id="menu">
@@ -361,6 +378,8 @@
361
378
  <button class="mi" id="mReport"><span data-fr="🐞 Signaler un problème" data-en="🐞 Report a problem">🐞 Signaler un problème</span></button>
362
379
  </div>
363
380
  <div id="menuTip" role="status" style="display:none"><span id="menuTipT"></span><button class="btn" id="menuTipOk"></button></div>
381
+ <div id="btip" role="tooltip"></div>
382
+ <div id="usageTip" role="dialog" aria-live="polite" style="display:none"><span id="usageTipT"></span><div class="rtb"><button class="btn" id="usageRead"></button><button class="btn" id="usageNo"></button><button class="btn" id="usageYes"></button></div></div>
364
383
  <div id="coffeeTip" role="status" style="display:none"><span id="coffeeTipT"></span><div class="rtb"><button class="btn" id="coffeeNo"></button><button class="btn" id="coffeeYes"></button></div></div>
365
384
  <div id="rateTip" role="status" style="display:none"><span id="rateTipT"></span><div class="rtb"><button class="btn" id="rateNo"></button><button class="btn" id="rateLater"></button><button class="btn" id="rateYes"></button></div></div>
366
385
  <div id="prefs" role="dialog" aria-modal="true" aria-labelledby="prefsT"><div class="pbox">
@@ -371,13 +390,14 @@
371
390
  <div class="box" id="officeBox" style="display:none"><input id="officeVol" type="range" min="0.1" max="1" step="0.05" style="width:100%" aria-label="Ambience volume"></div>
372
391
  <button class="mi" data-t="music"><span data-fr="Musique d’ambiance (radio FIP)" data-en="Office music (FIP radio)">Musique d’ambiance (radio FIP)</span><i class="sw"></i></button>
373
392
  <div class="box" id="musicBox" style="display:none"><select id="station"></select><input id="musicVol" type="range" min="0" max="1" step="0.05" style="width:100%" aria-label="Music volume"></div>
374
- <button class="mi" data-t="notify"><span data-fr="Me prévenir quand les agents ont fini" data-en="Notify me when agents finish">Me prévenir quand les agents ont fini</span><i class="sw"></i></button>
393
+ <button class="mi" data-t="shareUsage" id="mShare" style="display:none"><span data-fr="Aider à compter les utilisateurs (1 requête par semaine)" data-en="Help count users (1 request a week)">Aider à compter les utilisateurs (1 requête par semaine)</span><i class="sw"></i></button> <button class="mi" data-t="notify"><span data-fr="Me prévenir quand les agents ont fini" data-en="Notify me when agents finish">Me prévenir quand les agents ont fini</span><i class="sw"></i></button>
375
394
  <h4 data-fr="Personnages" data-en="Characters">Personnages</h4>
376
395
  <button class="mi" data-t="customLaptop"><span data-fr="Ordinateur devant vos personnages" data-en="Laptop in front of your own characters">Ordinateur devant vos personnages</span><i class="sw"></i></button>
377
396
  <button class="mi" data-t="ownNames"><span data-fr="Garder les noms de mes agents" data-en="Keep my agents’ own names">Garder les noms de mes agents</span><i class="sw"></i></button>
378
397
  </div><div class="pcol">
379
398
  <h4 data-fr="Affichage" data-en="Display">Affichage</h4>
380
399
  <button class="mi" data-t="roster"><span data-fr="Liste des agents (à gauche)" data-en="Agents list (left)">Liste des agents (à gauche)</span><i class="sw"></i></button>
400
+ <button class="mi" data-t="focusLayout"><span data-fr="Mise en page concentrée : petites caméras, grand écran partagé" data-en="Focus layout: small cameras, big shared screen">Mise en page concentrée : petites caméras, grand écran partagé</span><i class="sw"></i></button>
381
401
  <button class="mi" data-t="reactions"><span data-fr="Barre de réactions (👍 👏 ☕)" data-en="Reactions bar (👍 👏 ☕)">Barre de réactions (👍 👏 ☕)</span><i class="sw"></i></button>
382
402
  <button class="mi" data-t="banter"><span data-fr="Petites répliques et animations" data-en="Little lines & animations">Petites répliques et animations</span><i class="sw"></i></button>
383
403
  <div class="box"><div class="lbl"><span data-fr="Bavardage entre agents" data-en="Chatter between agents">Bavardage entre agents</span></div><select id="chatSel"><option value="quiet" data-fr="Discret" data-en="Quiet">Discret</option><option value="normal" data-fr="Normal" data-en="Normal">Normal</option><option value="lively" data-fr="Animé" data-en="Lively">Animé</option></select></div>
@@ -386,6 +406,7 @@
386
406
  <button class="mi" data-t="files"><span data-fr="Fichiers créés pour vous, à la fin d’un tour" data-en="Files made for you, when a turn ends">Fichiers créés pour vous, à la fin d’un tour</span><i class="sw"></i></button>
387
407
  <button class="mi" data-t="artNet"><span data-fr="Artifacts : charger leurs bibliothèques (depuis Internet)" data-en="Artifacts: load their libraries (from the internet)">Artifacts : charger leurs bibliothèques (depuis Internet)</span><i class="sw"></i></button>
388
408
  <button class="mi" data-t="visits"><span data-fr="Un visiteur quand une autre session vous attend" data-en="A visitor when another session needs you">Un visiteur quand une autre session vous attend</span><i class="sw"></i></button>
409
+ <button class="mi" data-t="askCard"><span data-fr="Une carte avec ce que la session vous demande" data-en="A card with what the session asks you">Une carte avec ce que la session vous demande</span><i class="sw"></i></button>
389
410
  <button class="mi" data-t="followTab" id="mFollowTab" style="display:none"><span data-fr="Suivre l’onglet Claude Code affiché" data-en="Follow the Claude Code tab I am on">Suivre l’onglet Claude Code affiché</span><i class="sw"></i></button>
390
411
  </div></div>
391
412
  <div class="pfoot"><button class="btn" id="prefsReset" data-fr="Réglages par défaut" data-en="Reset to defaults">Réglages par défaut</button></div>
@@ -400,9 +421,9 @@
400
421
  <div id="files"></div>
401
422
  <div id="hl"></div>
402
423
  <canvas id="gantt" height="90"></canvas>
403
- <div id="toasts" role="status" aria-live="polite"><div class="toast offer" id="vOffer" style="display:none"><span id="vOfferT"></span><button class="btn" id="vOfferB"></button><button class="ic" id="vOfferX" aria-label="Close">✕</button></div><div class="toast offer" id="packNote" style="display:none"><span id="packNoteT"></span><button class="btn" id="packNoteB"></button><button class="ic" id="packNoteX" aria-label="Close">✕</button></div><div class="toast offer" id="trNote" style="display:none"><span id="trNoteT"></span><button class="btn" id="trNoteOk"></button><button class="btn" id="trNoteOff"></button></div></div><div id="visit" role="status" aria-live="polite"></div><div id="askc" role="region" aria-live="polite"></div>
424
+ <div id="toasts" role="status" aria-live="polite"><div class="toast offer" id="vOffer" style="display:none"><span id="vOfferT"></span><button class="btn" id="vOfferB"></button><button class="ic" id="vOfferX" aria-label="Close">✕</button></div><div class="toast offer" id="packNote" style="display:none"><img id="packNoteI" src="pack-halloween.jpg" alt="" width="48" height="36"><span id="packNoteT"></span><button class="btn" id="packNoteB"></button><button class="ic" id="packNoteX" aria-label="Close">✕</button></div><div class="toast offer" id="trNote" style="display:none"><span id="trNoteT"></span><button class="btn" id="trNoteOk"></button><button class="btn" id="trNoteOff"></button></div></div><div id="visit" role="status" aria-live="polite"></div><div id="askc" role="region" aria-live="polite"></div>
404
425
  <div id="empty"><h2 id="eT"></h2><p id="eP"></p><button class="cta" id="eDemo"></button></div>
405
- <div id="gate"><h2 id="gT"></h2><p id="gP"></p><button class="cta" id="gB"></button></div>
426
+ <div id="gate"><button class="cta" id="gB"></button></div>
406
427
  <div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
407
428
  </section>
408
429
  <aside><h2 id="logH">Transcript</h2><input id="logQ" type="search" placeholder="Search…" aria-label="Search the transcript" style="margin:8px 10px;width:calc(100% - 20px)"><div id="log"></div></aside>
@@ -442,10 +463,11 @@ const Q = new URLSearchParams(location.search);
442
463
  const EMBED = Q.get('embed') === '1' || window.parent !== window;
443
464
  const APP = window.AS_APP && typeof window.AS_APP === 'object' && typeof window.AS_APP.rate === 'string' ? window.AS_APP : { kind: '', rate: 'https://github.com/Atoll92/agent-standup' }; // where this page runs (appKind in server.js)
444
465
 
445
- let prefs = { lang: 'en', voice: true, roster: true, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, followTab: true, files: true, callTr: true };
466
+ let prefs = { lang: 'en', voice: true, roster: true, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, askCard: false, followTab: true, files: true, callTr: true };
446
467
  const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to defaults
447
468
  { let loc = {}; try { loc = JSON.parse(localStorage.getItem('cc.prefs') || '{}') || {}; } catch {} // the settings file (shared by every window) and this origin's copy: the more recent one wins
448
- const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; Object.assign(prefs, (sv._t || 0) > (loc._t || 0) ? sv : loc); }
469
+ const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; Object.assign(prefs, (sv._t || 0) > (loc._t || 0) ? sv : loc);
470
+ if ((+sv.shareUsageT || 0) > (+prefs.shareUsageT || 0)) { prefs.shareUsage = sv.shareUsage; prefs.shareUsageT = sv.shareUsageT; prefs.usageAsked = sv.usageAsked; } } // the usage answer: the newest one, as the server keeps it (this origin's copy may hold an older one)
449
471
  const HAD_PREFS = !!prefs._t; // someone who used the app before this page: shown once where the settings went
450
472
  if (!HAD_PREFS) prefs.menuTipSeen = true; // a first visit: the menu was never anywhere else for this person, so the tip is not shown on the next visits either
451
473
  if (prefs.vstyle === 'babble') prefs.vstyle = 'animal', prefs.vstyleChosen = true;
@@ -456,7 +478,8 @@ if (prefs.vstyle === 'sims' && prefs.vstyleChosen) prefs.vstyle = 'animal';
456
478
  if (prefs.vstyle !== 'animal' || !prefs.vstyleChosen) prefs.vstyle = 'kokoro';
457
479
  if (!prefs.notifyChosen) prefs.notify = true; // “tell me when the agents are done” is on unless the person chose otherwise
458
480
  let prefsTimer = null;
459
- const savePrefs = () => { prefs._t = Date.now(); try { localStorage.setItem('cc.prefs', JSON.stringify(prefs)); } catch {} clearTimeout(prefsTimer); prefsTimer = setTimeout(() => { fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(prefs) }).catch(() => {}); }, 400); };
481
+ let shareWas = prefs.shareUsage; // the usage answer as last saved: when it changes, savePrefs dates it, and the server keeps the newest (another page may write older settings)
482
+ const savePrefs = () => { prefs._t = Date.now(); if (prefs.shareUsage !== shareWas) { shareWas = prefs.shareUsage; prefs.shareUsageT = Date.now(); } try { localStorage.setItem('cc.prefs', JSON.stringify(prefs)); } catch {} clearTimeout(prefsTimer); prefsTimer = setTimeout(() => { fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(prefs) }).catch(() => {}); }, 400); };
460
483
  // Languages: French and English live in the code as pairs L(french, english); every other language is a catalogue public/locales/<code>.json mapping the English text to its translation.
461
484
  // A missing string falls back to English, so a half-translated language still works. See public/locales/README.md to add one.
462
485
  const LANGS = [['en', 'English', 'en'], ['fr', 'Français', 'fr'], ['zh-TW', '繁體中文', 'zh-Hant-TW'], ['zh-CN', '简体中文', 'zh-Hans-CN'], ['es', 'Español', 'es'], ['de', 'Deutsch', 'de'], ['da', 'Dansk', 'da'], ['pt-BR', 'Português (Brasil)', 'pt-BR'], ['ja', '日本語', 'ja'], ['ko', '한국어', 'ko']];
@@ -627,9 +650,15 @@ function renderFolder(el, mine) { // one's own pictures: where they are, a but
627
650
  el.querySelectorAll('[data-rm]').forEach((b) => (b.onclick = async () => { await post('/api/characters/remove', { file: b.dataset.rm }); await reloadChars(); }));
628
651
  $('#charReload').onclick = () => reloadChars(); if ($('#charOpen')) $('#charOpen').onclick = () => window.parent.postMessage({ agentStandup: 'openCharacters' }, '*');
629
652
  }
630
- function packNote() { // once, to someone who is the vampire without the pack: where the rest of the cast is
631
- const on = CHARS.youFrom === 'vampire' && !prefs.vampSeen && !Q.get('demo') && !(SHOP.halloween && SHOP.halloween.n), el = $('#packNote'); if (!el) return; el.style.display = on ? '' : 'none'; if (!on) return;
632
- $('#packNoteT').textContent = L('Pour Halloween, vous êtes le vampire. Le reste de l’équipe est dans le pack Halloween.', 'This Halloween, you are the vampire. The rest of the cast is in the Halloween pack.'); $('#packNoteB').textContent = L('Voir le pack', 'See the pack');
653
+ function packNote() { // the Halloween pack, to someone without it, twice a season at most: one line in October (the vampire's before the 19th, to the vampire only; from the 19th, to everyone), one on the 30th or 31st if the first was 5 days before or more. Never on a first day, nor the first day the usage question shows (usagePending); shown, it stays until ✕ or the button, also after a reload that day
654
+ const d = new Date(), m = d.getMonth(), dd = d.getDate(), phase = dd >= 30 ? 2 : 1, seen = +prefs.packSeen || (prefs.vampSeen ? 1 : 0), el = $('#packNote'); if (!el) return; // vampSeen: the vampire's line, closed in 1.33 to 1.38, counts as the first
655
+ const early = dd < 19 && CHARS.youFrom !== 'vampire', open = prefs.packOpen && prefs.packDay === utcDay(), due = !early && seen < phase && !askedToday('pack') && !firstDay() && !(usagePending() && (!prefs.usageDay || prefs.usageDay >= utcDay())) && $('#usageTip').style.display === 'none' && (!prefs.packDay || Date.parse(utcDay()) - Date.parse(prefs.packDay) >= 5 * 864e5);
656
+ const on = m === 9 && (open || due) && !Q.get('demo') && !(SHOP.halloween && SHOP.halloween.n) && !voiceOffer.busy; el.style.display = on ? '' : 'none'; if (!on) return; // busy: the voices are downloading, and their line says so
657
+ if (due && !open) { prefs.packSeen = phase; prefs.packDay = utcDay(); prefs.packOpen = true; savePrefs(); } noteAsk('pack'); $('#vOffer').style.display = 'none'; // one offer at a time: the voices' line comes back when this one is closed
658
+ const price = (SHOP.halloween && SHOP.halloween.price) || '2 €';
659
+ $('#packNoteT').textContent = dd === 31 ? L('Joyeux Halloween ! Vos agents peuvent venir à l’appel déguisés.', 'Happy Halloween! Your agents can come to the call in costume.') : dd === 30 ? L('Halloween, c’est demain : vos agents peuvent venir à l’appel déguisés.', 'Halloween is tomorrow: your agents can come to the call in costume.')
660
+ : dd >= 19 ? L('Halloween approche : déguisez vos agents en citrouille, fantôme, sorcière ou squelette, dessinés à la main par Fabien Coupas.', 'Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.') : L('Pour Halloween, vous êtes le vampire. Le reste de l’équipe est dans le pack Halloween.', 'This Halloween, you are the vampire. The rest of the cast is in the Halloween pack.');
661
+ $('#packNoteB').textContent = L('Voir le pack', 'See the pack') + ' · ' + price;
633
662
  }
634
663
  function persona(a) { const p = persona0(a); p.custom = customFor(a.id); return p; }
635
664
  const subName = (a, h) => (a.own && prefs.ownNames ? (nameBook[a.id] = a.own) : a.given || uniqueName(a.id, h)); // own: the name the person gave this agent (see ownName in server.js); otherwise a first name from the list. a.own is tested first: the landing page reuses this section and has no settings
@@ -873,7 +902,7 @@ function updateHint() {
873
902
  // =====================================================================
874
903
  const AUD = {
875
904
  ctx: null, muted: false, live: new Set(), lastClick: 0,
876
- off() { return this.muted || !!(S.owner && S.owner !== CID); }, // muted here, or another window holds the sound
905
+ off() { return this.muted || !!S.hush || !!(S.owner && S.owner !== CID); }, // muted here, not turned on yet (S.hush: no click since the page opened), or another window holds the sound
877
906
  init() {
878
907
  if (this.ctx) { this.ctx.resume(); return; }
879
908
  let c; try { c = this.ctx = new (window.AudioContext || window.webkitAudioContext)(); } catch { return; }
@@ -1185,7 +1214,7 @@ function pieces(text) {
1185
1214
  const capTimers = new Map(); // agent id → timers that advance its subtitle
1186
1215
  function captionClear(id) { (capTimers.get(id) || []).forEach(clearTimeout); capTimers.delete(id); }
1187
1216
  function setCaption(id, text) {
1188
- const t = $('#t-' + id), b = t && t.querySelector('.bubble'), say = S.say[id]; if (!b || !say) return;
1217
+ const t = document.getElementById('t-' + id), b = t && t.querySelector('.bubble'), say = S.say[id]; if (!b || !say) return; // by id: a visitor's id holds a session path (":" and "/"), which a selector cannot take
1189
1218
  b.innerHTML = (say.label ? `<small>${esc(say.label)}</small>` : '') + esc(text); if (S.present === id) $('#pcap').textContent = text;
1190
1219
  }
1191
1220
  function captionRun(id, text, totalMs, from = 0) { // from: how far into the line the voice already is, when the timing is corrected along the way
@@ -1242,7 +1271,7 @@ function buildStage() { // the tiles, and the presenter camera with them: a ch
1242
1271
  const pr = S.present && S.agents[S.present]; if (pr) { $('#pcam').innerHTML = avatarSVG(pr, undefined, 'c' + pr.gid + '_') + `<div class="tag"><b>${esc(pr.name)}</b><span class="tk"></span></div>`; S.camFor = pr.id; camTok(); }
1243
1272
  }
1244
1273
  const layout = () => {
1245
- const st = $('#stage'), w = st.clientWidth - 28 || 600, nar = $('#center').clientWidth < 480, cols = nar ? (w >= 300 ? 2 : 1) : Math.max(1, Math.floor((w + 12) / 212)), colw = (w - 12 * (cols - 1)) / cols;
1274
+ const st = $('#stage'), w = st.clientWidth - 28 || 600, nar = $('#center').clientWidth < 480, foc = !nar && document.body.classList.contains('focusl'), cols = nar ? (w >= 300 ? 2 : 1) : Math.max(1, Math.floor((w + 12) / (foc ? 162 : 212))), colw = (w - 12 * (cols - 1)) / cols; // foc: ⚙ → Focus layout, small cameras and no big spotlight tile
1246
1275
  const rh = Math.round(colw * (nar ? 0.66 : 0.74)); st.style.setProperty('--cols', cols); st.style.setProperty('--rh', rh + 'px'); // Spotlight size: the biggest block (k columns × fr rows) that stays close to 3:2 and leaves room beside it for the others.
1247
1276
  const maxRows = Math.max(cols > 1 ? 2 : 1, Math.floor((st.clientHeight * 0.7 + 12) / (rh + 12))); // the stage scrolls, so the spotlight may be a bit taller than the free space
1248
1277
  let k = 1, fr = 1, best = -1;
@@ -1252,11 +1281,17 @@ const layout = () => {
1252
1281
  if (area > best) { best = area; k = kk; fr = rr; }
1253
1282
  }
1254
1283
  if (nar) { k = cols; fr = cols > 1 ? 2 : 1; } // side panel: small tiles, a banner-sized spotlight
1284
+ else if (foc) { k = 1; fr = 1; }
1255
1285
  else if (best < 0) { k = Math.min(2, cols); fr = Math.min(2, maxRows); }
1256
1286
  st.style.setProperty('--fcols', k); st.style.setProperty('--fr', fr); st.classList.toggle('one', cols === 1);
1257
1287
  document.body.classList.toggle('narrow', $('#center').clientWidth <= 480); document.body.classList.toggle('compact', $('#center').clientWidth <= 480 && !$('#roster').offsetWidth); document.body.classList.toggle('tiny', $('#center').clientWidth < 300); drawGantt();
1258
1288
  };
1259
1289
  new ResizeObserver(layout).observe($('#center'));
1290
+ function placeToasts() { // the toasts and the offers sit just above what is under the stage (the line of files, the highlights, the timeline), never over it
1291
+ const v = ['#stage', '#tree', '#boardv'].map((q) => $(q)).find((x) => x && x.offsetParent); if (!v) return; const gap = $('#center').clientHeight - (v.offsetTop + v.offsetHeight), b = Math.max(12, Math.round(gap) + 12) + 'px';
1292
+ if ($('#toasts').style.bottom !== b) $('#toasts').style.bottom = b;
1293
+ }
1294
+ for (const q of ['#stage', '#tree', '#boardv', '#center']) new ResizeObserver(() => requestAnimationFrame(placeToasts)).observe($(q));
1260
1295
 
1261
1296
  function logRow(i) {
1262
1297
  const e = S.events[i], arrow = e.to ? ` <span class="arrow">→</span> <span class="who">${esc(nameOf(e.to))}</span>` : '';
@@ -1297,7 +1332,7 @@ const applyStatus = (ev) => {
1297
1332
  };
1298
1333
  function recomputeStatus(upTo) {
1299
1334
  S.files = new Map(); S.cands = new Map(); S.turnN = 0; S.turnSaid = ''; S.arts = new Map(); S.artCalls = new Map();
1300
- S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.lastTool = {}; S.mainBusyAt = 0; S.turnOver = false; S.th = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.recomputing = true; document.querySelectorAll('.tile').forEach((t) => { clearTimeout(t._byeT); t.classList.remove('bye'); }); hidePresent();
1335
+ S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.lastTool = {}; S.mainBusyAt = 0; S.turnOver = false; S.th = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.errList = {}; S.callById = new Map(); S.recomputing = true; document.querySelectorAll('.tile').forEach((t) => { clearTimeout(t._byeT); t.classList.remove('bye'); }); hidePresent();
1301
1336
  S.status = {}; S.tc = {}; S.doneAt = {}; S.gone.clear(); S.leaving.clear(); document.querySelectorAll('.tile.vanishing').forEach((t) => t.classList.remove('vanishing')); const doneIdx = {}; document.querySelectorAll('.ticker').forEach((x) => { x.classList.remove('on'); x.innerHTML = ''; });
1302
1337
  for (let i = 0; i < upTo; i++) {
1303
1338
  const e = S.events[i]; applyStatus(e); tally(e); if (e.kind === 'tools') S.tc[e.agent] = (S.tc[e.agent] || 0) + e.tools.length;
@@ -1316,7 +1351,7 @@ function syncUI() {
1316
1351
 
1317
1352
  // ---------- tool ticker, shared screen, flying messages ----------
1318
1353
  // ---------- what each agent is doing: tool calls with their real outputs ----------
1319
- S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.present = null; S.camFor = null; let presentTimer = null;
1354
+ S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.errList = {}; S.callById = new Map(); S.present = null; S.camFor = null; let presentTimer = null;
1320
1355
  S.files = new Map(); S.cands = new Map(); S.turnN = 0; S.turnSaid = ''; S.fgone = new Set(); S.fmade = new Map(); S.arts = new Map(); S.artCalls = new Map(); S.artOk = new Map(); S.artPin = null; S.artWhole = null; S.wholeSeen = new Set(); // files: path → the Write call that created it, in the order they were written · cands: the documents the commands name (see candFile) · turnN: how many orders you gave so far · turnSaid: what you and the lead said in this turn · fgone: the files found missing on a click · fmade: what the server answered about a document a command names
1321
1356
  const later = (k, fn, ms = 160) => { later.p = later.p || {}; if (later.p[k]) return; later.p[k] = setTimeout(() => { later.p[k] = 0; fn(); }, ms); }; // coalesce bursts of repaints
1322
1357
  const fmtTok = (n) => (n < 1000 ? String(n) : n < 1e6 ? (n / 1000).toFixed(n < 1e4 ? 1 : 0) + 'k' : (n / 1e6).toFixed(n < 1e7 ? 2 : 1) + 'M');
@@ -1336,7 +1371,7 @@ function ctxWin(model, ctx) { const base = WIN1M.test(model || '') ? 1e6 : 2e5;
1336
1371
  const fileOf = (f) => String(f || '').split(/[\\/]/).pop();
1337
1372
  function wasteStep(W, ev) { // W: the session's state (S.wst, or a fresh one for the recap); true when something was noted
1338
1373
  if (!W.reads) { const N = () => Object.create(null); Object.assign(W, { reads: N(), finds: N(), calls: N(), failed: N(), items: N() }); } /* no prototype: a file or a search named __proto__ is just a name */
1339
- const a = ev.agent; let hit = false; const note = (it) => { const l = (W.items[a] = W.items[a] || []); l.push(it); if (l.length > 60) l.shift(); hit = true; };
1374
+ const a = ev.agent; let hit = false; const note = (it) => { const l = (W.items[a] = W.items[a] || []); l.push({ ...it, ts: ev.ts }); if (l.length > 60) l.shift(); hit = true; };
1340
1375
  if (ev.kind === 'tools') for (const t of ev.tools) { const d = t.d || {};
1341
1376
  if (d.kind === 'read' && d.file) { const m = (W.reads[d.file] = W.reads[d.file] || Object.create(null)), part = (d.offset || '') + ':' + (d.limit || ''), o = Object.keys(m).find((x) => x !== a); /* a part of a long file is another read */
1342
1377
  if (m[a] && m[a].has(part)) note({ k: 'again', f: d.file }); else if (o) note({ k: 'other', f: d.file, by: o }); (m[a] = m[a] || new Set()).add(part); }
@@ -1351,10 +1386,53 @@ function wasteStep(W, ev) { // W: the session's state (S.wst, or a fresh one f
1351
1386
  const wasteLine = (it) => it.k === 'again' ? L('relu : {0}', 'read again: {0}').replace('{0}', () => fileOf(it.f)) : it.k === 'other' ? L('déjà lu par {0} : {1}', 'already read by {0}: {1}').replace('{0}', () => nameOf(it.by)).replace('{1}', () => fileOf(it.f))
1352
1387
  : it.k === 'find' ? L('même recherche relancée : {0}', 'same search again: {0}').replace('{0}', () => '“' + it.q + '”') : it.k === 'findOther' ? L('même recherche que {0} : {1}', 'same search as {0}: {1}').replace('{0}', () => nameOf(it.by)).replace('{1}', () => '“' + it.q + '”')
1353
1388
  : L('relance une commande qui a échoué : {0}', 'reran a failing command: {0}').replace('{0}', () => it.c);
1389
+ // The badges' card: on hover (or a tap), what is behind ✗ ♻ 🔁 ⏳ 💤, read from the session alone.
1390
+ function noteCalls(ev) {
1391
+ if (!S.callById) { S.callById = new Map(); S.errList = {}; }
1392
+ if (ev.kind === 'tools') for (const t of ev.tools) { S.callById.set(t.id, { name: t.name, arg: t.arg, d: t.d, ts: ev.ts }); if (S.callById.size > 3000) S.callById.delete(S.callById.keys().next().value); }
1393
+ else if (ev.kind === 'results') for (const it of ev.items) { if (it.err) { const l = (S.errList[ev.agent] = S.errList[ev.agent] || []); l.push({ ts: ev.ts, call: S.callById.get(it.id), out: it.out }); if (l.length > 40) l.shift(); } S.callById.delete(it.id); }
1394
+ }
1395
+ var BT = { el: null, h: 0 }; const toolShort = (n) => (String(n || '').startsWith('mcp__') ? String(n).split('__').pop() : String(n || ''));
1396
+ const clockOf = (ts) => { try { return ts ? new Date(ts).toLocaleTimeString(document.documentElement.lang || undefined, { hour: '2-digit', minute: '2-digit' }) : ''; } catch { return ''; } };
1397
+ const callText = (c) => String((c && ((c.d && (c.d.text || c.d.file || c.d.pattern || c.d.url || c.d.query)) || c.arg)) || '').replace(/\s+/g, ' ').trim().slice(0, 240);
1398
+ const errBit = (o) => { const ls = String(o || '').replace(/\x1b\[[0-9;]*m/g, '').split('\n').map((x) => x.trim()).filter(Boolean), i = Math.max(0, ls.findIndex((x) => /error|fail|denied|not found|no such|exception|cannot|refused|invalid|expected|✗|●/i.test(x))); return ls.slice(i, i + 3).map((x) => x.slice(0, 160)); };
1399
+ const wasteParts = (it) => { const path = String(it.f || '').split(/[\\/]/).slice(-2).join('/');
1400
+ return it.k === 'again' ? [L('Relu', 'Read again'), path] : it.k === 'other' ? [L('Déjà lu par {0}', 'Already read by {0}').replace('{0}', () => nameOf(it.by)), path]
1401
+ : it.k === 'find' ? [L('Même recherche relancée', 'Same search again'), '“' + it.q + '”'] : it.k === 'findOther' ? [L('Même recherche que {0}', 'Same search as {0}').replace('{0}', () => nameOf(it.by)), '“' + it.q + '”'] : [L('Relance une commande en échec', 'Reran a failing command'), it.c || '']; };
1402
+ function tipHtml(k, id) {
1403
+ const head = (icon, title, n) => `<div class="bh"><span class="bi">${icon}</span><span class="bt">${esc(title)}</span>${n ? `<span class="bn">${esc(String(n))}</span>` : ''}<span class="ba">${esc(nameOf(id))}</span></div>`;
1404
+ const foot = (t) => (t ? `<div class="bf">${esc(t)}</div>` : ''), more = (n) => foot(n > 0 ? L('+ {0} plus tôt', '+ {0} earlier').replace('{0}', () => n) : '');
1405
+ const row = (name, time, txt, extra) => `<li><div class="r1">${name}<span class="rt">${esc(time)}</span></div>${txt ? `<code>${esc(txt)}</code>` : ''}${extra || ''}</li>`;
1406
+ if (k === 'e') { const l = (S.errList && S.errList[id]) || [], n = S.errs[id] || l.length, sh = l.slice(-4).reverse(); if (!n) return '';
1407
+ return head('✗', L('Appels en échec', 'Failed calls'), n) + (sh.length ? `<ul>${sh.map((x) => { const bit = errBit(x.out); return row((x.call && x.call.name ? `<span class="pill">${esc(toolShort(x.call.name))}</span>` : '') + (x.call && x.call.d && x.call.d.note ? `<span class="rn">${esc(x.call.d.note)}</span>` : ''), clockOf(x.ts), callText(x.call), bit.length ? `<div class="ro">${bit.map((x) => `<div>${esc(x)}</div>`).join('')}</div>` : ''); }).join('')}</ul>` : '') + more(n - sh.length); }
1408
+ if (k === 'w') { const l = (S.wst.items && S.wst.items[id]) || [], sh = l.slice(-5).reverse(); if (!l.length) return '';
1409
+ return head('♻', L('Travail répété', 'Repeated work'), l.length) + `<ul>${sh.map((it) => { const [lab, sub] = wasteParts(it); return row(`<span class="rk">${esc(lab)}</span>`, clockOf(it.ts), sub); }).join('')}</ul>` + more(l.length - sh.length) + foot(L('Repéré dans la session elle-même, sans appel au modèle.', 'Spotted in the session itself, with no model call.')); }
1410
+ if (k === 'l') { const x = S.loops[id]; if (!x) return ''; const errs = x.kind === 'errors';
1411
+ return head('🔁', errs ? L('Échecs répétés', 'Repeated failures') : L('Même appel répété', 'Same call repeated'), '×' + x.n) + foot((errs ? L('{0} échecs d’affilée', '{0} failures in a row') : L('{0} fois d’affilée', '{0} times in a row')).replace('{0}', () => x.n) + (x.tool ? ' · ' + toolShort(x.tool) : '')); }
1412
+ if (k === 's') { const r = S.run[id]; if (!r) return ''; const c = S.callById && S.callById.get(r.id);
1413
+ return head('⏳', L('Commande longue', 'Long-running command'), r.ts ? fmtShort(Date.now() - r.ts) : '') + `<ul>${row(r.name ? `<span class="pill">${esc(toolShort(r.name))}</span>` : '', clockOf(r.ts), callText(c) || (c && c.d && c.d.note) || '')}</ul>`; }
1414
+ if (k === 'q') return S.lastAct[id] ? head('💤', L('Silencieux', 'Gone quiet'), '') + foot(L('Aucune activité depuis {0}.', 'No activity for {0}.').replace('{0}', () => fmtShort(Date.now() - S.lastAct[id]))) : '';
1415
+ return '';
1416
+ }
1417
+ function showTip(el) {
1418
+ const t = el.closest('.tile'), b = $('#btip'); if (!t) return; const id = t.id.slice(2), k = el.dataset.tip, h = tipHtml(k, id); if (!h) return hideTip();
1419
+ clearTimeout(BT.h); const was = b.classList.contains('on') && BT.el; BT.el = el; if (b.innerHTML !== h) b.innerHTML = h; b.className = 'k-' + k + (was ? ' on' : ''); placeTip(); if (!was) requestAnimationFrame(() => BT.el && b.classList.add('on'));
1420
+ }
1421
+ function placeTip() {
1422
+ const b = $('#btip'), r = BT.el.getBoundingClientRect(), w = b.offsetWidth, h = b.offsetHeight;
1423
+ let top = r.bottom + 8; if (top + h > innerHeight - 8 && r.top - h - 8 > 8) top = r.top - h - 8;
1424
+ b.style.left = Math.round(Math.max(8, Math.min(r.right - w, innerWidth - w - 8))) + 'px'; b.style.top = Math.round(Math.max(8, top)) + 'px';
1425
+ }
1426
+ function hideTip() { clearTimeout(BT.h); BT.el = null; $('#btip').classList.remove('on'); }
1427
+ function refreshTip() { const k = BT.el.dataset.tip, t = document.getElementById(BT.el._tile || ''), el = BT.el.isConnected ? BT.el : t && t.querySelector('.tbadge [data-tip="' + k + '"]'); if (el) { el._tile = BT.el._tile; showTip(el); } else hideTip(); } /* the badges were drawn again: follow the new one, or close */
1428
+ document.addEventListener('mouseover', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el) { el._tile = el.closest('.tile') && el.closest('.tile').id; showTip(el); } });
1429
+ document.addEventListener('mouseout', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el && !(e.relatedTarget && el.contains(e.relatedTarget))) { clearTimeout(BT.h); BT.h = setTimeout(hideTip, 120); } });
1430
+ document.addEventListener('click', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el) { e.stopPropagation(); e.preventDefault(); el._tile = el.closest('.tile') && el.closest('.tile').id; showTip(el); } else if (BT.el) hideTip(); }, true); /* a tap shows it on a touch screen, and does not open the agent */
1431
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && BT.el) hideTip(); }); addEventListener('resize', () => BT.el && hideTip()); addEventListener('scroll', () => BT.el && hideTip(), true);
1354
1432
  function tally(ev) { // numbers that pile up over a session: token usage, errors, last sign of life, the files it created
1355
1433
  noteFiles(ev);
1356
1434
  if (ev.kind === 'compact') { S.compacts[ev.agent] = (S.compacts[ev.agent] || 0) + 1; delete S.ctxWarned[ev.agent]; }
1357
- if (wasteStep(S.wst, ev)) later('badges', renderBadges, 300);
1435
+ noteCalls(ev); if (wasteStep(S.wst, ev)) later('badges', renderBadges, 300);
1358
1436
  const det = loopStep(S.rep, ev); if (det) { S.loops[ev.agent] = det; later('badges', renderBadges, 300); } else if (S.loops[ev.agent] && (ev.kind === 'results' ? (S.loops[ev.agent].kind === 'errors' && ev.items.every((it) => !it.err)) : (ev.kind === 'tools' && S.rep[ev.agent].n < 2))) { delete S.loops[ev.agent]; later('badges', renderBadges, 300); }
1359
1437
  if (ev.kind === 'usage') { const c = ev.u.i + ev.u.r + ev.u.w; if (c > 0 && ev.model !== '<synthetic>') { S.ctx[ev.agent] = c; S.model[ev.agent] = ev.model; if (ev.cw) S.cw[ev.agent] = ev.cw; } const u = (S.usage[ev.agent] = S.usage[ev.agent] || { i: 0, o: 0, r: 0, w: 0 }); u.i += ev.u.i; u.o += ev.u.o; u.r += ev.u.r; u.w += ev.u.w; later('tok', renderTokens, 300); } // which also redraws the context chips. Asking for those first, under the same name, left this one unasked: the counts on the tiles and in the header stood still during a live call
1360
1438
  else if (ev.kind === 'results') ev.items.forEach((it) => { if (it.err) { S.errs[ev.agent] = (S.errs[ev.agent] || 0) + 1; later('badges', renderBadges, 300); oops(ev.agent); noteTrouble(ev.agent, false); } else noteTrouble(ev.agent, true); });
@@ -1386,16 +1464,19 @@ function camTok() { // the one who shares a screen: what it has used so far, n
1386
1464
  // file edits are instant, so one that stays pending is almost surely an approval prompt; a Bash command may legitimately run long (⏳ badge instead)
1387
1465
  const NEEDS_OK = /^(Edit|Write|MultiEdit|NotebookEdit|AskUserQuestion|ExitPlanMode)/, ASKS = /^(AskUserQuestion|ExitPlanMode)/;
1388
1466
  const atTail = () => S.idx >= S.events.length - 3; // only trust wall-clock ages when playback has caught up with the live end
1467
+ function gaveOf(la) { // the turn of the followed session ended on "I couldn't…" or on an error (the server's gave): its first sentence, unless the session moved since that answer
1468
+ const row = S.live && atTail() ? rowOf(S.cur) : null; return row && row.state === 'turn' && row.gave && !(la > S.rowsAt) ? row.gave : '';
1469
+ }
1389
1470
  function agentState(id, now) {
1390
1471
  let s = S.status[id]; const r = S.run[id], w = S.waitOn[id], la = S.lastAct[id];
1391
- if (id === 'main' && S.live && atTail()) { const row = rowOf(S.cur); if (row && row.state === 'blocked' && row.since && !(la > S.rowsAt)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(Math.max(0, now - row.since)), ask: row.ask || '' }; } // what the server knows: a menu open in the session (a Bash approval looks like a running command here), and the question or command it waits on; unless the session moved since that answer. Before "your turn": a menu left open for longer than the lead's quiet time still needs you
1472
+ if (id === 'main' && S.live && atTail()) { const row = rowOf(S.cur); if (row && row.state === 'blocked' && row.since && !(la > S.rowsAt)) return { k: 'blocked', txt: '✋ ' + (row.sure ? L('vous attend ', 'needs you ') : L('attend vous ? ', 'needs you? ')) + fmtShort(Math.max(0, now - row.since)), ask: row.ask || '', sure: !!row.sure, since: row.since }; } // what the server knows: a menu open in the session (a Bash approval looks like a running command here), and the question or command it waits on; unless the session moved since that answer. Before "your turn": a menu left open for longer than the lead's quiet time still needs you
1392
1473
  if (id === 'main' && !s) { // the lead is at work until the message that closes its turn, even while it thinks, and from its first turn on (the server says which transcripts carry that mark); one without it falls back on "quiet for 25 s", and a turn cut short on 3 minutes of silence
1393
1474
  const open = S.live && la && (S.sawEnd ? !S.turnOver && now - la < 180000 : now - la < 25000);
1394
- if (r || (w && w.size) || open) s = 'working'; else if (S.live && la) return { k: 'done', txt: '✓ ' + L('à vous', 'your turn') + ' · ' + fmtShort(Math.max(0, now - la)) };
1475
+ if (r || (w && w.size) || open) s = 'working'; else if (S.live && la) { const g = gaveOf(la); return { k: 'done', txt: (g ? '⚠ ' + L('a abandonné ?', 'gave up?') : '✓ ' + L('à vous', 'your turn')) + ' · ' + fmtShort(Math.max(0, now - la)), ...(g ? { gave: g } : {}) }; }
1395
1476
  }
1396
1477
  if (s === 'done') return { k: 'done', txt: '✓ ' + L('terminé', 'done') };
1397
1478
  if (!s) return { k: 'idle', txt: '' };
1398
- if (S.live && atTail() && r && r.ts && r.name && NEEDS_OK.test(r.name)) { const age = now - r.ts; if (age > (ASKS.test(r.name) ? 4000 : 15000)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(age) }; }
1479
+ if (S.live && atTail() && r && r.ts && r.name && NEEDS_OK.test(r.name)) { const age = now - r.ts; if (age > (ASKS.test(r.name) ? 4000 : 15000)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(age), since: r.ts }; }
1399
1480
  if (w && w.size) { // really waiting only while the lead has a sub-agent call pending, or while those agents are still active (background agents never block the lead)
1400
1481
  const pendingSub = r && /^(Task|Agent)$/.test(r.name), open = [...w].filter((c) => S.status[c] !== 'done' && (pendingSub || !S.live || now - Math.max(S.lastAct[c] || 0, S.orderTs[c] || 0) < 120000));
1401
1482
  if (open.length) {
@@ -1407,12 +1488,13 @@ function agentState(id, now) {
1407
1488
  }
1408
1489
  const STATE_CLASSES = ['working', 'waiting', 'blocked', 'stalled', 'done'];
1409
1490
  // The menu the followed session waits on, in the lead's words, word for word: the questions and their options numbered as in the menu, the command, the file, the plan.
1410
- // It stays until the menu is answered (where Claude Code runs: nothing is answered from here); ✕ puts it away until the next one.
1491
+ // It stays until the menu is answered (where Claude Code runs: nothing is answered from here); ✕ puts it away until the next one. Off unless ⚙ → All settings turns it on: the header, the card and the board already say a menu waits.
1411
1492
  const ASKC = { off: '' };
1412
1493
  function askHtml(m, p) {
1413
1494
  const who = esc(p.name), pre = (x) => (x ? '<pre>' + esc(x) + '</pre>' : ''); let head, body = '';
1414
1495
  if (m.kind === 'question') { head = '💬 ' + who + ' ' + (m.questions.length > 1 ? L('vous pose plusieurs questions', 'has several questions for you') : L('vous pose une question', 'has a question for you'));
1415
- body = m.questions.map((q) => '<div class="aq">' + esc(q.q) + ' <span class="ahow">' + (q.multi ? L('(un ou plusieurs choix)', '(one or more)') : L('(un seul choix)', '(pick one)')) + '</span></div>' + (q.options.length ? '<ol>' + q.options.map((o) => '<li>' + esc(o.label) + (o.about ? ' <span>— ' + esc(o.about) + '</span>' : '') + '</li>').join('') + '</ol>' : '')).join(''); }
1496
+ body = m.questions.map((q, k, all) => '<div class="aqs' + (q.multi ? ' multi' : '') + '"><div class="aqh">' + (all.length > 1 ? '<span class="anum">' + (k + 1) + '/' + all.length + '</span>' : '') + (q.head ? '<b class="atag">' + esc(q.head) + '</b>' : '') + '<span>' + (q.multi ? L('un ou plusieurs choix', 'one or more') : L('un seul choix', 'pick one')) + '</span></div><p class="aq">' + esc(q.q) + '</p>'
1497
+ + (q.options.length ? '<ol class="aops">' + q.options.map((o, j) => '<li><i>' + (j + 1) + '</i><div><b>' + esc(o.label) + '</b>' + (o.about ? '<span>' + esc(o.about) + '</span>' : '') + '</div></li>').join('') + '</ol>' : '') + '</div>').join(''); } // each question apart: its number, the short label Claude Code gives it, then each option on its own row with what it means under it
1416
1498
  else if (m.kind === 'plan') { head = '📋 ' + who + ' ' + L('vous propose ce plan', 'proposes this plan'); body = pre(m.text); }
1417
1499
  else if (m.kind === 'command') { head = '🔐 ' + who + ' ' + (m.sure ? L('demande à lancer cette commande', 'asks to run this command') : L('attend peut-être votre feu vert pour cette commande', 'may be waiting for your go-ahead on this command')); body = (m.about ? '<div class="aab">' + esc(m.about) + '</div>' : '') + pre(m.cmd); }
1418
1500
  else if (m.kind === 'edit') { head = '🔐 ' + who + ' ' + (m.sure ? L('demande à modifier ce fichier', 'asks to edit this file') : L('attend peut-être votre feu vert pour modifier ce fichier', 'may be waiting for your go-ahead to edit this file')); body = pre(m.file); }
@@ -1420,11 +1502,11 @@ function askHtml(m, p) {
1420
1502
  else if (m.kind === 'fetch') { head = '🔐 ' + who + ' ' + L('demande à ouvrir cette page', 'asks to open this page'); body = pre(m.url); }
1421
1503
  else { head = '🔐 ' + who + ' ' + L('demande la permission d\'utiliser', 'asks permission to use') + ' ' + esc(m.tool || ''); }
1422
1504
  const foot = L('À répondre dans Claude Code', 'Answer it in Claude Code') + (m.kind === 'question' ? ' · ' + L('les numéros sont ceux du menu', 'the numbers match the menu') : '');
1423
- return '<div class="awho">' + avatarSVG(p, undefined, 'ak' + p.gid + '_') + '</div><div class="asay"><button class="ax" aria-label="' + esc(L('Masquer jusqu\'à la prochaine question', 'Hide until the next question')) + '">✕</button><small>' + head + ' · <span class="ak-t"></span></small>' + body + '<div class="afoot">' + foot + '</div></div>';
1505
+ return '<div class="awho">' + avatarSVG(p, undefined, 'ak' + p.gid + '_') + '</div><div class="asay"><div class="ahd"><span>' + head + '</span><span class="ak-t"></span><button class="ax" aria-label="' + esc(L('Masquer jusqu\'à la prochaine question', 'Hide until the next question')) + '">✕</button></div>' + (body ? '<div class="abody">' + body + '</div>' : '') + '<div class="afoot">' + foot + '</div></div>';
1424
1506
  }
1425
1507
  function paintAsk(now) {
1426
1508
  const el = $('#askc'); if (!el) return; let row = null; try { row = rowOf(S.cur); } catch {}
1427
- const m = row && row.menu, p = S.agents.main, show = !!(m && p && S.live && !S.demo && ASKC.off !== m.id && agentState('main', now).k === 'blocked');
1509
+ const m = row && row.menu, p = S.agents.main, show = !!(prefs.askCard && m && p && S.live && !S.demo && ASKC.off !== m.id && agentState('main', now).k === 'blocked');
1428
1510
  if (!show) { if (el.dataset.k) { el.className = ''; el.innerHTML = ''; el.dataset.k = ''; } return; }
1429
1511
  if (el.dataset.k !== m.id) { el.dataset.k = m.id; el.className = 'on'; el.setAttribute('aria-label', L('Ce que la session attend de vous', 'What the session is waiting for from you')); el.innerHTML = askHtml(m, p); } // built once per menu, so it is announced once
1430
1512
  const t = el.querySelector('.ak-t'); if (t) t.textContent = fmtShort(Math.max(0, now - (row.since || now)));
@@ -1436,8 +1518,9 @@ function paintStates() {
1436
1518
  if (p.id === 'user') continue; const t = $('#t-' + p.id); if (!t) continue;
1437
1519
  const st = agentState(p.id, now), shown = t.style.display !== 'none'; if (shown && n[st.k] !== undefined && !S.gone.has(p.id)) { n[st.k]++; if (st.k === 'blocked' || st.k === 'stalled') attn.push(p.id); }
1438
1520
  STATE_CLASSES.forEach((c) => t.classList.toggle(c, st.k === c));
1439
- const el = t.querySelector('.status'); if (el.textContent !== st.txt) el.textContent = st.txt; el.className = 'status ' + st.k + (isTurn(p.id, st) ? ' turn' : '');
1521
+ const el = t.querySelector('.status'); if (el.textContent !== st.txt) { el.textContent = st.txt; const tb = t.querySelector('.tbadge'); if (tb) tb.style.top = el.offsetHeight > 26 ? el.offsetTop + el.offsetHeight + 4 + 'px' : ''; } /* a status on two lines: the badges under it move down */ el.className = 'status ' + st.k + (isTurn(p.id, st) ? ' turn' : '') + (st.gave ? ' gave' : '');
1440
1522
  const pr = t.querySelector('.prop'), want = { blocked: '✋', stalled: '😰', waiting: '⌛' }[st.k] || '', was = S.prevState[p.id]; // a raised hand, a sweat drop, an hourglass: the call metaphor for "needs you / stuck / waiting"
1523
+ const spot = S.spotted || (S.spotted = new Set()); if (st.k !== 'blocked') spot.delete(p.id); else if (!spot.has(p.id) && shown && !S.gone.has(p.id) && !S.speakers.size && !(S.focusLock > Date.now())) { spot.add(p.id); setFocus(p.id); } // one that waits on you takes the spotlight once per wait, as soon as nobody talks (the speaker has it until then)
1441
1524
  if (st.k === 'done' && was && was !== 'done' && was !== 'idle') { pr.textContent = '🎉'; pr.className = 'prop cheer'; setTimeout(() => { if (pr.classList.contains('cheer')) { pr.textContent = ''; pr.className = 'prop'; } }, 1200); }
1442
1525
  else if (!pr.classList.contains('cheer')) { if (pr.textContent !== want) pr.textContent = want; pr.className = 'prop ' + (want ? st.k : ''); }
1443
1526
  if (shown && !S.gone.has(p.id)) ros.push({ p, st });
@@ -1446,9 +1529,9 @@ function paintStates() {
1446
1529
  S.prevState[p.id] = st.k; const tip = `${p.name} — ${p.role}${st.txt ? '\n' + st.txt : ''}${S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''}`; if (t.title !== tip) t.title = tip;
1447
1530
  }
1448
1531
  paintPill();
1449
- const b = $('#board'), parts = [['working', '⚙', L('au travail', 'working')], ['waiting', '🔗', L('en attente', 'waiting')], ['blocked', '✋', L('vous attendent', 'need you')], ['stalled', '⚠', L('bloqués', 'stalled')], ['done', '✓', L('terminés', 'done')]]
1532
+ const b = $('#board'), parts = [['working', '⚙', L('au travail', 'working')], ['waiting', '🔗', L('attendent leurs sous-agents', 'on sub-agents')], ['blocked', '✋', L('vous attendent', 'need you')], ['stalled', '⚠', L('bloqués', 'stalled')], ['done', '✓', L('terminés', 'done')]]
1450
1533
  .filter(([k]) => n[k] && !S.pillSess).map(([k, i, l]) => `<span class="${k}" title="${n[k]} ${l}">${i} ${n[k]}<em> ${l}</em></span>`).join('');
1451
- if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); paintAsk(now); return n;
1534
+ if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); paintAsk(now); paintAttn(now); return n;
1452
1535
  }
1453
1536
  function fitBoard(force) { // the chips lose their words when they do not all fit (a long language, a narrower window): a chip is never cut mid-word. Tried again with the words only when the window or the texts around have changed
1454
1537
  const b = $('#board'), key = innerWidth + '|' + b.textContent.length + '|' + $('#pill').textContent.length + '|' + $('#subtitle').textContent.length;
@@ -1458,14 +1541,14 @@ function fitBoard(force) { // the chips lose their words when they do not all
1458
1541
  addEventListener('resize', () => fitBoard(true)); new ResizeObserver(() => requestAnimationFrame(() => fitBoard(true))).observe($('#board')); /* the room the chips have also changes when the texts beside them do (a title, a longer status) */
1459
1542
  const RORDER = { blocked: 0, stalled: 1, working: 2, waiting: 3, idle: 4, done: 5 };
1460
1543
  const TOOL = { _codex: 'Codex', _vibe: 'Vibe', _cowork: 'Cowork' }, leadTool = (p) => (p.id === 'main' && S.cur && TOOL[S.cur.proj] ? ' · ' + TOOL[S.cur.proj] : ''); // a session that is not a Claude Code one says which tool runs it: on its tab, and next to its lead, who has the same name in every call
1461
- const modelShort = (m) => { const v = String(m || ''); if (!v || v[0] === '<') return ''; const c = /(opus|sonnet|haiku|fable)[-_ ]?(\d{1,2})(?:[-.](\d{1,2})(?!\d))?(?!\d)/i.exec(v); const o = /claude-(\d)(?:-(\d))?-(opus|sonnet|haiku)/i.exec(v), cap = (w) => w[0].toUpperCase() + w.slice(1).toLowerCase(); if (o) return cap(o[3]) + ' ' + o[1] + (o[2] ? '.' + o[2] : ''); return c ? cap(c[1]) + ' ' + c[2] + (c[3] ? '.' + c[3] : '') : v.replace(/^.*\//, '').replace(/-\d{8}$/, '').slice(0, 24); }; /* older ids put the version first: claude-3-5-sonnet → Sonnet 3.5 */ // claude-haiku-4-5-20251001 → Haiku 4.5
1544
+ const modelShort = (m) => { const v = String(m || ''); if (!v || v[0] === '<') return ''; const c = /(opus|sonnet|haiku|fable)[-_ ]?(\d{1,2})(?:[-.](\d{1,2})(?!\d))?(?!\d)/i.exec(v); const o = /claude-(\d)(?:-(\d))?-(opus|sonnet|haiku)/i.exec(v), cap = (w) => w[0].toUpperCase() + w.slice(1).toLowerCase(); if (o) return cap(o[3]) + ' ' + o[1] + (o[2] ? '.' + o[2] : ''); const g = /^gpt-(\d+(?:\.\d+)?[a-z]?)(?:-(.+))?$/i.exec(v.replace(/^.*\//, '').replace(/-\d{4}-?\d{2}-?\d{2}$/, '')); if (g) return ('GPT-' + g[1].toLowerCase() + (g[2] ? ' ' + g[2].split('-').map((w) => (/^(mini|nano)$/i.test(w) ? w.toLowerCase() : cap(w))).join(' ') : '')).slice(0, 24); /* Codex: gpt-6-pro → GPT-6 Pro, gpt-5.1-codex-max → GPT-5.1 Codex Max, gpt-5-mini → GPT-5 mini */ return c ? cap(c[1]) + ' ' + c[2] + (c[3] ? '.' + c[3] : '') : v.replace(/^.*\//, '').replace(/-\d{8}$/, '').slice(0, 24); }; /* older ids put the version first: claude-3-5-sonnet → Sonnet 3.5 */ // claude-haiku-4-5-20251001 → Haiku 4.5
1462
1545
  const mixedModels = () => new Set(Object.keys(S.usage).filter((id) => S.agents[id] && S.model[id] && tokTotal(S.usage[id])).map((id) => modelShort(S.model[id])).filter(Boolean)).size > 1; // only then is the model worth a place next to the count
1463
1546
  const modelTip = (id) => (S.model[id] && modelShort(S.model[id]) ? '\n' + L('Modèle', 'Model') + ' · ' + S.model[id] : '');
1464
1547
  const rosTok = (id) => { const u = S.usage[id]; return u && tokTotal(u) ? `<span class="rt" title="${esc(tokTip(u) + modelTip(id))}">⚡${fmtTok(tokTotal(u))}${mixedModels() && modelShort(S.model[id]) ? ' · ' + esc(modelShort(S.model[id])) : ''}</span>` : ''; };
1465
1548
  function paintRoster(ros) { // a fixed list beside the call: who is doing what, urgent first, readable even with dozens of agents
1466
1549
  const box = $('#roster'); if (!box || !document.body.classList.contains('rost')) return;
1467
1550
  ros.sort((a, b) => (a.p.id === 'main' ? -1 : b.p.id === 'main' ? 1 : (RORDER[a.st.k] - RORDER[b.st.k]) || (S.lastAct[b.p.id] || 0) - (S.lastAct[a.p.id] || 0)));
1468
- const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
1551
+ const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${st.gave ? ' gave' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}" title="${esc(p.name + ' — ' + p.role + leadTool(p) + (st.txt ? '\n' + st.txt : '') + (S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''))}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
1469
1552
  const left = Object.values(S.agents).filter((p) => S.gone.has(p.id) && p.id !== 'main' && p.id !== 'user').sort((a, b) => (S.lastAct[b.id] || 0) - (S.lastAct[a.id] || 0)); // a finished agent's tile leaves the stage: its line stays here, with what it used
1470
1553
  const gone = left.slice(0, 40).map((p) => `<div class="rr left" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role)}</span>${rosTok(p.id)}</div></div>`).join('');
1471
1554
  const html = `<h3>${L('Agents', 'Agents')} · ${ros.length}</h3>${rows}${ros.length > 60 ? `<div class="ro" style="padding:4px 8px">+${ros.length - 60}</div>` : ''}${left.length ? `<h3 style="margin-top:8px">${L('terminés', 'done')} · ${left.length}</h3>${gone}` : ''}`;
@@ -1478,16 +1561,17 @@ function renderBadges() { // per tile: failed tool calls, a command that has b
1478
1561
  const now = Date.now();
1479
1562
  for (const id in S.agents) {
1480
1563
  const t = $('#t-' + id); if (!t) continue; const b = t.querySelector('.tbadge'), parts = []; let slow = false, quiet = false;
1481
- if (S.errs[id]) parts.push(`<span class="e">✗ ${S.errs[id]}</span>`);
1482
- const ws = S.wst.items && S.wst.items[id]; if (ws && ws.length) parts.push(`<span class="w" title="${esc(L('Travail répété', 'Repeated work') + '\n' + ws.slice(-12).map(wasteLine).join('\n'))}">♻ ${ws.length}</span>`);
1483
- if (S.loops[id]) parts.push(`<span class="l" title="${esc(S.loops[id].kind === 'errors' ? L('Échecs répétés', 'Repeated failures') : L('Même appel répété', 'Same call repeated'))}">🔁 ×${S.loops[id].n}</span>`);
1564
+ if (S.errs[id]) parts.push(`<span class="e" title="" data-tip="e">✗ ${S.errs[id]}</span>`);
1565
+ const ws = S.wst.items && S.wst.items[id]; if (ws && ws.length) parts.push(`<span class="w" title="" data-tip="w">♻ ${ws.length}</span>`);
1566
+ if (S.loops[id]) parts.push(`<span class="l" title="" data-tip="l">🔁 ×${S.loops[id].n}</span>`);
1484
1567
  if (S.live && S.status[id] === 'working') {
1485
1568
  const r = S.run[id];
1486
- if (r && r.ts && atTail() && now - r.ts > 60000) { slow = true; parts.push(`<span class="s">⏳ ${fmtShort(now - r.ts)}</span>`); }
1487
- else if (!r && S.lastAct[id] && now - S.lastAct[id] > 180000) { quiet = true; parts.push(`<span class="q">💤 ${fmtShort(now - S.lastAct[id])}</span>`); }
1569
+ if (r && r.ts && atTail() && now - r.ts > 60000) { slow = true; parts.push(`<span class="s" title="" data-tip="s">⏳ ${fmtShort(now - r.ts)}</span>`); }
1570
+ else if (!r && S.lastAct[id] && now - S.lastAct[id] > 180000) { quiet = true; parts.push(`<span class="q" title="" data-tip="q">💤 ${fmtShort(now - S.lastAct[id])}</span>`); }
1488
1571
  }
1489
1572
  t.classList.toggle('slow', slow); t.classList.toggle('quiet', quiet); const h = parts.join(''); if (b.innerHTML !== h) b.innerHTML = h;
1490
1573
  }
1574
+ if (BT && BT.el) refreshTip();
1491
1575
  }
1492
1576
  const fmtShort = (ms) => { const s = Math.round(ms / 1000); return s < 90 ? `${s}s` : `${Math.round(s / 60)} min`; };
1493
1577
  function askNotify() { try { if (!EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} AUD.init(); AUD.alert(); }
@@ -1998,7 +2082,7 @@ const coffeeMsg = () => L('Ce développeur a été remplacé par ses propres age
1998
2082
  function openExternal(url) { if (EMBED) window.parent.postMessage({ agentStandup: 'openExternal', url }, '*'); else window.open(url, '_blank', 'noopener'); } // VS Code webviews must ask the extension
1999
2083
  function renderCoffee() {
2000
2084
  const on = !!SUPPORT.url, b = $('#mCoffee'); b.style.display = on ? '' : 'none'; $('#mCoffeeT').textContent = L('☕ Offrir un café au développeur', '☕ Buy the (replaced) dev a coffee'); b.title = coffeeMsg();
2001
- const h = $('#bCoffee'); h.style.display = on ? '' : 'none'; h.title = coffeeMsg(); h.setAttribute('aria-label', coffeeMsg());
2085
+ const h = $('#bCoffee'); h.style.display = on && !firstDay() ? '' : 'none'; /* the gold cup in the header: not on the first day, which is for the call */ h.title = coffeeMsg(); h.setAttribute('aria-label', coffeeMsg());
2002
2086
  $('#mRateT').textContent = APP.kind === 'editor' ? L('⭐ Noter Agent Standup', '⭐ Rate Agent Standup') : L('⭐ Une étoile pour Agent Standup sur GitHub', '⭐ Star Agent Standup on GitHub');
2003
2087
  }
2004
2088
  $('#bCoffee').onclick = () => openExternal(SUPPORT.url);
@@ -2009,18 +2093,22 @@ $('#mCoffee').onclick = () => { $('#menu').classList.remove('on'); openExternal(
2009
2093
  $('#mRate').onclick = () => { $('#menu').classList.remove('on'); rateGo(); };
2010
2094
  function rateGo() { rateEnd(); if (EMBED && APP.kind === 'editor') window.parent.postMessage({ agentStandup: 'rate' }, '*'); else openExternal(APP.rate); }
2011
2095
  const rateEnd = () => { prefs.rateDone = utcDay(); savePrefs(); $('#rateTip').style.display = 'none'; };
2012
- const RATE_ASKS = (APP.kind === 'desktop' || APP.kind === 'cli') && !EMBED && !Q.get('demo'), utcDay = () => new Date().toISOString().slice(0, 10);
2096
+ const RATE_ASKS = (APP.kind === 'desktop' || APP.kind === 'cli' || APP.kind === 'plugin') && !EMBED && !Q.get('demo'), utcDay = () => new Date().toISOString().slice(0, 10);
2097
+ // One ask a day at most, and none the first day the call is in view (prefs.firstDay): the star, the coffee and the pack each wait for a day nothing else was asked (prefs.askDay, and which one in askWhat, so the same ask can show again that day).
2098
+ // The real voices are not an ask but an offer of the app itself: they keep their line until answered, and step aside on the few days the Halloween pack's line shows (not while they download).
2099
+ const firstDay = () => !prefs.firstDay || prefs.firstDay >= utcDay(), askedToday = (k) => prefs.askDay === utcDay() && prefs.askWhat !== k;
2100
+ const noteAsk = (k) => { if (prefs.askDay !== utcDay() || prefs.askWhat !== k) { prefs.askDay = utcDay(); prefs.askWhat = k; savePrefs(); } };
2013
2101
  function rateDay() { // a day of use: the page in view that day
2014
2102
  if (!RATE_ASKS || prefs.rateDone || document.hidden) return;
2015
2103
  const day = utcDay(); if (prefs.rateLast !== day) { prefs.rateLast = day; prefs.rateDays = (+prefs.rateDays || 0) + 1; savePrefs(); }
2016
2104
  rateTip();
2017
2105
  }
2018
2106
  function rateTip() {
2019
- const t = $('#rateTip'); if (!RATE_ASKS || prefs.rateDone || (+prefs.rateDays || 0) < 3 || (prefs.rateLater && utcDay() < prefs.rateLater) || $('#menuTip').style.display !== 'none' || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; }
2107
+ const t = $('#rateTip'); if (!RATE_ASKS || prefs.rateDone || firstDay() || askedToday('rate') || (+prefs.rateDays || 0) < 3 || (prefs.rateLater && utcDay() < prefs.rateLater) || $('#menuTip').style.display !== 'none' || $('#usageTip').style.display !== 'none' || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; }
2020
2108
  const r = $('#bMenu').getBoundingClientRect(); if (!r.width) return;
2021
2109
  $('#rateTipT').textContent = L('Agent Standup vous plaît ? Une étoile sur GitHub aide d’autres personnes à le trouver.', 'Enjoying Agent Standup? A star on GitHub helps other people find it.');
2022
2110
  $('#rateYes').textContent = L('⭐ Mettre une étoile', '⭐ Star it'); $('#rateLater').textContent = L('Plus tard', 'Later'); $('#rateNo').textContent = L('Non merci', 'No thanks');
2023
- rateTip.seen = utcDay(); t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
2111
+ rateTip.seen = utcDay(); noteAsk('rate'); t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
2024
2112
  }
2025
2113
  $('#rateYes').onclick = rateGo; $('#rateNo').onclick = rateEnd;
2026
2114
  $('#rateLater').onclick = () => { if (prefs.rateLater) return rateEnd(); prefs.rateLater = new Date(Date.parse(utcDay()) + 7 * 864e5).toISOString().slice(0, 10); savePrefs(); $('#rateTip').style.display = 'none'; };
@@ -2029,15 +2117,15 @@ document.addEventListener('visibilitychange', rateDay); setInterval(rateDay, 360
2029
2117
  // Never twice ("No thanks", the coffee or nothing at all end it), never the day the star is asked, never in a demo. The days are kept in the settings file; nothing is sent.
2030
2118
  function coffeeDay() { if (document.hidden || !SUPPORT.url || prefs.coffeeAsked || prefs.useFirst) return; prefs.useFirst = utcDay(); savePrefs(); } /* one write, ever: the first day the call is in view (a window left open overnight must not write its old settings over newer ones) */
2031
2119
  function coffeeAsk(busyAt) {
2032
- if (!SUPPORT.url || prefs.coffeeAsked || Q.get('demo') || !prefs.useFirst || prefs.useFirst >= utcDay() || document.hidden) return;
2120
+ if (!SUPPORT.url || prefs.coffeeAsked || Q.get('demo') || firstDay() || askedToday('coffee') || !prefs.useFirst || prefs.useFirst >= utcDay() || document.hidden) return;
2033
2121
  const now = Date.now(), team = Object.keys(S.agents).filter((id) => id !== 'main' && id !== 'user' && S.lastAct[id] >= busyAt).length;
2034
2122
  if (!(now - busyAt >= 10 * 60e3 || (team >= 3 && now - busyAt >= 2 * 60e3))) return;
2035
- if ($('#rateTip').style.display !== 'none' || rateTip.seen === utcDay() || prefs.rateDone === utcDay() || (RATE_ASKS && !prefs.rateDone && prefs.rateLast === utcDay() && (+prefs.rateDays || 0) >= 3)) return; /* the star shown, given or declined today */
2123
+ if ($('#rateTip').style.display !== 'none' || $('#usageTip').style.display !== 'none' || rateTip.seen === utcDay() || prefs.rateDone === utcDay() || (RATE_ASKS && !prefs.rateDone && prefs.rateLast === utcDay() && (+prefs.rateDays || 0) >= 3)) return; /* the star shown, given or declined today */
2036
2124
  clearTimeout(coffeeAsk.t); coffeeAsk.t = setTimeout(() => { if (prefs.coffeeAsked || document.hidden || $('#menu').classList.contains('on') || $('#menuTip').style.display !== 'none' || $('#rateTip').style.display !== 'none' || agentState('main', Date.now()).k !== 'done') return; coffeeTip(); }, 8000); /* after the confetti and the lead's last word */
2037
2125
  }
2038
2126
  function coffeeTip() {
2039
2127
  const at = [$('#bCoffee'), $('#bMenu')].find((b) => b.getBoundingClientRect().width), t = $('#coffeeTip'); if (!at) return;
2040
- prefs.coffeeAsked = utcDay(); savePrefs(); const r = at.getBoundingClientRect();
2128
+ prefs.coffeeAsked = utcDay(); noteAsk('coffee'); savePrefs(); const r = at.getBoundingClientRect();
2041
2129
  $('#coffeeTipT').textContent = L('{0} et l’équipe ont fini. Si l’appel vous a aidé à suivre ce long travail, un café aide Agent Standup à continuer. (On ne le demande qu’une fois.)', '{0} and the team are done. If the call helped you follow this long run, a coffee keeps Agent Standup going. (We only ask once.)').replace('{0}', () => nameOf('main'));
2042
2130
  $('#coffeeYes').textContent = L('☕ Offrir un café', '☕ Buy a coffee'); $('#coffeeNo').textContent = L('Non merci', 'No thanks');
2043
2131
  t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
@@ -2045,6 +2133,29 @@ function coffeeTip() {
2045
2133
  }
2046
2134
  $('#coffeeYes').onclick = () => { $('#coffeeTip').style.display = 'none'; openExternal(SUPPORT.url); }; $('#coffeeNo').onclick = () => ($('#coffeeTip').style.display = 'none');
2047
2135
  document.addEventListener('visibilitychange', coffeeDay); setInterval(coffeeDay, 3600e3);
2136
+ // Usage, asked once in the desktop app, the command line and the Claude Code plugin (the editor asks in its own way: extension.js, askUsage): would they help count how many people use
2137
+ // it? "Count me in" turns prefs.shareUsage on; then, each time the call is opened, the server sends at most one empty request a week (server.js, usageWeek). Any other answer leaves it
2138
+ // off and it is not asked again; ⚙ › All settings turns it on or off. Never asked, and nothing sent, with DO_NOT_TRACK set (APP.track), in a demo or embedded.
2139
+ const USAGE_ASKS = ['desktop', 'cli', 'plugin'].includes(APP.kind) && APP.track !== false && !EMBED && !Q.get('demo');
2140
+ function usageOpened(fresh) { if (USAGE_ASKS && prefs.shareUsage === true && !document.hidden) (fresh ? fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(prefs) }) : Promise.resolve()).then(() => fetch('/api/usage', { method: 'POST' })).catch(() => {}); } /* the server sends it once a week at most, and only once the settings file says yes: fresh, just answered, writes it there first (savePrefs waits 400 ms) */
2141
+ function usagePending() { return USAGE_ASKS && !prefs.usageAsked && prefs.shareUsage !== true; } // the usage question, not answered yet: it has its first day to itself, then takes turns with the Halloween pack's line
2142
+ function usageStart() {
2143
+ if (!USAGE_ASKS) return; $('#mShare').style.display = ''; usageOpened();
2144
+ if (prefs.usageAsked || prefs.shareUsage === true) return; clearTimeout(usageStart.t); usageStart.t = setTimeout(usageTip, 2500);
2145
+ }
2146
+ function usageTip() {
2147
+ const t = $('#usageTip'); if (!USAGE_ASKS || prefs.usageAsked || prefs.shareUsage === true || firstDay() || document.hidden || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; } /* firstDay: like every ask, not the first day the app is used */
2148
+ if ($('#menuTip').style.display !== 'none') { usageStart.t = setTimeout(usageTip, 4000); return; } /* after the tip about the moved menu */
2149
+ if (prefs.askDay === utcDay() && prefs.askWhat === 'pack') { t.style.display = 'none'; return; } /* the Halloween pack's day: one ask at a time, this one comes back on the next */
2150
+ const r = $('#bMenu').getBoundingClientRect(); if (!r.width) return;
2151
+ $('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; noteAsk('usage'); if (!prefs.usageDay) { prefs.usageDay = utcDay(); savePrefs(); }
2152
+ $('#usageTipT').textContent = L('Aider à compter combien de personnes utilisent Agent Standup ? Quand vous ouvrez l’appel, au plus une fois par semaine, l’app chargerait un fichier vide d’un pixel sur GitHub : aucun identifiant, rien sur vous ni sur vos sessions. GitHub voit votre adresse IP, comme pour tout téléchargement. Vous pouvez l’arrêter quand vous voulez dans ⚙ › Tous les réglages.', 'Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.');
2153
+ $('#usageYes').textContent = L('Je participe', 'Count me in'); $('#usageNo').textContent = L('Non merci', 'No thanks'); $('#usageRead').textContent = L('Confidentialité', 'Privacy policy');
2154
+ t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
2155
+ }
2156
+ const usageAnswer = (yes) => { prefs.shareUsage = yes; prefs.usageAsked = true; savePrefs(); $('#usageTip').style.display = 'none'; syncSwitches(); document.querySelectorAll('.mi[data-t="shareUsage"] .sw').forEach((x) => x.classList.toggle('on', yes)); if (yes) usageOpened(true); };
2157
+ $('#usageYes').onclick = () => usageAnswer(true); $('#usageNo').onclick = () => usageAnswer(false); $('#usageRead').onclick = () => openExternal('https://agent-standup.com/privacy/');
2158
+ document.addEventListener('visibilitychange', () => { if (!document.hidden) { usageOpened(); if (USAGE_ASKS && !prefs.usageAsked && prefs.shareUsage !== true && $('#usageTip').style.display === 'none') usageStart(); } });
2048
2159
 
2049
2160
  // =====================================================================
2050
2161
  // recap
@@ -2494,7 +2605,7 @@ async function followCurrent() {
2494
2605
  const cur = await (await fetch('/api/current?proj=' + enc(watch) + (at ? '&pproj=' + enc(at.proj || watch) + '&pid=' + enc(at.id) + (at.since != null ? '&since=' + at.since : '') + (at.pin ? '&pin=1' : '') : '') + (S.cur ? '&sproj=' + enc(S.cur.proj) + '&sid=' + enc(S.cur.id) : ''))).json();
2495
2606
  if (S.pick !== at) return false; // asked before a click or a tab sent the call elsewhere: the answer to act on is the one asked since. This one undid the click
2496
2607
  if (!cur.pick) { S.pick = null; S.wide = !!cur.wide; } else if (at.since == null) at.since = cur.asked || 0; /* not kept there any more: you typed somewhere since, or that session is gone · wide: the folder the call follows has no session, the server looked everywhere, and so do the tabs (inWatch). An answer about a session you went to says nothing of that folder · since: the latest order there was when you went there, which a later one is told from */
2497
- if (!cur.id) { $('#empty').classList.add('on'); return false; } $('#empty').classList.remove('on');
2608
+ if (!cur.id) { $('#empty').classList.add('on'); return false; } $('#empty').classList.remove('on'); if (S.why !== (cur.why || '')) { S.why = cur.why || ''; paintTabs(); } // why the call is in this session: said at the end of the row of tabs
2498
2609
  if (S.cur && S.cur.id === cur.id && S.cur.proj === cur.proj) return false;
2499
2610
  const key = cur.proj + '/' + cur.id, was = S.lastKey, moved = !!was && was !== key && !S.locked; if (moved) S.left[was] = Date.now(); // what was said of the session the call leaves is not said again when it comes back to it
2500
2611
  if (!(await loadSession(cur.proj, cur.id))) return false;
@@ -2571,20 +2682,25 @@ const BSTATE = { blocked: ['✋', 'needs you?', 'attend vous ?'], working: ['⚙
2571
2682
  const BORDER = ['blocked', 'working', 'waiting', 'turn', 'idle'];
2572
2683
  const agoStr = (ms) => (ms < 90e3 ? Math.max(1, Math.round(ms / 1000)) + 's' : ms < 5400e3 ? Math.round(ms / 60e3) + ' min' : Math.round(ms / 3600e3) + ' h');
2573
2684
  const BGROUP = ['blocked', 'turn', 'working', 'waiting', 'idle']; // the board is in sections, what waits for you first
2574
- let boardBusy = false, boardAll = null, boardDoneOpen = false;
2685
+ let boardBusy = false, boardAll = null, boardDoneOpen = false, boardIdleOpen = false;
2686
+ const BTOOLS = [['claude', 'Claude Code'], ['_codex', 'Codex'], ['_vibe', 'Mistral Vibe'], ['_cowork', 'Cowork']], toolOf = (r) => (BTOOLS.some(([k]) => k === r.proj) ? r.proj : 'claude'); // the filter at the top of the board, shown when sessions of two tools or more are listed
2575
2687
  const isDone = (r) => !!r.done; // put away by you, until the session moves again: the server says so, to every window
2576
2688
  function bcard(r, now, done) {
2577
- const [ic, en, fr] = BSTATE[r.state], waited = r.since ? now - r.since : r.state === 'blocked' ? r.ageMs : now - r.mtime, mine = r.state === 'blocked' || r.state === 'turn'; // how long it has waited on you
2689
+ const g = r.state === 'turn' && r.gave ? r.gave : '', [ic, en0, fr0] = g ? ['⚠', 'gave up?', 'a abandonné ?'] : BSTATE[r.state], [en, fr] = r.state === 'blocked' && r.sure ? ['needs you', 'vous attend'] : [en0, fr0], waited = r.since ? now - r.since : r.state === 'blocked' ? r.ageMs : now - r.mtime, mine = r.state === 'blocked' || r.state === 'turn'; // how long it has waited on you
2578
2690
  const head = r.state === 'blocked' ? [r.ask ? '' : esc(r.tool), r.ran ? '' : agoStr(waited)].filter(Boolean).join(' ') : r.state === 'working' && r.tool ? esc(r.tool) : r.state === 'idle' || (r.state === 'turn' && !r.ran) ? agoStr(waited) : '', extra = head ? ' · ' + head : '';
2579
2691
  const took = mine && r.ran ? `⏱ ${L('a travaillé', 'worked')} ${agoStr(r.ran)} · ${L('vous attend depuis', 'waiting on you for')} ${agoStr(waited)}` : r.state === 'working' && r.asked ? `⏱ ${L('au travail depuis', 'working for')} ${agoStr(Math.max(0, now - r.asked))}` : ''; // the time it worked, apart from the time it has waited on you
2580
2692
  const pr = r.pr ? `<button class="bpr" data-url="${esc(r.pr.url)}" title="${esc(L('Ouvrir la pull request', 'Open the pull request'))}">PR #${+r.pr.n} ↗</button>` : '';
2581
2693
  const put = done ? `<button class="bdo" data-undo="1" title="${esc(L('Rouvrir', 'Reopen'))}" aria-label="${esc(L('Rouvrir', 'Reopen'))}">↩</button>` : r.state === 'turn' || r.state === 'idle' ? `<button class="bdo" title="${esc(L('Marquer comme traitée', 'Mark as done'))}" aria-label="${esc(L('Marquer comme traitée', 'Mark as done'))}">✓</button>` : '';
2582
- return `<div class="bcard ${r.state}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask ? `<div class="bq">${esc(r.ask)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${took ? `<div class="bm">${took}</div>` : ''}${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
2694
+ return `<div class="bcard ${r.state}${g ? ' gave' : ''}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${g ? 'stalled' : r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask || g ? `<div class="bq">${esc(r.ask || g)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${took ? `<div class="bm">${took}</div>` : ''}${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
2583
2695
  }
2584
2696
  function paintBoard() {
2585
2697
  if (!boardAll || !document.body.classList.contains('board')) return; const now = Date.now(), recent = (a, b) => b.mtime - a.mtime;
2586
- const live = boardAll.filter((r) => !isDone(r)), done = boardAll.filter(isDone).sort(recent), head = (k, label, n) => `${BSTATE[k] ? BSTATE[k][0] : '✓'} <span class="bl">${label}</span><i>${n}</i>`;
2587
- const secs = BGROUP.map((k) => [k, live.filter((r) => r.state === k).sort(recent)]).filter(([, rs]) => rs.length).map(([k, rs]) => `<section class="bsec"><h3 class="bhd ${k}">${head(k, L(BSTATE[k][2], BSTATE[k][1]), rs.length)}</h3><div class="bgrid">${rs.map((r) => bcard(r, now, false)).join('')}</div></section>`).join('');
2698
+ const kinds = BTOOLS.filter(([k]) => boardAll.some((r) => toolOf(r) === k)), pick = kinds.some(([k]) => k === prefs.boardTool) ? prefs.boardTool : '', mine = boardAll.filter((r) => !pick || toolOf(r) === pick);
2699
+ const filt = kinds.length < 2 ? '' : `<div class="bfilt" role="group" aria-label="${esc(L('Outil', 'Tool'))}">${[['', L('Tous', 'All')], ...kinds].map(([k, n]) => `<button class="bft${k === pick ? ' on' : ''}" data-tool="${esc(k)}" aria-pressed="${k === pick}">${esc(n)} <i>${k ? boardAll.filter((r) => toolOf(r) === k).length : boardAll.length}</i></button>`).join('')}</div>`;
2700
+ const live = mine.filter((r) => !isDone(r)), done = mine.filter(isDone).sort(recent), head = (k, label, n) => `${BSTATE[k] ? BSTATE[k][0] : '✓'} <span class="bl">${label}</span><i>${n}</i>`;
2701
+ const secs = filt + BGROUP.map((k) => [k, live.filter((r) => r.state === k).sort(recent)]).filter(([, rs]) => rs.length).map(([k, rs]) => k === 'idle' /* idle: folded into one line, opened on demand (and kept open while the board is painted again) */
2702
+ ? `<details class="bsec bidle"${boardIdleOpen ? ' open' : ''}><summary class="bhd ${k}">${head(k, L(BSTATE[k][2], BSTATE[k][1]), rs.length)}</summary><div class="bgrid">${rs.map((r) => bcard(r, now, false)).join('')}</div></details>`
2703
+ : `<section class="bsec"><h3 class="bhd ${k}">${head(k, L(BSTATE[k][2], BSTATE[k][1]), rs.length)}</h3><div class="bgrid">${rs.map((r) => bcard(r, now, false)).join('')}</div></section>`).join('');
2588
2704
  const put = done.length ? `<details class="bsec bdone"${boardDoneOpen ? ' open' : ''}><summary class="bhd">${head('', L('Traitées', 'Done'), done.length)}</summary><div class="bgrid">${done.map((r) => bcard(r, now, true)).join('')}</div></details>` : '';
2589
2705
  $('#boardv').innerHTML = secs + put || `<div class="bsum"><span>${L('Aucune session récente', 'No recent session')}</span></div>`;
2590
2706
  }
@@ -2595,13 +2711,14 @@ async function renderBoardView() {
2595
2711
  paintBoard();
2596
2712
  } catch {} finally { boardBusy = false; }
2597
2713
  }
2598
- $('#boardv').addEventListener('toggle', (e) => { if (e.target.classList && e.target.classList.contains('bdone')) boardDoneOpen = e.target.open; }, true);
2714
+ $('#boardv').addEventListener('toggle', (e) => { if (e.target.classList && e.target.classList.contains('bdone')) boardDoneOpen = e.target.open; if (e.target.classList && e.target.classList.contains('bidle')) boardIdleOpen = e.target.open; }, true);
2599
2715
  $('#boardv').onkeydown = (e) => { if ((e.key === 'Enter' || e.key === ' ') && e.target.classList.contains('bcard')) { e.preventDefault(); e.target.click(); } };
2600
2716
  async function openSession(proj, id) {
2601
2717
  if (!TOOL[proj]) prefs.proj = proj; S.pick = { proj, id }; savePrefs(); setView('call'); // a Vibe or Codex session is listed under its tool, which is not a folder to follow: kept as the project, it left a window with no folder showing that tool's sessions only, for good
2602
2718
  if (S.live || S.demo) { if (S.demo) await setMode('live'); S.cur = null; fillProjects(); await followCurrent(); } else await setMode('live');
2603
2719
  }
2604
2720
  $('#boardv').onclick = (e) => {
2721
+ const ft = e.target.closest('.bft'); if (ft) { prefs.boardTool = ft.dataset.tool; savePrefs(); paintBoard(); return; }
2605
2722
  const pr = e.target.closest('.bpr'), put = e.target.closest('.bdo'), c = e.target.closest('.bcard'); if (pr) return openExternal(pr.dataset.url); if (!c) return;
2606
2723
  if (put) { const proj = c.dataset.p, id = c.dataset.i, on = !put.dataset.undo; // shown at once here, and told to the server, which the other windows ask
2607
2724
  for (const list of [boardAll || [], S.rows]) { const r = list.find((x) => x.proj === proj && x.id === id); if (r) { if (on) r.done = 1; else delete r.done; } }
@@ -2642,12 +2759,17 @@ function paintTabs() {
2642
2759
  for (const k of by.keys()) if (!S.tabOrder.includes(k)) S.tabOrder.push(k); // a session keeps its place while it has no tab: the call now goes by itself to a session that is started, sometimes before the list has the one it leaves, which then came back second
2643
2760
  const ks = S.tabOrder.filter((k) => by.has(k)).slice(0, 8); if (!ks.includes(ck)) ks[ks.length - 1] = ck; // the others are in ⋯
2644
2761
  const html = by.size < 2 ? '' : ks.map((k) => { const r = by.get(k), on = k === ck, st = BSTATE[r.state]; // one session: no row, there is nothing to tell apart
2645
- const pinned = on && !!S.pick && !!S.pick.pin && sessKey(S.pick) === k, tip = tabName(r) + '\n' + niceProj(r.proj) + (st ? ' · ' + L(st[2], st[1]) : '') + (pinned ? '\n' + L('Épinglé : cliquez pour désépingler', 'Pinned: click to unpin') : '');
2646
- return `<button class="stab ${r.state}${on ? ' on' : ''}" role="tab" aria-selected="${on}" data-k="${esc(k)}" title="${esc(tip)}">${st ? st[0] : ''}${TOOL[r.proj] ? `<i>${TOOL[r.proj]}</i>` : ''}<span>${esc(tabName(r))}</span>${pinned ? '📌' : ''}</button>`; }).join('')
2647
- + `<button class="stab all" title="${esc(L('Aller à une session', 'Go to a session'))} (Cmd / Ctrl + K)" aria-label="${esc(L('Aller à une session', 'Go to a session'))}">⋯</button>`;
2762
+ const pinned = on && !!S.pick && !!S.pick.pin && sessKey(S.pick) === k, tip = tabName(r) + '\n' + niceProj(r.proj) + (r.state === 'turn' && r.gave ? ' · ⚠ ' + L('a abandonné ?', 'gave up?') + '\n' + r.gave : st ? ' · ' + L(st[2], st[1]) : '') + (pinned ? '\n' + L('Épinglé : cliquez pour désépingler', 'Pinned: click to unpin') : '');
2763
+ return `<button class="stab ${r.state}${r.state === 'turn' && r.gave ? ' gave' : ''}${on ? ' on' : ''}" role="tab" aria-selected="${on}" data-k="${esc(k)}" title="${esc(tip)}">${st ? st[0] : ''}${TOOL[r.proj] ? `<i>${TOOL[r.proj]}</i>` : ''}<span>${esc(tabName(r))}</span>${pinned ? '📌' : ''}</button>`; }).join('')
2764
+ + `<button class="stab all" title="${esc(L('Aller à une session', 'Go to a session'))} (Cmd / Ctrl + K)" aria-label="${esc(L('Aller à une session', 'Go to a session'))}">⋯</button>` + (by.size < 2 ? '' : whyTag());
2648
2765
  if (html === paintTabs.html) return; if (!html) paintTabs.cur = ''; el.innerHTML = paintTabs.html = html;
2649
2766
  if (paintTabs.cur !== ck) { paintTabs.cur = ck; const on = el.querySelector('.on'); if (on) on.scrollIntoView({ block: 'nearest', inline: 'nearest' }); }
2650
2767
  }
2768
+ function whyTag() { // which rule put the call in this session (currentSession in server.js): the call moves by itself, and this says why it is here
2769
+ const w = { pin: ['📌 ', L('épinglée par vous', 'pinned by you')], pick: ['↪ ', L('vous y êtes allé', 'you went there')], typed: ['⌨ ', L('là où vous avez écrit en dernier', 'where you last typed')], busy: ['⚙ ', L('là où l’on travaille', 'where the work is')], stay: ['· ', L('personne au travail : l’appel reste ici', 'nobody at work: the call stays')], latest: ['· ', L('la dernière session écrite', 'the latest session written')] }[S.why];
2770
+ if (!w) return ''; const tip = L('L’appel suit la session où vous avez écrit en dernier. Un clic sur un onglet l’y emmène ; un second clic l’y épingle. G : ce qui a besoin de vous.', 'The call follows the session you last typed in. A click on a tab takes it there; a second click pins it there. G: what needs you.');
2771
+ return `<span class="why" title="${esc(tip)}">${w[0]}${esc(L('Suivie : ', 'Following: ') + w[1])}</span>`;
2772
+ }
2651
2773
  function goSession(proj, id, pin) { // you go to this session: the call is kept there until you type somewhere (since: filled by the first answer, see followCurrent)
2652
2774
  // pin: by a click on its tab. The call is pinned there (📌): it stays while you go through the Claude Code tabs of the editor and while you type in it, until you ask something in another session. A click on that tab again unpins it
2653
2775
  const held = !!pin && !!S.pick && !!S.pick.pin && S.pick.proj === proj && S.pick.id === id; S.pick = pin && !held ? { proj, id, pin: true } : { proj, id };
@@ -2692,7 +2814,7 @@ async function visitSay(v, token) {
2692
2814
  $('#visit').onclick = (e) => { const v = S.visit; if (!v) return; if (e.target.closest('.vx')) hideVisit(); else goSession(v.r.proj, v.r.id); };
2693
2815
  async function sessPoll() {
2694
2816
  if (!S.live || S.demo || document.hidden || sessPoll.busy) return; sessPoll.busy = true;
2695
- try { const t0 = Date.now(), rows = await (await fetch('/api/board')).json(); if (Array.isArray(rows) && S.live && !S.demo) { S.rows = rows; S.rowsAt = t0; knocks(); paintTabs(); } } catch {} finally { sessPoll.busy = false; }
2817
+ try { const t0 = Date.now(), rows = await (await fetch('/api/board')).json(); if (Array.isArray(rows) && S.live && !S.demo) { S.rows = rows; S.rowsAt = t0; knocks(); paintTabs(); paintAttn(); } } catch {} finally { sessPoll.busy = false; }
2696
2818
  }
2697
2819
  setInterval(sessPoll, 3000);
2698
2820
  async function setMode(m) {
@@ -2804,7 +2926,7 @@ async function exportVideo(from = 0, to = 0, clip = 0) { // clip: length in ms
2804
2926
  // UI wiring
2805
2927
  // =====================================================================
2806
2928
  function applyLang() {
2807
- renderCharInfo(); packNote(); menuTip(); rateDay(); coffeeDay();
2929
+ renderCharInfo(); packNote(); menuTip(); rateDay(); coffeeDay(); usageStart();
2808
2930
  try { for (const id in S.act) { const b = S.term[id], t = b && b[b.length - 1]; if (t && t.tool) S.act[id] = activityLabel(t.tool); } if (S.live) fillProjects(); } catch {} // what each agent is doing, and the list of projects, were written in the language before
2809
2931
  document.documentElement.lang = (LANGS.find((l) => l[0] === prefs.lang) || LANGS[0])[2];
2810
2932
  document.querySelectorAll('[data-fr]').forEach((el) => (el.textContent = FR() ? el.dataset.fr : tr(el.dataset.en)));
@@ -2812,15 +2934,15 @@ function applyLang() {
2812
2934
  $('#callTrMi').style.display = CALL_LANG[prefs.lang] && !FR() ? '' : 'none';
2813
2935
  const sel = $('#langSel'); if (!sel.options.length) sel.innerHTML = LANGS.map(([c, n]) => `<option value="${c}">${n}</option>`).join(''); sel.value = prefs.lang;
2814
2936
  [['#bPlay', L('Pause / Lecture (espace)', 'Pause / Play (space)')], ['#bLog', 'Transcript'], ['#bMute', L('Son (touche M)', 'Sound (M key)')], ['#bMenu', L('Réglages', 'Settings')], ['#dclose', L('Fermer', 'Close')], ['#officeVol', L('Volume de l’ambiance', 'Ambience volume')], ['#musicVol', L('Volume de la musique', 'Music volume')], ['#liveProj', L('Projet à suivre', 'Project to follow')], ['#reactBar', L('Réactions', 'Reactions')], ['#logQ', L('Rechercher dans la transcription', 'Search the transcript')], ['#roster', L('Agents', 'Agents')]].forEach(([q, t]) => { const el = $(q); if (!el) return; el.title = t; el.setAttribute('aria-label', t); }); $('#logQ').placeholder = L('Rechercher…', 'Search…'); $('#menuQ').placeholder = L('Chercher un réglage…', 'Search settings…'); $('#menuQ').setAttribute('aria-label', $('#menuQ').placeholder); $('#sps').setAttribute('aria-label', L('Vitesses prédéfinies', 'Speed presets')); document.querySelectorAll('#reactBar button').forEach((b) => b.setAttribute('aria-label', b.dataset.e));
2815
- $('#gT').textContent = L('Rejoindre l’appel', 'Join the call'); $('#gP').textContent = L('Cliquez pour activer le son et suivre votre session Claude Code en direct.', 'Click to enable sound and follow your Claude Code session live.'); $('#gB').textContent = L('▶ Rejoindre', '▶ Join');
2816
- $('#eDemo').textContent = L('▶ Voir la démo', '▶ Watch the demo'); $('#eT').textContent = L('En attente d’une session', 'Waiting for a session'); $('#eP').innerHTML = watched() ? esc(L('Lancez Claude Code dans {0} : l’appel démarrera tout seul.', 'Start Claude Code in {0} — the call will start by itself.')).replace('{0}', `<b>${esc(watched())}</b>`) : esc(L('Lancez Claude Code dans ce dossier : l’appel démarrera tout seul.', 'Start Claude Code in this folder — the call will start by itself.'));
2937
+ $('#gB').textContent = L('🔊 Activer le son', '🔊 Turn on sound'); $('#gB').title = L('Ou cliquez n’importe où dans l’appel', 'Or click anywhere in the call');
2938
+ $('#eDemo').textContent = L('▶ Voir la démo', '▶ Watch the demo'); $('#eT').textContent = L('En attente d’une session', 'Waiting for a session'); $('#eP').innerHTML = watched() ? esc(L('Aucune session pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe dans {0} : l’appel démarrera tout seul.', 'No session yet. Start Claude Code, Codex or Mistral Vibe in {0}: the call will start by itself.')).replace('{0}', () => `<b>${esc(watched())}</b>`) : esc(L('Aucune session sur cet ordinateur pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe (ou une tâche Cowork) : l’appel démarrera tout seul.', 'No session on this computer yet. Start Claude Code, Codex or Mistral Vibe (or a Cowork task): the call will start by itself.'));
2817
2939
  for (const id in S.agents) { const p = persona(S.agents[id]); Object.assign(S.agents[id], { name: p.name, role: p.role }); const t = $('#t-' + id); if (t) { t.querySelector('.tag span').textContent = p.role; t.querySelector('.tag b').textContent = p.name; if (id === 'main' || id === 'user') t.querySelector('.tag span').textContent = p.role; } }
2818
2940
  document.querySelectorAll('#menu .mi[data-t], #prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t])); renderCoffee(); renderTokens(); updateHint(); renderLog(true); syncUI();
2819
2941
  }
2820
2942
  const elsewhere = () => !!(S.owner && S.owner !== CID);
2821
2943
  function applyMute() {
2822
- const b = $('#bMute'); b.textContent = AUD.muted ? '🔇' : elsewhere() ? '🔈' : '🔊';
2823
- b.title = elsewhere() ? L('Le son est joué dans une autre fenêtre — cliquer pour le reprendre ici', 'Sound is playing in another window — click to take it over here') : L('Son (touche M)', 'Sound (M key)');
2944
+ const b = $('#bMute'); b.textContent = AUD.muted || S.hush ? '🔇' : elsewhere() ? '🔈' : '🔊';
2945
+ b.title = S.hush ? L('Le son s’active à votre premier clic dans l’appel', 'Sound turns on with your first click in the call') : elsewhere() ? L('Le son est joué dans une autre fenêtre — cliquer pour le reprendre ici', 'Sound is playing in another window — click to take it over here') : L('Son (touche M)', 'Sound (M key)');
2824
2946
  AUD.apply(); if (AUD.off()) { synth && synth.cancel(); AUD.stopAll(); }
2825
2947
  }
2826
2948
  async function audioSync(claim) { // heartbeat + ownership: avoids two Agent Standup windows talking at the same time
@@ -2831,7 +2953,7 @@ async function audioSync(claim) { // heartbeat + ownership: avoids two Agent S
2831
2953
  }
2832
2954
  const claimAudio = () => { S.owner = CID; applyMute(); audioSync(true); };
2833
2955
  setInterval(() => audioSync(false), 1500);
2834
- function toggleMute() { if (elsewhere()) { AUD.muted = false; claimAudio(); return; } AUD.muted = !AUD.muted; applyMute(); }
2956
+ function toggleMute() { if (S.hush) return joinSound(); if (elsewhere()) { AUD.muted = false; claimAudio(); return; } AUD.muted = !AUD.muted; applyMute(); }
2835
2957
  function setView(v) { prefs.view = v; savePrefs(); document.body.classList.toggle('tree', v === 'tree'); document.body.classList.toggle('board', v === 'board'); if (v === 'board') renderBoardView(); document.querySelectorAll('#viewSeg button').forEach((b) => b.classList.toggle('on', b.dataset.v === v)); renderTree(); }
2836
2958
 
2837
2959
  $('#viewSeg').onclick = (e) => { const b = e.target.closest('button'); if (b) setView(b.dataset.v); };
@@ -2845,9 +2967,10 @@ setInterval(() => {
2845
2967
  }, 5000);
2846
2968
  async function reloadChars() { await loadChars(); for (const k in imgCache) delete imgCache[k]; for (const id in S.agents) S.agents[id].custom = null; for (const id in S.agents) S.agents[id].custom = customFor(id); buildStage(); paintStatus(); packNote(); await renderCharInfo(); }
2847
2969
  $('#charPick').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = ''; openChars(); };
2848
- $('#packNoteB').onclick = () => { prefs.vampSeen = true; savePrefs(); packNote(); CHPICK.more = 'halloween'; openChars(); };
2849
- $('#packNoteX').onclick = () => { prefs.vampSeen = true; savePrefs(); packNote(); };
2850
- $('#modeSeg').onclick = (e) => { const b = e.target.closest('button'); if (b) setMode(b.dataset.m); };
2970
+ const packShut = () => { prefs.packOpen = false; savePrefs(); packNote(); voiceOffer(); };
2971
+ $('#packNoteB').onclick = $('#packNoteI').onclick = () => { packShut(); CHPICK.more = 'halloween'; openChars(); };
2972
+ $('#packNoteX').onclick = packShut;
2973
+ $('#modeSeg').onclick = async (e) => { const b = e.target.closest('button'); if (!b) return; await setMode(b.dataset.m); if (b.dataset.m === 'demo' && S.demo && !S.playing) togglePlay(); }; // the demo plays at once, as from the empty state
2851
2974
  // ⚙ menu: sections that fold (remembered) and a search box
2852
2975
  function menuInit() {
2853
2976
  const m = $('#menu'), secs = []; let cur = null;
@@ -2866,14 +2989,15 @@ function menuInit() {
2866
2989
  $('#menuNone').style.display = q && !far.length && !secs.some((sc) => sc.items.some((e) => !e.classList.contains('mhide'))) ? '' : 'none';
2867
2990
  };
2868
2991
  }
2869
- const onSwitch = (e) => { const b = e.target.closest('.mi[data-t]'); if (!b) return; prefs[b.dataset.t] = !prefs[b.dataset.t]; savePrefs(); if (prefs[b.dataset.t] && ['voice', 'office', 'music', 'notify'].includes(b.dataset.t)) claimAudio(); b.querySelector('.sw').classList.toggle('on', prefs[b.dataset.t]); AUD.apply(); if (b.dataset.t === 'office') $('#officeBox').style.display = prefs.office ? '' : 'none'; if (b.dataset.t === 'callTr') { prefs.callTrSeen = true; savePrefs(); setLang(prefs.lang); } if (b.dataset.t === 'voice') voiceOffer(); if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') renameAll(); if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === 'roster') { document.body.classList.toggle('rost', prefs.roster); paintStates(); } if (b.dataset.t === 'notify') { prefs.notifyChosen = true; savePrefs(); } if (b.dataset.t === 'notify' && prefs.notify) askNotify(); if (b.dataset.t === 'vanish' && !prefs.vanish) { S.gone.clear(); paintStatus(); }
2992
+ const onSwitch = (e) => { const b = e.target.closest('.mi[data-t]'); if (!b) return; prefs[b.dataset.t] = !prefs[b.dataset.t]; savePrefs(); if (prefs[b.dataset.t] && ['voice', 'office', 'music', 'notify'].includes(b.dataset.t)) claimAudio(); b.querySelector('.sw').classList.toggle('on', prefs[b.dataset.t]); AUD.apply(); if (b.dataset.t === 'shareUsage') { prefs.usageAsked = true; savePrefs(); usageOpened(true); } if (b.dataset.t === 'office') $('#officeBox').style.display = prefs.office ? '' : 'none'; if (b.dataset.t === 'callTr') { prefs.callTrSeen = true; savePrefs(); setLang(prefs.lang); } if (b.dataset.t === 'voice') voiceOffer(); if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') renameAll(); if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === 'focusLayout') { document.body.classList.toggle('focusl', !!prefs.focusLayout); layout(); } if (b.dataset.t === 'roster') { document.body.classList.toggle('rost', prefs.roster); paintStates(); } if (b.dataset.t === 'notify') { prefs.notifyChosen = true; savePrefs(); } if (b.dataset.t === 'notify' && prefs.notify) askNotify(); if (b.dataset.t === 'vanish' && !prefs.vanish) { S.gone.clear(); paintStatus(); }
2993
+ if (b.dataset.t === 'askCard') paintAsk(Date.now());
2870
2994
  if (b.dataset.t === 'music') { $('#musicBox').style.display = prefs.music ? '' : 'none'; if (prefs.music) { AUD.init(); AUD.apply(); } } };
2871
2995
  $('#menu').onclick = onSwitch; $('#prefs').onclick = (e) => { if (e.target === $('#prefs')) return closePrefs(); onSwitch(e); setTimeout(syncSwitches); };
2872
2996
  function openPrefs(target) { // ⚙ → All settings; target: one of its settings, found by the search of the menu, shown and lit up
2873
2997
  $('#menu').classList.remove('on'); $('#prefs').classList.add('on'); syncSwitches(); document.querySelectorAll('#prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t]));
2874
2998
  if (target) { target.scrollIntoView({ block: 'center' }); target.classList.remove('flash'); void target.offsetWidth; target.classList.add('flash'); (target.matches('.mi') ? target : target.querySelector('select, input, button') || target).focus(); } else $('#prefsX').focus();
2875
2999
  }
2876
- const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'followTab']; // what the panel holds, and so what Reset puts back
3000
+ const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'askCard', 'followTab']; // what the panel holds, and so what Reset puts back
2877
3001
  $('#prefsReset').onclick = async () => {
2878
3002
  const b = $('#prefsReset'); if (!b.classList.contains('sure')) { b.classList.add('sure'); b.textContent = L('Cliquez encore pour tout remettre', 'Click again to reset them all'); setTimeout(() => { b.classList.remove('sure'); b.textContent = L('Réglages par défaut', 'Reset to defaults'); }, 4000); return; } // two clicks: nothing is lost by a stray one
2879
3003
  for (const k of PANEL_KEYS) { if (k in PREF_DEFAULTS) prefs[k] = PREF_DEFAULTS[k]; else delete prefs[k]; } delete prefs.notifyChosen; // notifyChosen too: the default of notifications is decided at start-up from it
@@ -2891,7 +3015,8 @@ $('#menuTipOk').onclick = menuTipDone;
2891
3015
  function closePrefs() { $('#prefs').classList.remove('on'); $('#bMenu').focus(); }
2892
3016
  $('#prefsX').onclick = closePrefs; $('#mPrefs').onclick = () => openPrefs();
2893
3017
  function renderMenuShop() { // in the menu, under Characters: the Halloween pack for those who do not have it. Emptied while the Characters window shows the same panel (one set of ids at a time)
2894
- const el = $('#menuShop'), sp = SHOP.halloween; if (!el) return; if (!sp || sp.n || $('#recap.on #chdlg')) { el.innerHTML = ''; return; } renderShop(el, 'halloween', sp);
3018
+ const el = $('#menuShop'), sp = SHOP.halloween; if (!el) return; if (!sp || sp.n || $('#recap.on #chdlg')) { el.innerHTML = ''; return; } // one line: the pictures, the price and the buttons are in the Characters window
3019
+ el.innerHTML = `<button class="btn" id="menuShopGo" style="width:100%;text-align:left">🎃 ${esc(L('Le pack Halloween, dessiné à la main', 'The hand-drawn Halloween pack'))} ›</button>`; $('#menuShopGo').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = 'halloween'; openChars(); };
2895
3020
  }
2896
3021
  $('#station').innerHTML = STATIONS.map((s) => `<option value="${s.id}">📻 ${s.name}</option>`).join('');
2897
3022
  $('#station').value = prefs.station; $('#musicVol').value = prefs.musicVol; $('#musicBox').style.display = prefs.music ? '' : 'none';
@@ -2918,16 +3043,16 @@ kokoroUI();
2918
3043
  // to them once they are ready, not before); ✕ and the line never comes back. Not in the scripted demo (?demo=1), which is what the pictures and videos are made from.
2919
3044
  let offerTimer = null;
2920
3045
  async function voiceOffer() {
2921
- const el = $('#vOffer'), hide = () => { el.style.display = 'none'; clearInterval(offerTimer); offerTimer = null; };
3046
+ const el = $('#vOffer'), hide = () => { voiceOffer.busy = false; const was = el.style.display !== 'none'; el.style.display = 'none'; clearInterval(offerTimer); offerTimer = null; if (was) packNote(); }; // one offer at a time: the pack's line, kept back while the voices download, can show now
2922
3047
  if (!prefs.voice || prefs.voiceOffer === 'no' || Q.get('demo')) return hide();
2923
3048
  let st; try { st = await (await fetch('/api/kokoro')).json(); } catch { return; }
2924
3049
  const add = st.installed && st.ready && !st.g2p && !!CALL_LANG[prefs.lang] && prefs.vstyle === 'kokoro'; // the voices are there, from before French, Spanish and Portuguese were added: one small package more, said on the call where one of them is the language of the interface (⚙ said it, and nothing else)
2925
3050
  if (st.ready && prefs.voiceOffer === 'want' && !st.installing && !add) { prefs.voiceOffer = 'no'; prefs.vstyle = 'kokoro'; prefs.vstyleChosen = true; savePrefs(); $('#vstyle').value = 'kokoro'; hide(); await TTS.init(); kokoroUI(); toast(L('Voix prêtes.', 'Voices ready.')); return; }
2926
- const busy = st.installing || (st.installed && !st.ready && !st.gaveUp && prefs.voiceOffer === 'want');
3051
+ const busy = voiceOffer.busy = st.installing || (st.installed && !st.ready && !st.gaveUp && prefs.voiceOffer === 'want');
2927
3052
  if (busy && !st.installing && !voiceOffer.woke) { voiceOffer.woke = true; fetch('/api/voices?engine=kokoro').catch(() => {}); } // installed in an earlier run, closed before the model was ready: nothing else starts the engine while another style is in use, and the line would say “Downloading” for good
2928
3053
  if ((st.installed && !busy && !add) || !st.npm) return hide(); // they have them; or cannot have them (no npm), which ⚙ explains
2929
3054
  $('#vOfferT').textContent = busy ? L('Téléchargement des vraies voix… vous pouvez continuer.', 'Downloading the real voices… you can carry on.') : st.error || (add ? L('Voix prêtes en anglais. Le français est encore lu par les voix du système.', 'Voices ready in English. This language is still read by the system voices.') : L('Vos agents peuvent parler avec de vraies voix.', 'Your agents can speak with real voices.'));
2930
- $('#vOfferB').style.display = busy ? 'none' : ''; $('#vOfferB').textContent = add ? L('Ajouter les voix françaises', 'Add the voices of this language') + L(` (${st.g2pMb} Mo)`, ` (${st.g2pMb} MB)`) : L('Installer', 'Install') + L(` (${st.sizeMb} Mo)`, ` (${st.sizeMb} MB)`); el.style.display = '';
3055
+ $('#vOfferB').style.display = busy ? 'none' : ''; $('#vOfferB').textContent = add ? L('Ajouter les voix françaises', 'Add the voices of this language') + L(` (${st.g2pMb} Mo)`, ` (${st.g2pMb} MB)`) : L('Installer', 'Install') + L(` (${st.sizeMb} Mo)`, ` (${st.sizeMb} MB)`); if (!busy && $('#packNote').style.display !== 'none') { el.style.display = 'none'; return; } el.style.display = ''; if ($('#packNote').style.display !== 'none') $('#packNote').style.display = 'none'; /* the pack's line, shown a few days a year, goes first; a download in progress goes before it */
2931
3056
  if (busy && !offerTimer) offerTimer = setInterval(voiceOffer, 2500); if (!busy && offerTimer) { clearInterval(offerTimer); offerTimer = null; }
2932
3057
  }
2933
3058
  $('#vOfferB').onclick = async () => { prefs.voiceOffer = 'want'; savePrefs(); try { await fetch('/api/kokoro/install', { method: 'POST' }); } catch {} voiceOffer(); kokoroUI(); };
@@ -2956,11 +3081,36 @@ $('#mClip').onclick = () => { $('#menu').classList.remove('on'); exportVideo(0,
2956
3081
  $('#mBrowser').onclick = () => { $('#menu').classList.remove('on'); window.parent.postMessage({ agentStandup: 'openBrowser' }, '*'); };
2957
3082
  $('#seek').oninput = (e) => seekTo(+e.target.value);
2958
3083
  $('#eDemo').onclick = async () => { await setMode('demo'); if (S.demo && !S.playing) togglePlay(); }; // "Watch the demo" plays it
2959
- $('#gB').onclick = () => {
2960
- claimAudio(); AUD.init(); AUD.apply(); S.locked = false; $('#gate').classList.remove('on'); syncUI();
3084
+ // The live call plays as soon as the page opens, silent: a browser lets a page make sound only after a click or a key. The first one, anywhere, turns the sound on (the chip at the top says so).
3085
+ // The mute button and its M key are left to themselves: they turn the sound on too (toggleMute), instead of the click turning it on and the button turning it straight off again.
3086
+ function joinSound() {
3087
+ if (!S.hush) return; S.hush = false; $('#gate').classList.remove('on'); claimAudio(); AUD.init(); AUD.apply(); applyMute(); syncUI();
2961
3088
  if (synth && !EMBED) { try { synth.speak(new SpeechSynthesisUtterance('')); } catch {} } // unlock browser speech
2962
- S.since = 0; if (S.live && S.events.length) run(liveStart()); // what arrived while the door was closed is past too
2963
- };
3089
+ }
3090
+ $('#gB').onclick = joinSound;
3091
+ addEventListener('pointerdown', (e) => { if (S.hush && !(e.target.closest && e.target.closest('#bMute'))) joinSound(); }, true);
3092
+ addEventListener('keydown', (e) => { if (S.hush && !e.metaKey && !e.ctrlKey && !e.altKey && e.key.toLowerCase() !== 'm' && e.key !== 'Escape' && !/INPUT|SELECT|TEXTAREA/.test(e.target.tagName)) { joinSound(); if (e.key === ' ') { e.preventDefault(); e.stopImmediatePropagation(); } } }, true); // the first Space turns the sound on, as Join did, without pausing the call too
3093
+ // The strip under the header: what needs you, in the call's session first (its agents), then in the other sessions (the list the tabs come from). Live only, in every view.
3094
+ // Certain when Claude Code says a menu is open there (sure); a guess otherwise, from how long a call has waited ("may need you"). A click, or G, goes to the next one.
3095
+ function attnItems(now) {
3096
+ if (!S.live || S.demo || !S.cur) return []; const ck = sessKey(S.cur), out = [];
3097
+ for (const id of S.attn || []) { const st = agentState(id, now); if (st.k === 'blocked') out.push({ id, who: nameOf(id), what: st.ask || S.lastTool[id] || (S.run[id] && S.run[id].name) || '', sure: !!st.sure, since: st.since || 0 }); }
3098
+ for (const r of S.rows) if (r.state === 'blocked' && !r.done && sessKey(r) !== ck && inWatch(r)) out.push({ r, who: '“' + tabName(r) + '”', what: r.ask || r.tool || '', sure: !!r.sure, since: r.since || now - (r.ageMs || 0) });
3099
+ return out;
3100
+ }
3101
+ function paintAttn(now = Date.now()) {
3102
+ const el = $('#attn'), a = attnItems(now), f = a[0];
3103
+ const html = f ? `<span class="aw">✋ <b>${esc(f.who)}</b> ${esc(f.sure ? L('vous attend', 'needs you') : L('vous attend peut-être', 'may need you'))}${f.what ? ' · ' + esc(f.what.replace(/\s+/g, ' ').slice(0, 120)) : ''}${f.since ? ' · ' + agoStr(Math.max(0, now - f.since)) : ''}</span>${a.length > 1 ? `<span class="am">+${a.length - 1}</span>` : ''}<span class="ak">G</span>` : '';
3104
+ if (html !== paintAttn.html) { paintAttn.html = html; el.innerHTML = html; el.hidden = !f; el.title = a.map((x) => x.who + (x.what ? ' · ' + x.what : '')).join('\n'); }
3105
+ }
3106
+ function goAttn() { // the next thing that needs you: an agent of this session, or another session (which the call goes to)
3107
+ const a = attnItems(Date.now()); if (!a.length) { toast(L('Personne n’a besoin de vous pour le moment', 'Nobody needs you right now')); return; }
3108
+ goAttn.i = ((goAttn.i || 0) + (goAttn.at && Date.now() - goAttn.at < 30000 ? 1 : 0)) % a.length; goAttn.at = Date.now(); const x = a[goAttn.i];
3109
+ if (x.r) { goAttn.i = 0; setView('call'); goSession(x.r.proj, x.r.id); return; }
3110
+ if (document.body.classList.contains('tree') || document.body.classList.contains('board')) setView('call');
3111
+ S.focusLock = Date.now() + 25000; setFocus(x.id); const t = $('#t-' + x.id); if (t) { t.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); popTile(x.id); }
3112
+ }
3113
+ $('#attn').onclick = goAttn;
2964
3114
  // J / K (or a click on the “need you” chip) jump to the agents that need you or are stalled, one after the other
2965
3115
  function jumpAttn(dir = 1) {
2966
3116
  const a = (S.attn || []).filter((id) => $('#t-' + id));
@@ -2998,7 +3148,7 @@ function paintPill() {
2998
3148
  const w = by.working, wt = lead.k === 'waiting' ? 'main' : w.length ? '' : by.waiting[0]; cls = 'working'; to = wt || (w.length === 1 ? w[0] : 'main');
2999
3149
  txt = (w.length === 1 && !wt ? '⚙ ' + what(w[0]) : w.length ? `⚙ ${w.length} ${L('au travail', 'working')}` : '') + (wt ? (w.length ? ' · ' : '🔗 ') + what(wt) : '');
3000
3150
  }
3001
- else if (isTurn('main', lead)) { const last = lastWord(); cls = 'turn'; to = 'main'; txt = '👉 ' + L('à vous', 'your turn') + (last ? ' · ' + (last.length > 110 ? last.slice(0, 108).replace(/\s+\S*$/, '') + '…' : last) : ''); tip = last; }
3151
+ else if (isTurn('main', lead)) { const g = lead.gave, last = g || lastWord(); cls = g ? 'stalled' : 'turn'; to = 'main'; txt = (g ? '⚠ ' + L('a abandonné ?', 'gave up?') : '👉 ' + L('à vous', 'your turn')) + (last ? ' · ' + (last.length > 110 ? last.slice(0, 108).replace(/\s+\S*$/, '') + '…' : last) : ''); tip = last; } // gave: what it says it could not do, in its own first sentence
3002
3152
  else { cls = 'idle'; to = 'main'; txt = '💤 ' + L('inactif', 'idle'); }
3003
3153
  }
3004
3154
  const c = cls + (to ? ' go' : ''), sub = !sess && S.cur && S.title ? ' · ' + S.title : '';
@@ -3023,7 +3173,7 @@ for (const q of ['#gate', '#empty']) new MutationObserver(focusDoor).observe($(q
3023
3173
  function syncSwitches() { document.querySelectorAll('#menu .mi[data-t], #prefs .mi[data-t]').forEach((b) => { b.setAttribute('role', 'switch'); b.setAttribute('aria-checked', String(!!prefs[b.dataset.t])); }); }
3024
3174
  new MutationObserver(() => { // the menu opens under the header and the status line, not over them
3025
3175
  const m = $('#menu'), on = m.classList.contains('on'), h = Math.round($('main').getBoundingClientRect().top); $('#bMenu').setAttribute('aria-expanded', String(on)); if (!on) return;
3026
- syncSwitches(); menuTipDone(); $('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; if (!$('#menuShop').innerHTML) renderMenuShop(); m.style.top = h + 3 + 'px'; m.style.maxHeight = `calc(100dvh - ${h + 13}px)`;
3176
+ syncSwitches(); menuTipDone(); $('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; $('#usageTip').style.display = 'none'; if (!$('#menuShop').innerHTML) renderMenuShop(); m.style.top = h + 3 + 'px'; m.style.maxHeight = `calc(100dvh - ${h + 13}px)`;
3027
3177
  }).observe($('#menu'), { attributes: true, attributeFilter: ['class'] });
3028
3178
  $('#menu').addEventListener('click', () => setTimeout(syncSwitches)); $('#bMenu').setAttribute('aria-expanded', 'false'); syncSwitches();
3029
3179
  addEventListener('keydown', (e) => { // on the way down: Escape also works from the search box and the selects of the menu, which the shortcuts below ignore
@@ -3060,8 +3210,8 @@ setInterval(() => {
3060
3210
  if (pos[k] !== S.idx) { delete pos[k]; pos[k] = S.idx; const ks = Object.keys(pos); while (ks.length > 40) delete pos[ks.shift()]; savePrefs(); }
3061
3211
  }, 3000);
3062
3212
  function openKeys() {
3063
- const rows = [['Space', L('Pause / lecture', 'Pause / play')], ['← / →', L('Replay : événement précédent / suivant', 'Replay: previous / next event')], ['N / Shift+N', L('Replay : moment clé suivant / précédent', 'Replay: next / previous highlight')], ['M', L('Son coupé / activé', 'Mute / unmute')], ['T', L('Vue arbre ↔ appel', 'Tree view ↔ call')], ['R', L('Récapitulatif', 'Recap')], ['L', L('Transcription', 'Transcript')], ['J / K', L('Agent suivant / précédent qui a besoin de vous', 'Next / previous agent that needs you')], ['Cmd / Ctrl + K', L('Aller à une session', 'Go to a session')], ['?', L('Cette aide', 'This help')], ['Esc', L('Fermer', 'Close')]];
3064
- $('#recap .box').innerHTML = `<h1>${L('Raccourcis clavier', 'Keyboard shortcuts')}</h1><table>${rows.map(([k, d]) => `<tr><td class="f"><b>${esc(k)}</b></td><td>${esc(d)}</td></tr>`).join('')}</table><h3>${L('Les états', 'What the states mean')}</h3><table>${[['⚙', L('au travail', 'working')], ['🔗', L('attend un autre agent', 'waiting on another agent')], ['✋', L('attend peut-être votre feu vert', 'may be waiting for your approval')], ['⚠', L('bloqué : un sous-agent est silencieux depuis longtemps', 'stalled: a sub-agent has been silent for a long time')], ['✓', L('terminé', 'done')]].map(([k, d]) => `<tr><td class="f">${k}</td><td>${esc(d)}</td></tr>`).join('')}</table><p class="dim" style="margin:14px 0 0;font-size:12px">${L('Les vues Appel, Arbre et Sessions se changent aussi en haut de la fenêtre.', 'You can also switch between Call, Tree and Sessions at the top of the window.')}</p><div style="margin-top:14px"><button class="btn" id="recapx">${L('Fermer', 'Close')}</button></div>`;
3213
+ const rows = [['Space', L('Pause / lecture', 'Pause / play')], ['← / →', L('Replay : événement précédent / suivant', 'Replay: previous / next event')], ['N / Shift+N', L('Replay : moment clé suivant / précédent', 'Replay: next / previous highlight')], ['M', L('Son coupé / activé', 'Mute / unmute')], ['T', L('Vue arbre ↔ appel', 'Tree view ↔ call')], ['R', L('Récapitulatif', 'Recap')], ['L', L('Transcription', 'Transcript')], ['G', L('Aller à ce qui a besoin de vous (ici ou dans une autre session)', 'Go to what needs you (here or in another session)')], ['J / K', L('Agent suivant / précédent qui a besoin de vous', 'Next / previous agent that needs you')], ['Cmd / Ctrl + K', L('Aller à une session', 'Go to a session')], ['?', L('Cette aide', 'This help')], ['Esc', L('Fermer', 'Close')]];
3214
+ $('#recap .box').innerHTML = `<h1>${L('Raccourcis clavier', 'Keyboard shortcuts')}</h1><table>${rows.map(([k, d]) => `<tr><td class="f"><b>${esc(k)}</b></td><td>${esc(d)}</td></tr>`).join('')}</table><h3>${L('Les états', 'What the states mean')}</h3><table>${[['⚙', L('au travail', 'working')], ['🔗', L('attend un autre agent', 'waiting on another agent')], ['✋', L('attend votre réponse ou votre feu vert (avec « ? » : sans doute, d’après le temps écoulé)', 'waits for your answer or approval (with “?”: probably, from how long it has waited)')], ['⚠', L('bloqué : un sous-agent est silencieux depuis longtemps', 'stalled: a sub-agent has been silent for a long time')], ['✓', L('terminé', 'done')]].map(([k, d]) => `<tr><td class="f">${k}</td><td>${esc(d)}</td></tr>`).join('')}</table><p class="dim" style="margin:14px 0 0;font-size:12px">${L('Les vues Appel, Arbre et Sessions se changent aussi en haut de la fenêtre.', 'You can also switch between Call, Tree and Sessions at the top of the window.')}</p><div style="margin-top:14px"><button class="btn" id="recapx">${L('Fermer', 'Close')}</button></div>`;
3065
3215
  $('#recapx').onclick = () => $('#recap').classList.remove('on'); $('#recap').classList.add('on');
3066
3216
  }
3067
3217
  $('#mKeys').onclick = () => { $('#menu').classList.remove('on'); openKeys(); };
@@ -3092,13 +3242,14 @@ addEventListener('keydown', (e) => {
3092
3242
  if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') { e.preventDefault(); openSwitcher(); return; }
3093
3243
  if (/INPUT|SELECT|TEXTAREA/.test(e.target.tagName) || e.metaKey || e.ctrlKey || e.altKey) return; // browser shortcuts (Cmd+R, Ctrl+N…) stay the browser's
3094
3244
  if (e.key === '?') { openKeys(); return; }
3095
- if (e.key === ' ') { if (e.target.closest && e.target.closest('button, .tile, .rr, .bcard, a, [role=button]')) return; e.preventDefault(); togglePlay(); } else if (e.key.toLowerCase() === 'm') toggleMute(); else if (e.key.toLowerCase() === 't') { const toTree = !document.body.classList.contains('tree'); setView(toTree ? 'tree' : 'call'); if (toTree) toast(L('Vue arbre : T pour revenir, ? pour l’aide', 'Tree view: T to go back, ? for help')); } else if (e.key.toLowerCase() === 'r') openRecap(); else if (e.key.toLowerCase() === 'l') $('#bLog').click(); else if (e.key === 'ArrowRight' && !S.live) { e.preventDefault(); stepEvent(1); } else if (e.key === 'ArrowLeft' && !S.live) { e.preventDefault(); stepEvent(-1); } else if (e.key.toLowerCase() === 'n') stepHighlight(e.shiftKey ? -1 : 1); else if (e.key.toLowerCase() === 'j') jumpAttn(1); else if (e.key.toLowerCase() === 'k') jumpAttn(-1); else if (e.key === 'Escape') { $('#recap').classList.remove('on'); $('#menu').classList.remove('on'); }
3245
+ if (e.key === ' ') { if (e.target.closest && e.target.closest('button, .tile, .rr, .bcard, a, [role=button]')) return; e.preventDefault(); togglePlay(); } else if (e.key.toLowerCase() === 'm') toggleMute(); else if (e.key.toLowerCase() === 't') { const toTree = !document.body.classList.contains('tree'); setView(toTree ? 'tree' : 'call'); if (toTree) toast(L('Vue arbre : T pour revenir, ? pour l’aide', 'Tree view: T to go back, ? for help')); } else if (e.key.toLowerCase() === 'r') openRecap(); else if (e.key.toLowerCase() === 'l') $('#bLog').click(); else if (e.key === 'ArrowRight' && !S.live) { e.preventDefault(); stepEvent(1); } else if (e.key === 'ArrowLeft' && !S.live) { e.preventDefault(); stepEvent(-1); } else if (e.key.toLowerCase() === 'n') stepHighlight(e.shiftKey ? -1 : 1); else if (e.key.toLowerCase() === 'g') goAttn(); else if (e.key.toLowerCase() === 'j') jumpAttn(1); else if (e.key.toLowerCase() === 'k') jumpAttn(-1); else if (e.key === 'Escape') { $('#recap').classList.remove('on'); $('#menu').classList.remove('on'); }
3096
3246
  });
3097
3247
  if (EMBED) $('#mBrowser').style.display = $('#mFollowTab').style.display = '';
3098
3248
 
3099
3249
  (async function init() {
3250
+ if (!prefs.firstDay) { prefs.firstDay = HAD_PREFS ? '2000-01-01' : new Date().toISOString().slice(0, 10); savePrefs(); } // the first day the call is in view asks nothing (see firstDay); someone who used the app before has had theirs
3100
3251
  if (!LANGS.some((l) => l[0] === prefs.lang)) prefs.lang = 'en'; await loadLocale(prefs.lang); voiceOffer(); kokoroUI(); await loadChars();
3101
- document.body.classList.toggle('rost', prefs.roster !== false); document.body.classList.toggle('react', !!prefs.reactions); setView(prefs.view); menuInit(); addEventListener('click', () => { try { if (prefs.notify && !EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} }, { once: true }); applyLang(); applyMute(); TTS.init().then(updateHint);
3252
+ document.body.classList.toggle('rost', prefs.roster !== false); document.body.classList.toggle('react', !!prefs.reactions); document.body.classList.toggle('focusl', !!prefs.focusLayout); setView(prefs.view); menuInit(); addEventListener('click', () => { try { if (prefs.notify && !EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} }, { once: true }); applyLang(); applyMute(); TTS.init().then(updateHint);
3102
3253
  loadHealth().then(() => { // French by default only if translation can actually work; otherwise stay in English without a warning
3103
3254
  const h = S.health || {};
3104
3255
  if (!prefs.langChosen && FR() && h.claude === null && !h.apiKey) { prefs.lang = 'en'; applyLang(); }
@@ -3112,7 +3263,7 @@ if (EMBED) $('#mBrowser').style.display = $('#mFollowTab').style.display = '';
3112
3263
  return;
3113
3264
  }
3114
3265
  S.live = Q.get('live') !== '0'; document.querySelectorAll('#modeSeg button').forEach((b) => b.classList.toggle('on', b.dataset.m === (S.live ? 'live' : 'replay')));
3115
- if (S.live) { S.locked = true; $('#gate').classList.add('on'); S.cur = null; syncUI(); fillProjects(); await followCurrent(); } else { S.live = true; await setMode('replay'); if (Q.get('at') != null && S.events.length) seekTo(Math.max(0, Math.min(S.events.length - 1, +Q.get('at') || 0))); }
3266
+ if (S.live) { S.hush = true; S.locked = false; $('#gate').classList.add('on'); applyMute(); S.cur = null; syncUI(); fillProjects(); await followCurrent(); } else { S.live = true; await setMode('replay'); if (Q.get('at') != null && S.events.length) seekTo(Math.max(0, Math.min(S.events.length - 1, +Q.get('at') || 0))); }
3116
3267
  syncUI();
3117
3268
  })();
3118
3269
  </script>