-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1638 lines (1504 loc) · 74.7 KB
/
Copy pathindex.html
File metadata and controls
1638 lines (1504 loc) · 74.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>helmcode·whisper</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' fill='%230a0a0a'/><rect x='7' y='12' width='3' height='8' fill='%234f39f6'/><rect x='13' y='7' width='3' height='18' fill='%23848fff'/><rect x='19' y='10' width='3' height='12' fill='%234f39f6'/><rect x='25' y='14' width='3' height='4' fill='%23848fff'/></svg>">
<style>
/* Tokens taken from helmcode.com src/styles/tokens.css. Same names, same order,
so the two can be diffed by eye. Nothing here loads from the network. */
:root {
--color-bg: #0a0a0a;
--color-surface: #0e0e0e;
--color-surface-raised: #161616;
--color-surface-input: #1a1a1a;
--color-surface-input-focus: #1e1e1e;
--color-border: rgba(255,255,255,0.09);
--color-border-hover: rgba(255,255,255,0.16);
--color-border-focus: rgba(255,255,255,0.28);
--color-text-primary: #ffffff;
--color-text-secondary: rgba(255,255,255,0.55);
--color-text-tertiary: rgba(255,255,255,0.35);
--color-text-placeholder: rgba(255,255,255,0.22);
--color-accent: oklch(51.1% .262 276.966);
--color-accent-text: oklch(70% .18 276.966);
--color-accent-dim: oklch(51.1% .262 276.966 / 0.10);
--color-accent-border: oklch(51.1% .262 276.966 / 0.35);
--color-error: rgba(220,80,80,0.90);
--color-terminal-red: #ff5f56;
--color-terminal-amber: #ffbd2e;
--color-terminal-green: #27c93f;
/* Speaker accents. Muted on purpose: the transcript is for reading, and a
rainbow of saturated names fights the text it is labelling. */
--sp-0: #848fff; --sp-1: #5fc9a8; --sp-2: #d9a441;
--sp-3: #cf7ab5; --sp-4: #7ab6d9;
--font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-mono: 'Roboto Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
--text-mono: 12px;
--text-mono-sm: 10px;
--tracking-mono-sm: 0.07em;
--leading-body: 1.75;
--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
--space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
--duration-fast: 110ms;
--duration-normal: 180ms;
--ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
--topbar: 52px;
--player: 60px;
--sidebar: 300px;
}
*, *::before, *::after { box-sizing: border-box; }
html {
background: var(--color-bg);
color: var(--color-text-primary);
font-family: var(--font-sans);
font-size: 15px;
color-scheme: dark;
-webkit-font-smoothing: antialiased;
}
body { margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar-track { background: transparent; }
.mono { font-family: var(--font-mono); font-size: var(--text-mono); }
.eyebrow {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); text-transform: uppercase;
color: var(--color-text-tertiary);
}
/* ── top bar ───────────────────────────────────────────────── */
header {
height: var(--topbar); flex: 0 0 auto;
display: flex; align-items: center; gap: var(--space-6);
padding: 0 var(--space-5);
border-bottom: 0.5px solid var(--color-border);
background: var(--color-surface);
}
.brand {
font-family: var(--font-mono); font-size: var(--text-mono);
letter-spacing: 0.02em; white-space: nowrap; width: calc(var(--sidebar) - 40px);
}
.brand b { color: var(--color-accent-text); font-weight: 500; }
.searchbox { flex: 1 1 auto; max-width: 520px; position: relative; }
.searchbox .k {
position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
font-family: var(--font-mono); font-size: var(--text-mono-sm);
color: var(--color-text-placeholder); pointer-events: none;
border: 0.5px solid var(--color-border); padding: 2px 5px;
}
/* A row of coloured dots is a puzzle. Each one says what it is, and hovering
says which device it found. */
.statuses { margin-left: auto; display: flex; gap: var(--space-3); align-items: center; }
.status {
display: flex; align-items: center; gap: 6px; cursor: default;
border: 0.5px solid var(--color-border); padding: 5px 9px;
}
.status i { width: 6px; height: 6px; background: var(--color-terminal-green); flex: 0 0 auto; }
.status.warn i { background: var(--color-terminal-amber); }
.status.bad i { background: var(--color-terminal-red); }
.status span {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-secondary);
}
.status.warn span, .status.bad span { color: var(--color-text-primary); }
/* ── controls ──────────────────────────────────────────────── */
input[type="text"] {
width: 100%;
background: var(--color-surface-input);
border: 0.5px solid var(--color-border);
color: var(--color-text-primary);
font-family: var(--font-mono); font-size: var(--text-mono);
padding: 9px 12px; outline: none;
transition: border-color var(--duration-normal) var(--ease-smooth),
background var(--duration-normal) var(--ease-smooth);
}
input[type="text"]::placeholder { color: var(--color-text-placeholder); }
input[type="text"]:hover { border-color: var(--color-border-hover); }
input[type="text"]:focus { border-color: var(--color-border-focus); background: var(--color-surface-input-focus); }
button {
font-family: var(--font-mono); font-size: var(--text-mono); font-weight: 500;
letter-spacing: 0.02em; line-height: 1;
color: var(--color-accent-text); background: var(--color-accent-dim);
border: 0.5px solid var(--color-border); border-left: 3px solid var(--color-accent);
padding: 10px 16px; cursor: pointer; white-space: nowrap;
transition: color var(--duration-fast) var(--ease-smooth),
background var(--duration-fast) var(--ease-smooth);
}
button:hover:not(:disabled) { background: var(--color-accent); color: var(--color-bg); }
button:active:not(:disabled) { transform: translateY(0.5px); }
button:disabled { opacity: 0.3; cursor: not-allowed; }
button.stop { color: var(--color-terminal-red); border-left-color: var(--color-terminal-red); background: rgba(255,95,86,0.10); }
button.stop:hover:not(:disabled) { background: var(--color-terminal-red); color: var(--color-bg); }
button.ghost {
background: transparent; color: var(--color-text-secondary);
border: 0.5px solid var(--color-border); border-left: 0.5px solid var(--color-border);
padding: 8px 12px;
}
button.ghost:hover:not(:disabled) { color: var(--color-text-primary); background: var(--color-surface-raised); border-color: var(--color-border-hover); }
button.danger:hover:not(:disabled) { color: var(--color-terminal-red); border-color: rgba(255,95,86,0.4); background: rgba(255,95,86,0.08); }
button.icon { padding: 8px 10px; }
/* ── layout ────────────────────────────────────────────────── */
main { flex: 1 1 auto; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 0; }
aside {
border-right: 0.5px solid var(--color-border);
background: var(--color-surface);
display: flex; flex-direction: column; min-height: 0;
}
/* recording strip */
.recbar {
display: none; flex: 0 0 auto; align-items: center; gap: var(--space-4);
padding: var(--space-3) var(--space-5);
background: var(--color-accent-dim);
border-bottom: 0.5px solid var(--color-accent-border);
}
.recbar.on { display: flex; }
.recbar .rectitle {
font-size: 14px; color: var(--color-text-secondary);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-terminal-red); animation: pulse 1.4s infinite; flex: 0 0 auto; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.2 } }
.elapsed { font-family: var(--font-mono); font-size: 15px; color: var(--color-accent-text); letter-spacing: 0.02em; }
.meters { display: flex; gap: var(--space-4); }
.meter-row { display: flex; align-items: center; gap: var(--space-2); }
.meter-row span { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-text-tertiary); }
.meter { width: 90px; height: 3px; background: rgba(255,255,255,0.10); position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 100% 0 0; background: var(--color-accent-text); transition: right 90ms linear; }
/* the start dialog */
.field { margin-bottom: var(--space-4); }
.field label { display: block; margin-bottom: var(--space-2); }
/* Stacked, not two columns. The label and the device name were side by side
with the label on a fixed width, so "los demás" wrapped onto a second line
in ten-pixel type while the device name it belonged to sat next to it. */
.devlist > div { margin-bottom: var(--space-3); }
.devlist > div:last-child { margin-bottom: 0; }
.devlist .what {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); text-transform: uppercase;
color: var(--color-text-tertiary); margin-bottom: 3px;
}
.devlist .which { font-size: 14px; line-height: 1.4; color: var(--color-text-primary); }
.devlist .which.missing { color: var(--color-terminal-amber); }
.note {
font-family: var(--font-mono); font-size: var(--text-mono-sm); line-height: 1.6;
letter-spacing: var(--tracking-mono-sm); color: var(--color-terminal-amber);
border-left: 2px solid var(--color-terminal-amber); padding-left: var(--space-3);
margin: var(--space-4) 0;
}
/* meeting list */
.listhead { padding: var(--space-4) var(--space-4) var(--space-2); display: flex; justify-content: space-between; align-items: baseline; }
.listhead .count { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-text-placeholder); }
#meetings { overflow-y: auto; flex: 1 1 auto; }
.meeting {
padding: var(--space-3) var(--space-4);
border-bottom: 0.5px solid var(--color-border);
cursor: pointer; border-left: 3px solid transparent;
transition: background var(--duration-fast) var(--ease-smooth);
}
.meeting:hover { background: var(--color-surface-raised); }
.meeting.active { background: var(--color-surface-raised); border-left-color: var(--color-accent); }
.meeting .t { font-size: 14px; margin-bottom: 4px; line-height: 1.3; }
.meeting .m {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
color: var(--color-text-tertiary); letter-spacing: var(--tracking-mono-sm);
display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap;
}
.pill {
border: 0.5px solid var(--color-border); padding: 1px 5px;
color: var(--color-text-tertiary);
}
.pill.pending { color: var(--color-terminal-amber); border-color: rgba(255,189,46,0.3); }
.pill.busy { color: var(--color-accent-text); border-color: var(--color-accent-border); }
/* The global search returns passages, which does not answer "open the pricing
one from Tuesday". Filtering the list by title does. */
.filterbox { padding: 0 var(--space-4) var(--space-3); }
.filterbox input { padding: 7px 10px; font-size: var(--text-mono-sm); }
.meeting.cursor { outline: 1px solid var(--color-accent-border); outline-offset: -1px; }
/* Keyboard users could not see where they were: hover was styled, focus was
not, and `title` tooltips never reach them at all. */
button:focus-visible, input:focus-visible, select:focus-visible,
.tab:focus-visible, .meeting:focus-visible, .turn:focus-visible {
outline: 2px solid var(--color-accent-text); outline-offset: 1px;
}
/* spaces: a label on a meeting, never a directory on disk */
.addspace {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-tertiary);
cursor: pointer;
}
.addspace:hover { color: var(--color-accent-text); }
.spacehead {
display: flex; align-items: center; gap: var(--space-2);
padding: var(--space-3) var(--space-4) var(--space-2);
cursor: pointer; user-select: none;
border-top: 0.5px solid var(--color-border);
}
.spacehead:hover .name { color: var(--color-text-primary); }
.spacehead .caret { font-size: 9px; color: var(--color-text-tertiary); width: 8px; }
.spacehead .name {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); text-transform: uppercase;
color: var(--color-text-secondary); flex: 1 1 auto;
}
.spacehead .n { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-text-placeholder); }
.spacehead .edit { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-text-placeholder); opacity: 0; }
.spacehead:hover .edit { opacity: 1; }
.spacehead .edit:hover { color: var(--color-accent-text); }
.meeting { padding-left: var(--space-5); }
select {
background: var(--color-surface-input); color: var(--color-text-primary);
border: 0.5px solid var(--color-border); font-family: var(--font-mono);
font-size: var(--text-mono); padding: 9px 10px; outline: none; cursor: pointer;
}
select:hover { border-color: var(--color-border-hover); }
/* ── editing the notes ─────────────────────────────────────── */
textarea {
width: 100%; background: var(--color-surface-input); color: var(--color-text-primary);
border: 0.5px solid var(--color-border); font-family: var(--font-sans); font-size: 15px;
line-height: var(--leading-body); padding: var(--space-3); outline: none; resize: vertical;
}
textarea:hover { border-color: var(--color-border-hover); }
textarea:focus { border-color: var(--color-border-focus); background: var(--color-surface-input-focus); }
.hint {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-placeholder);
margin: 4px 0 0;
}
.itemrow { display: grid; grid-template-columns: 1fr 150px 120px 30px; gap: var(--space-2); margin-bottom: var(--space-2); }
.quoterow { display: grid; grid-template-columns: 1fr 170px 30px; gap: var(--space-2); margin-bottom: var(--space-2); }
.drop {
background: transparent; border: 0.5px solid var(--color-border); border-left: 0.5px solid var(--color-border);
color: var(--color-text-placeholder); padding: 0; font-size: 14px; line-height: 1;
}
.drop:hover:not(:disabled) { color: var(--color-terminal-red); background: rgba(255,95,86,0.08); border-color: rgba(255,95,86,0.35); }
.editbar { display: flex; gap: var(--space-2); align-items: center; margin: var(--space-6) 0 0; }
.editbar .spacer { flex: 1 1 auto; }
.edited {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-placeholder);
}
/* a speaker name in the transcript, clickable like the title */
.turn .s.namable { cursor: text; }
.turn .s.namable:hover { text-decoration: underline dotted; }
.turn .s input {
font-family: var(--font-mono); font-size: var(--text-mono); padding: 2px 5px;
width: 150px; text-transform: none; letter-spacing: normal;
}
/* speaker proposals */
.prop { font-family: var(--font-mono); font-size: var(--text-mono-sm); line-height: 1.5; margin-top: 3px; }
.prop.high { color: var(--color-terminal-green); }
.prop.medium { color: var(--color-terminal-amber); }
.prop.low { color: var(--color-text-placeholder); }
.prop q { color: var(--color-text-tertiary); font-style: normal; }
/* ── main pane ─────────────────────────────────────────────── */
.panewrap { display: flex; flex-direction: column; min-height: 0; }
section.pane { overflow-y: auto; flex: 1 1 auto; padding: var(--space-8) var(--space-8) var(--space-12); }
.wrap { max-width: 780px; }
h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; margin: var(--space-2) 0 var(--space-3); }
h1 input { font-size: 32px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.025em; padding: 2px 6px; margin-left: -7px; }
/* Renaming was a button in a row of six. The title is the thing being renamed,
so it is the thing you click. */
h1.editable { cursor: text; display: inline-block; padding: 0 6px; margin-left: -6px;
border-bottom: 1px solid transparent;
transition: border-color var(--duration-fast) var(--ease-smooth),
background var(--duration-fast) var(--ease-smooth); }
h1.editable:hover { background: var(--color-surface-raised); border-bottom-color: var(--color-border-hover); }
h2 { font-size: 15px; font-weight: 500; margin: var(--space-8) 0 var(--space-3); letter-spacing: -0.01em; }
p, li { color: var(--color-text-secondary); line-height: var(--leading-body); }
ul { padding-left: 1.1em; margin: 0; }
li { margin-bottom: var(--space-2); }
hr { border: none; border-top: 0.5px solid var(--color-border); margin: var(--space-6) 0; }
.meta-line {
font-family: var(--font-mono); font-size: var(--text-mono);
color: var(--color-text-tertiary); margin-bottom: var(--space-5);
display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center;
}
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.tabs { display: flex; gap: var(--space-5); border-bottom: 0.5px solid var(--color-border); margin-bottom: var(--space-6); }
.tab {
font-family: var(--font-mono); font-size: var(--text-mono); color: var(--color-text-tertiary);
padding: var(--space-2) 0 var(--space-3); cursor: pointer;
border-bottom: 2px solid transparent; margin-bottom: -1px;
transition: color var(--duration-fast) var(--ease-smooth);
}
.tab:hover { color: var(--color-text-secondary); }
.tab.active { color: var(--color-text-primary); border-bottom-color: var(--color-accent); }
.task { list-style: none; margin-left: -1.1em; }
.task::before { content: '□'; color: var(--color-text-tertiary); margin-right: var(--space-2); }
.who { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-accent-text); margin-left: var(--space-2); letter-spacing: var(--tracking-mono-sm); }
blockquote {
margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4);
background: var(--color-accent-dim); border-left: 3px solid var(--color-accent);
color: var(--color-text-primary);
}
blockquote .who { display: block; margin: var(--space-2) 0 0; text-transform: uppercase; color: var(--color-text-tertiary); }
/* transcript */
.turn {
display: grid; grid-template-columns: 54px 1fr; gap: var(--space-4);
padding: var(--space-2) var(--space-3); margin: 0 calc(var(--space-3) * -1) var(--space-1);
cursor: pointer; border-left: 2px solid transparent;
transition: background var(--duration-fast) var(--ease-smooth);
}
.turn:hover { background: var(--color-surface-raised); }
.turn .t { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--color-text-placeholder); padding-top: 6px; }
.turn:hover .t { color: var(--color-accent-text); }
.turn .s {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); text-transform: uppercase;
color: var(--sp, var(--color-text-tertiary)); margin-bottom: 2px;
}
.turn p { margin: 0; }
.turn.at { background: var(--color-accent-dim); border-left-color: var(--color-accent); }
.turn.now { background: var(--color-accent-dim); border-left-color: var(--color-accent-text); }
.turn.now p { color: var(--color-text-primary); }
/* speakers editor */
.speakers { border: 0.5px solid var(--color-border); padding: var(--space-4); margin-bottom: var(--space-6); background: var(--color-surface); }
.speakers .grid { display: grid; grid-template-columns: 130px 1fr; gap: var(--space-3); align-items: center; margin-top: var(--space-3); }
.speakers code { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--color-text-tertiary); }
.speakers .row { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
/* search results */
.hit { padding: var(--space-4) 0; border-bottom: 0.5px solid var(--color-border); cursor: pointer; }
.hit:hover .hit-text { color: var(--color-text-primary); }
.hit-head { font-family: var(--font-mono); font-size: var(--text-mono-sm); letter-spacing: var(--tracking-mono-sm); color: var(--color-text-tertiary); margin-bottom: var(--space-2); }
.hit-head b { color: var(--color-text-secondary); font-weight: 400; }
.hit-head .sp { color: var(--color-accent-text); }
.hit-text { color: var(--color-text-secondary); line-height: var(--leading-body); transition: color var(--duration-fast) var(--ease-smooth); }
/* states */
.empty { color: var(--color-text-tertiary); font-family: var(--font-mono); font-size: var(--text-mono); line-height: 1.9; }
.empty b { display: block; color: var(--color-text-secondary); font-weight: 400; font-size: 14px; font-family: var(--font-sans); margin-bottom: var(--space-2); }
.blank { display: flex; height: 100%; align-items: center; justify-content: center; text-align: center; }
.warn { color: var(--color-terminal-red); font-family: var(--font-mono); font-size: var(--text-mono); margin-bottom: var(--space-4); }
.skeleton { height: 12px; background: var(--color-surface-raised); margin-bottom: var(--space-3); animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { 0%,100% { opacity: 0.4 } 50% { opacity: 0.85 } }
/* ── the processing wait ───────────────────────────────────── */
/* This used to be raw terminal output scrolling in a box, for up to half an
hour on a long meeting. Named steps with a real bar is the same information
with the shape of a progress report instead of a log tail. */
.steps { border: 0.5px solid var(--color-border); margin-bottom: var(--space-4); }
.stepline {
display: grid; grid-template-columns: 16px 1fr auto; gap: var(--space-3);
align-items: baseline; padding: var(--space-3) var(--space-4);
border-bottom: 0.5px solid var(--color-border);
}
.stepline:last-child { border-bottom: none; }
.stepline .mark { font-family: var(--font-mono); font-size: var(--text-mono); }
.stepline .what { font-size: 14px; color: var(--color-text-secondary); }
.stepline .side {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-tertiary);
white-space: nowrap;
}
.stepline.done .mark { color: var(--color-terminal-green); }
.stepline.done .what { color: var(--color-text-tertiary); }
.stepline.running .mark { color: var(--color-accent-text); }
.stepline.running .what { color: var(--color-text-primary); }
.stepline.failed .mark, .stepline.failed .side { color: var(--color-terminal-red); }
.stepline.skipped .mark, .stepline.skipped .what { color: var(--color-text-placeholder); }
.stepline.waiting .mark, .stepline.waiting .what { color: var(--color-text-placeholder); }
.bar { grid-column: 2 / 4; height: 3px; background: var(--color-surface-raised); position: relative; margin-top: 6px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--color-accent); transition: width 220ms var(--ease-smooth); }
.bar.pulse i { width: 100% !important; opacity: 0.28; animation: shimmer 1.6s ease-in-out infinite; }
.disclose {
font-family: var(--font-mono); font-size: var(--text-mono-sm);
letter-spacing: var(--tracking-mono-sm); color: var(--color-text-tertiary);
cursor: pointer; user-select: none; margin-bottom: var(--space-4);
}
.disclose:hover { color: var(--color-accent-text); }
pre.log {
font-family: var(--font-mono); font-size: 11px; line-height: 1.65;
background: var(--color-surface); border: 0.5px solid var(--color-border);
border-left: 3px solid var(--color-accent);
padding: var(--space-3) var(--space-4); overflow-x: auto;
color: var(--color-text-secondary); white-space: pre-wrap; margin: 0 0 var(--space-6);
max-height: 300px; overflow-y: auto;
}
pre.log.failed { border-left-color: var(--color-terminal-red); }
/* ── player ────────────────────────────────────────────────── */
.player {
flex: 0 0 auto; height: var(--player);
border-top: 0.5px solid var(--color-border); background: var(--color-surface);
display: none; align-items: center; gap: var(--space-4); padding: 0 var(--space-6);
}
.player.on { display: flex; }
.player .time { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--color-text-tertiary); white-space: nowrap; }
.player .time b { color: var(--color-text-primary); font-weight: 400; }
.seek { flex: 1 1 auto; height: 20px; display: flex; align-items: center; cursor: pointer; }
.seek .track { width: 100%; height: 3px; background: var(--color-surface-raised); position: relative; }
.seek .fill { position: absolute; inset: 0 auto 0 0; background: var(--color-accent); width: 0%; }
.seek .head { position: absolute; top: -3px; width: 2px; height: 9px; background: var(--color-accent-text); left: 0%; }
.follow { font-family: var(--font-mono); font-size: var(--text-mono-sm); letter-spacing: var(--tracking-mono-sm); color: var(--color-text-tertiary); cursor: pointer; user-select: none; white-space: nowrap; }
.follow.on { color: var(--color-accent-text); }
/* ── toasts and modal ──────────────────────────────────────── */
#toasts { position: fixed; bottom: var(--space-6); right: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); z-index: 40; }
.toast {
font-family: var(--font-mono); font-size: var(--text-mono);
background: var(--color-surface-raised); border: 0.5px solid var(--color-border);
border-left: 3px solid var(--color-accent); color: var(--color-text-secondary);
padding: var(--space-3) var(--space-4); max-width: 420px;
animation: rise var(--duration-normal) var(--ease-smooth);
}
.toast.bad { border-left-color: var(--color-terminal-red); color: var(--color-terminal-red); }
.toast.good { border-left-color: var(--color-terminal-green); }
@keyframes rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--color-surface); border: 0.5px solid var(--color-border-hover); padding: var(--space-6); width: 440px; max-width: calc(100vw - 32px); }
.modal h3 { margin: var(--space-2) 0 var(--space-3); font-size: 18px; font-weight: 500; }
.modal p { margin: 0 0 var(--space-5); }
.modal .row { display: flex; gap: var(--space-2); justify-content: flex-end; }
</style>
</head>
<body>
<header>
<div class="brand">helmcode<b>·</b>whisper</div>
<div class="searchbox">
<input type="text" id="search" placeholder="buscar en todo el histórico…">
<div class="k">ctrl k</div>
</div>
<select id="scope" title="Limitar la búsqueda a un espacio"></select>
<div class="statuses" id="statuses"></div>
<button id="rec">● nueva reunión</button>
</header>
<!-- While a take is running this sits across the whole width: you should not be
able to forget that the microphone is open. -->
<div class="recbar" id="recbar">
<div class="dot"></div>
<div class="eyebrow">grabando</div>
<div class="elapsed" id="elapsed">00:00:00</div>
<div id="meters" class="meters"></div>
<div class="rectitle" id="rectitle"></div>
<button id="recstop" class="stop">■ parar</button>
</div>
<main>
<aside>
<div class="listhead">
<div class="eyebrow">reuniones</div>
<div style="display:flex;gap:10px;align-items:baseline">
<div class="count" id="count"></div>
<div class="addspace" id="addspace" title="Crear un espacio">+ espacio</div>
</div>
</div>
<div class="filterbox">
<input type="text" id="filter" placeholder="filtrar por título…">
</div>
<div id="meetings"></div>
</aside>
<div class="panewrap">
<section class="pane"><div class="wrap" id="pane"></div></section>
<div class="player" id="player">
<button class="ghost icon" id="pp">▶</button>
<div class="time"><b id="cur">00:00</b> / <span id="dur">00:00</span></div>
<div class="seek" id="seek"><div class="track"><div class="fill" id="fill"></div><div class="head" id="head"></div></div></div>
<div class="follow on" id="follow"
title="Cuando está activo, la transcripción hace scroll sola para seguir el audio.
Desactívalo para leer otra parte sin que te arrastre.">↓ autoscroll</div>
</div>
</div>
</main>
<audio id="audio" preload="metadata"></audio>
<div id="toasts"></div>
<script>
const $ = (id) => document.getElementById(id);
let state = { recording: null, processing: null, meetings: [], devices: {}, home: '' };
let selected = null, detail = null, tab = 'notes', searching = false;
let highlightAt = null, editingSpeakers = false, nowTurn = -1, following = true;
let speakerProposals = {};
let editingNotes = false;
const audio = $('audio');
const hms = (s) => {
s = Math.max(0, Math.floor(s || 0));
return [s/3600, (s%3600)/60, s%60].map(n => String(Math.floor(n)).padStart(2,'0')).join(':');
};
const mmss = (s) => {
s = Math.max(0, Math.floor(s || 0));
return String(Math.floor(s/60)).padStart(2,'0') + ':' + String(s%60).padStart(2,'0');
};
const esc = (t) => (t ?? '').toString().replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c]));
async function api(path, options) {
const response = await fetch(path, options);
const data = await response.json();
if (data.error) throw new Error(data.error);
return data;
}
const post = (path, body) => api(path, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body || {})
});
// ── toasts and modal ──────────────────────────────────────
function toast(message, kind = '') {
const el = document.createElement('div');
el.className = 'toast ' + kind;
el.textContent = message;
$('toasts').appendChild(el);
setTimeout(() => el.remove(), kind === 'bad' ? 7000 : 4000);
}
function confirmDialog(title, message, confirmLabel) {
return new Promise(resolve => {
const scrim = document.createElement('div');
scrim.className = 'scrim';
scrim.innerHTML = `<div class="modal">
<div class="eyebrow">confirmar</div><h3>${esc(title)}</h3><p>${esc(message)}</p>
<div class="row"><button class="ghost" data-no>cancelar</button>
<button class="ghost danger" data-yes>${esc(confirmLabel)}</button></div></div>`;
const close = (value) => { scrim.remove(); document.removeEventListener('keydown', onKey); resolve(value); };
const onKey = (event) => { if (event.key === 'Escape') close(false); };
scrim.querySelector('[data-no]').onclick = () => close(false);
scrim.querySelector('[data-yes]').onclick = () => close(true);
scrim.onclick = (event) => { if (event.target === scrim) close(false); };
document.addEventListener('keydown', onKey);
document.body.appendChild(scrim);
});
}
// ── polling ───────────────────────────────────────────────
let wasProcessing = null;
async function refresh() {
try { state = await api('/api/state'); } catch (e) { return; }
renderStatuses();
renderScope();
renderRecord();
renderMeetings();
const now = state.processing;
// The moment processing finishes, the notes exist on disk but `detail` still
// holds the copy fetched before the run — the one with no notes in it. The
// old code stopped re-rendering exactly then, so the pane sat on "procesando…"
// until you clicked away and back. Refetch on the transition instead.
const justFinished = now && now.done && wasProcessing && !wasProcessing.done
&& wasProcessing.meeting === now.meeting;
wasProcessing = now ? { meeting: now.meeting, done: now.done } : null;
if (searching) return;
if (justFinished && now.meeting === selected) {
toast(now.failed ? 'el procesado falló' : 'notas listas', now.failed ? 'bad' : 'good');
await select(now.meeting);
} else if (now && !now.done && now.meeting === selected) {
// Only when it is *this* meeting: rebuilding the pane under someone who is
// reading another one throws away their scroll position.
renderDetail();
}
}
function schedule() {
const processing = state.processing && !state.processing.done;
// Recording needs 400ms because the meters have to move. Processing does not:
// the steps change every few minutes, and a long diarization would otherwise
// mean thousands of pointless round trips.
const wait = state.recording ? 400 : (processing ? 1200 : 4000);
setTimeout(async () => { await refresh(); schedule(); }, wait);
}
// ── header ────────────────────────────────────────────────
function renderScope() {
const spaces = state.spaces || [];
const picker = $('scope');
picker.style.display = spaces.length ? 'block' : 'none';
if (!spaces.length) return;
const current = picker.value;
picker.innerHTML = `<option value="">todo</option>`
+ spaces.map(s => `<option value="${esc(s)}">${esc(s)}</option>`).join('');
picker.value = spaces.includes(current) ? current : '';
}
function renderStatuses() {
const devices = state.devices || {};
const bits = [
{ label: 'micrófono', ok: !!devices.mic, detail: devices.mic || 'no se ha encontrado ninguno',
level: 'bad' },
{ label: 'audio del sistema', ok: !!devices.system,
detail: devices.system || 'sin loopback: solo se grabaría tu micrófono', level: 'warn' },
{ label: 'api', ok: !!state.has_key,
detail: state.has_key ? 'clave encontrada' : 'sin HELMCODE_API_KEY: grabar sí, procesar no',
level: 'warn' },
];
$('statuses').innerHTML = bits.map(b =>
`<div class="status ${b.ok ? '' : b.level}" title="${esc(b.detail)}">
<i></i><span>${b.label}</span></div>`).join('');
}
function renderRecord() {
const live = state.recording;
$('recbar').classList.toggle('on', !!live);
$('rec').disabled = !!live || !(state.devices || {}).mic;
if (!live) return;
$('elapsed').textContent = hms(live.elapsed);
$('rectitle').textContent = live.title || '';
$('meters').innerHTML = live.tracks.map(t => `
<div class="meter-row">
<span>${t.label === 'me' ? 'tú' : 'sistema'}</span>
<div class="meter"><i style="right:${Math.max(0, 100 - Math.min(100, t.level*160))}%"></i></div>
</div>`).join('');
}
// Starting a take is a decision with a pre-flight: which devices are about to
// be used, and whether one of them is missing. That does not fit next to a
// search field, so it gets a dialog of its own.
$('rec').onclick = () => {
const devices = state.devices || {};
// The event on the calendar right now is almost always the meeting being
// recorded, so it becomes the suggested title and, more usefully, brings the
// invitee list along for naming the voices later.
const suggestion = state.calendar?.now || null;
let uid = suggestion?.uid || '';
const scrim = document.createElement('div');
scrim.className = 'scrim';
scrim.innerHTML = `<div class="modal">
<div class="eyebrow">nueva reunión</div>
<h3>Grabar</h3>
${suggestion ? `<p style="margin:0 0 16px">Según el calendario ahora mismo tienes
<b style="color:var(--color-text-primary);font-weight:400">${esc(suggestion.summary)}</b>${
suggestion.people?.length ? ` con ${esc(suggestion.people.join(', '))}` : ''}.</p>` : ''}
<div class="field">
<label class="eyebrow">título</label>
<input type="text" id="newmeeting" placeholder="reunión"
value="${esc(suggestion?.summary || '')}">
</div>
<div class="field">
<label class="eyebrow">se va a grabar de</label>
<div class="devlist">
<div>
<div class="what">tú · micrófono</div>
<div class="which ${devices.mic ? '' : 'missing'}">${
esc(devices.mic || 'ningún micrófono encontrado')}</div>
</div>
<div>
<div class="what">los demás · audio del sistema</div>
<div class="which ${devices.system ? '' : 'missing'}">${
esc(devices.system || 'sin audio de sistema')}</div>
</div>
</div>
</div>
${devices.system ? '' : `<div class="note">Sin audio de sistema solo se grabará tu
micrófono, así que de la reunión se transcribirá únicamente lo que digas tú.</div>`}
<div class="note">Grabar a alguien sin decírselo es ilegal en muchos sitios y una mala
idea en todos. Dilo antes de empezar.</div>
<div class="row">
<button class="ghost" data-no>cancelar</button>
<button data-yes ${devices.mic ? '' : 'disabled'}>empezar a grabar</button>
</div></div>`;
const close = () => { scrim.remove(); document.removeEventListener('keydown', onKey); };
const start = async () => {
const title = $('newmeeting').value.trim() || 'reunión';
close();
try {
const started = await post('/api/record/start', { title });
// Attach the calendar event now rather than after the meeting: the
// invitee list is what the speaker-name guesser needs, and remembering
// to come back and link it later is exactly what nobody does.
if (uid) {
try { await post('/api/calendar/attach', { meeting: started.meeting, uid }); }
catch { toast('grabando, pero no pude vincular el evento del calendario'); }
}
await refresh();
} catch (e) { toast(e.message, 'bad'); }
};
const onKey = (event) => {
if (event.key === 'Escape') close();
if (event.key === 'Enter' && devices.mic) start();
};
scrim.querySelector('[data-no]').onclick = close;
scrim.querySelector('[data-yes]').onclick = start;
scrim.onclick = (event) => { if (event.target === scrim) close(); };
document.addEventListener('keydown', onKey);
document.body.appendChild(scrim);
$('newmeeting').focus();
};
$('recstop').onclick = async () => {
$('recstop').disabled = true;
try {
const result = await post('/api/record/stop');
await refresh();
await select(result.meeting);
if (result.silent_tracks?.length) {
toast('pistas en silencio: ' + result.silent_tracks.join(', ') + ' — revisa el dispositivo', 'bad');
} else if (result.processing) {
toast('grabación guardada · ' + hms(result.seconds) + ' — procesando', 'good');
} else {
toast('grabación guardada · ' + hms(result.seconds), 'good');
}
} catch (e) { toast(e.message, 'bad'); }
$('recstop').disabled = false;
};
// ── meetings ──────────────────────────────────────────────
const UNASSIGNED = '__none__';
let collapsed = new Set(JSON.parse(localStorage.getItem('hcw-collapsed') || '[]'));
let filterText = '';
function meetingRow(m, busyOn) {
return `<div class="meeting ${m.name === selected ? 'active' : ''}" data-name="${esc(m.name)}">
<div class="t">${esc(m.title)}</div>
<div class="m">
<span>${esc(m.date)}</span><span>${mmss(m.seconds)}</span>
${m.name === busyOn ? '<span class="pill busy">procesando</span>'
: (m.processed ? '' : '<span class="pill pending">sin procesar</span>')}
${(m.speakers || []).length ? `<span class="pill">${m.speakers.length} voces</span>` : ''}
</div>
</div>`;
}
function visibleMeetings() {
const needle = filterText.trim().toLowerCase();
if (!needle) return state.meetings;
return state.meetings.filter(m =>
(m.title || '').toLowerCase().includes(needle) || (m.date || '').includes(needle));
}
function renderMeetings() {
const busyOn = state.processing && !state.processing.done ? state.processing.meeting : null;
const spaces = state.spaces || [];
const shown = visibleMeetings();
$('count').textContent = filterText.trim()
? `${shown.length}/${state.meetings.length}` : (state.meetings.length || '');
if (!state.meetings.length && !spaces.length) {
$('meetings').innerHTML = `<div class="listhead empty">
<b>Todavía nada</b>dale a nueva reunión arriba a la derecha</div>`;
return;
}
if (!shown.length) {
$('meetings').innerHTML = `<div class="listhead empty">nada con “${esc(filterText)}”</div>`;
return;
}
// Every declared space gets a group even when it is empty — that is the point
// of keeping a registry instead of deriving the list from the meetings. While
// a filter is active, empty groups are noise, so they go.
const groups = new Map(spaces.map(name => [name, []]));
groups.set(UNASSIGNED, []);
for (const m of shown) {
const key = m.space && groups.has(m.space) ? m.space : UNASSIGNED;
groups.get(key).push(m);
}
if (filterText.trim()) {
for (const [name, items] of [...groups]) if (!items.length) groups.delete(name);
}
let html = '';
for (const [name, items] of groups) {
const unassigned = name === UNASSIGNED;
if (unassigned && !items.length) continue;
const shut = collapsed.has(name);
html += `<div class="spacehead" data-space="${esc(name)}">
<div class="caret">${shut ? '▶' : '▼'}</div>
<div class="name">${unassigned ? 'sin asignar' : esc(name)}</div>
<div class="n">${items.length}</div>
${unassigned ? '' : `<div class="edit" data-editspace="${esc(name)}">···</div>`}
</div>`;
if (!shut) {
html += items.map(m => meetingRow(m, busyOn)).join('')
|| `<div class="meeting empty" style="cursor:default">vacío</div>`;
}
}
$('meetings').innerHTML = html;
document.querySelectorAll('.meeting[data-name]').forEach(el => {
el.onclick = () => select(el.dataset.name);
});
document.querySelectorAll('.spacehead').forEach(el => {
el.onclick = (event) => {
if (event.target.dataset.editspace) return;
const key = el.dataset.space;
collapsed.has(key) ? collapsed.delete(key) : collapsed.add(key);
localStorage.setItem('hcw-collapsed', JSON.stringify([...collapsed]));
renderMeetings();
};
});
document.querySelectorAll('[data-editspace]').forEach(el => {
el.onclick = (event) => { event.stopPropagation(); editSpace(el.dataset.editspace); };
});
}
$('filter').oninput = () => { filterText = $('filter').value; renderMeetings(); };
$('filter').onkeydown = (event) => {
if (event.key === 'Escape') { $('filter').value = ''; filterText = ''; renderMeetings(); }
if (event.key === 'Enter') {
const first = visibleMeetings()[0];
if (first) { $('filter').blur(); select(first.name); }
}
};
$('addspace').onclick = async () => {
const name = await promptDialog('Nuevo espacio', 'Nombre del espacio', '');
if (!name) return;
try {
await post('/api/spaces', { action: 'create', name });
await refresh();
} catch (e) { toast(e.message, 'bad'); }
};
async function editSpace(name) {
const next = await promptDialog(
'Espacio', 'Nombre del espacio. Vacío para borrarlo — las reuniones no se borran, '
+ 'se quedan sin asignar.', name);
if (next === null) return;
try {
if (!next.trim()) {
const result = await post('/api/spaces', { action: 'delete', name });
toast(`espacio borrado · ${result.freed} reuniones sin asignar`);
} else if (next.trim() !== name) {
const result = await post('/api/spaces', { action: 'rename', from: name, to: next.trim() });
toast(`renombrado · ${result.moved} reuniones movidas`, 'good');
}
await refresh();
if (selected) await select(selected);
} catch (e) { toast(e.message, 'bad'); }
}
function promptDialog(title, message, value) {
return new Promise(resolve => {
const scrim = document.createElement('div');
scrim.className = 'scrim';
scrim.innerHTML = `<div class="modal">
<div class="eyebrow">espacios</div><h3>${esc(title)}</h3>
<p>${esc(message)}</p>
<div class="field"><input type="text" id="promptvalue" value="${esc(value)}"></div>
<div class="row"><button class="ghost" data-no>cancelar</button>
<button data-yes>guardar</button></div></div>`;
const close = (v) => { scrim.remove(); document.removeEventListener('keydown', onKey); resolve(v); };
const onKey = (e) => {
if (e.key === 'Escape') close(null);
if (e.key === 'Enter') close(scrim.querySelector('#promptvalue').value);
};
scrim.querySelector('[data-no]').onclick = () => close(null);
scrim.querySelector('[data-yes]').onclick = () => close(scrim.querySelector('#promptvalue').value);
scrim.onclick = (e) => { if (e.target === scrim) close(null); };
document.addEventListener('keydown', onKey);
document.body.appendChild(scrim);
const input = scrim.querySelector('#promptvalue');
input.focus(); input.select();
});
}
async function select(name, options = {}) {
searching = false;
$('search').value = '';
const changed = name !== selected;
selected = name;
tab = options.tab || 'notes';
highlightAt = options.at ?? null;
editingSpeakers = false;
if (changed) { $('pane').innerHTML = skeleton(); detachAudio(); }
try {
detail = await api('/api/meeting?name=' + encodeURIComponent(name));
} catch (e) {
detail = null;
$('pane').innerHTML = `<div class="warn">${esc(e.message)}</div>`;
return;
}
renderMeetings();
renderDetail();
if (changed) attachAudio(name);
if (highlightAt !== null) {
const turn = document.querySelector('.turn.at');
if (turn) turn.scrollIntoView({ block: 'center', behavior: 'smooth' });
if (detail.has_audio) seekTo(highlightAt);
}
}
const skeleton = () => `<div style="max-width:520px">
<div class="skeleton" style="width:35%;height:9px"></div>
<div class="skeleton" style="width:70%;height:26px;margin-bottom:24px"></div>
${'<div class="skeleton"></div>'.repeat(4)}
<div class="skeleton" style="width:60%"></div></div>`;
// ── detail ────────────────────────────────────────────────
const SPEAKER_VARS = ['--sp-0','--sp-1','--sp-2','--sp-3','--sp-4'];
function speakerColor(name) {
const list = (detail?.raw_speakers || []);
const mapped = Object.entries(detail?.speaker_names || {});
let index = list.indexOf(name);
if (index < 0) {
const raw = mapped.find(([, value]) => value === name);
index = raw ? list.indexOf(raw[0]) : -1;
}
if (name === 'Me' || name === 'Yo') return 'var(--color-accent-text)';
return `var(${SPEAKER_VARS[(index < 0 ? 0 : index) % SPEAKER_VARS.length]})`;
}
function renderDetail() {
if (searching) return;
if (!selected || !detail) {
$('pane').innerHTML = `<div class="blank">${
state.meetings.length ? `<div class="empty">
<b>Nada seleccionado</b>elige una reunión de la izquierda,<br>
o muévete con <code>j</code> y <code>k</code></div>` : firstRun()}</div>`;
if (!state.meetings.length) wireRows();
return;
}
const meta = detail.meta || {};
const proc = state.processing && state.processing.meeting === selected ? state.processing : null;
const running = proc && !proc.done;
let html = `<div class="eyebrow">notas de reunión</div>
<h1 id="h1" class="editable" title="Clic para cambiar el título">${
esc(meta.title || selected)}</h1>
<div class="meta-line">
<span>${esc((meta.started_at || '').replace('T',' ').slice(0,16))}</span>
<span>${Math.round((meta.duration_seconds||0)/60)} min</span>
${(meta.speakers||[]).length ? `<span>${(detail.raw_speakers||[]).length} voces</span>` : ''}
${meta.language ? `<span>${esc(meta.language)}</span>` : ''}