-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork-log.html
More file actions
906 lines (840 loc) · 45.2 KB
/
work-log.html
File metadata and controls
906 lines (840 loc) · 45.2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="ADHD-friendly work tracker — log tasks, run timers, plan your day, and export a daily summary. Runs entirely in your browser.">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src https://api.open-meteo.com http://localhost:* http://127.0.0.1:*; img-src 'self' data:; font-src 'none'; object-src 'none'; base-uri 'self'; form-action 'none'">
<title>Work Log</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="header" role="banner">
<!-- Col 1: date + wall-clock + weather + rain -->
<div class="header-left">
<div class="live-date" id="liveDate"></div>
<div class="live-time" id="liveTime" aria-label="Current time"></div>
<div class="header-weather" id="liveWeather"></div>
<div class="header-rain" id="liveRain"></div>
</div>
<!-- Col 2: almanac — sunrise/sunset, week/moon, flag day, name day -->
<div class="header-center" aria-label="Almanac">
<div class="header-almanac-line" id="liveSunrise"></div>
<div class="header-almanac-line">
<span id="liveWeek"></span><span class="header-almanac-sep" aria-hidden="true"> · </span><span id="liveMoon"></span>
</div>
<div class="header-almanac-line" id="liveFlagDay"></div>
<div class="header-almanac-line" id="liveNameday"></div>
</div>
<!-- Col 3: date nav + session chip -->
<div class="date-nav-wrap">
<button type="button" class="date-nav-location" id="dateNavLocation" aria-live="polite" aria-atomic="true">
<span class="date-nav-location__emoji" aria-hidden="true"></span>
<span class="date-nav-location__label"></span>
</button>
<div class="date-nav">
<button class="nav-btn" id="prevDay" aria-label="Previous day">←</button>
<div class="date-label" id="dateLabel" aria-live="polite" aria-atomic="true"></div>
<button class="nav-btn" id="nextDay" aria-label="Next day">→</button>
</div>
<button class="session-chip" id="sodBtn">start the day</button>
</div>
</div>
<!-- Calendar meeting strip -->
<!-- ── Hero Card — unified timer state (Variant C) ── -->
<!-- Always present; state modifier class controls which inner panel is visible. -->
<div id="heroCard" class="hero-card hero-card--idle" role="status" aria-label="Timer">
<!-- ① IDLE — nothing tracking -->
<div class="hero-panel hero-idle" id="heroPanelIdle">
<div class="hero-inner">
<div class="hero-left">
<div class="hero-eyebrow hero-eyebrow--idle" aria-hidden="true">
<span class="hero-dot-idle" aria-hidden="true"></span>
Not tracking
</div>
<div class="hero-logged-row">
<span class="hero-clock hero-clock--dim" id="heroLoggedToday" aria-label="Total logged today">0h 0m</span>
<span class="hero-sub">logged today</span>
</div>
<div class="hero-sub" id="heroIdleLastSession"></div>
</div>
<div class="hero-middle">
<div class="hero-whats-next-hdr" aria-hidden="true">What's next?</div>
<input class="hero-composer" id="heroComposerInput"
placeholder="paste a Jira ticket, or pick from recent…"
autocomplete="off"
aria-label="Task description — press Enter or click Start to begin tracking"/>
<ul class="hero-recent-chips" id="heroRecentChips" aria-label="Recent tasks"></ul>
</div>
<div class="hero-right">
<button class="hero-btn hero-btn--ghost" id="heroIdleBreakBtn" aria-label="Log a break">☕ Break</button>
<button class="hero-btn hero-btn--start" id="heroStartBtn" aria-label="Start tracking">▶ Start tracking</button>
</div>
</div>
</div>
<!-- ② RUNNING — timer active -->
<div class="hero-panel hero-running" id="heroPanelRunning" style="display:none">
<div class="hero-inner">
<div class="hero-left">
<div class="hero-eyebrow hero-eyebrow--running" aria-hidden="true">
<span class="hero-pulse-dot" aria-hidden="true"></span>
Now tracking
</div>
<div class="hero-clock" id="timerElapsed" aria-label="Elapsed time" aria-live="polite">0:00:00</div>
<div class="hero-sub" id="heroRunningMeta"></div>
</div>
<div class="hero-middle">
<div class="hero-task-category" id="heroTaskCategory"></div>
<div class="hero-task-title" id="timerTask" aria-live="polite" aria-atomic="true"></div>
<div class="hero-sub hero-task-note-ref" id="heroTaskNoteRef"></div>
</div>
<div class="hero-right">
<!-- Mood dropdown — kept so initBannerControls() bindings stay valid -->
<div class="hero-mood-wrap" id="tbMoodWrap">
<button class="hero-btn hero-btn--ghost" id="tbMoodBtn"
aria-haspopup="true" aria-expanded="false" aria-label="Set mood">
<span id="tbMoodIcon" aria-hidden="true">🎯</span>
<span id="tbMoodLabel">focus</span>
<span aria-hidden="true">▾</span>
</button>
<div class="tb-mood-panel" id="tbMoodPanel" role="menu" style="display:none">
<button class="tb-mood-item" role="menuitem" data-mood="distracted" data-icon="😖">😖 distracted</button>
<button class="tb-mood-item" role="menuitem" data-mood="parked" data-icon="💭">💭 parked thought</button>
<button class="tb-mood-item" role="menuitem" data-mood="focus" data-icon="🌋">🌋 in the zone</button>
<button class="tb-mood-item" role="menuitem" data-mood="interesting" data-icon="✨">✨ interesting!</button>
</div>
</div>
<button class="hero-btn hero-btn--ghost" id="timerPause" aria-label="Pause timer">⏸ pause</button>
<button class="hero-btn hero-btn--stop" id="timerStop" aria-label="Stop timer">■ stop</button>
</div>
</div>
<!-- Note / utility row -->
<div class="hero-note-row" id="heroNoteRow">
<label class="hero-note-label" for="tbNoteInput">↳</label>
<input class="hero-note-input" id="tbNoteInput"
aria-label="Quick note on the current task"
placeholder="add a quick note to this session… (↵ saves)" autocomplete="off"/>
<span class="hero-note-hint" aria-hidden="true">↵</span>
<span class="hero-note-div" aria-hidden="true"></span>
<button class="hero-util-pill" id="tbBreakBtn" aria-label="Log a break">☕ Break</button>
<button class="hero-util-pill" id="tbLunchBtn" aria-label="Log lunch">🥪 Lunch</button>
<button class="hero-util-pill" id="tbMeetingBtn" aria-label="Log a meeting">👥 Meeting</button>
</div>
<!-- Park-a-distraction row — captures a thought without stopping the timer -->
<div class="hero-park-row" id="heroParkRow">
<label class="hero-note-label" for="heroParkInput">💡</label>
<input class="hero-note-input" id="heroParkInput"
aria-label="Park a distracting thought without stopping the timer"
placeholder="park a distraction… (↵ saves to Parked Thoughts)" autocomplete="off"/>
<span class="hero-note-hint" aria-hidden="true">↵</span>
</div>
</div>
<!-- ③ PAUSED — timer on hold -->
<div class="hero-panel hero-paused" id="heroPanelPaused" style="display:none">
<div class="hero-inner">
<div class="hero-left">
<div class="hero-eyebrow hero-eyebrow--paused" aria-hidden="true">
<span class="hero-dot-paused" aria-hidden="true"></span>
Paused
</div>
<div class="hero-clock hero-clock--paused" id="heroPausedElapsed" aria-label="Elapsed time">0:00:00</div>
<div class="hero-sub" id="heroPausedMeta"></div>
</div>
<div class="hero-middle">
<div class="hero-task-category" id="heroPausedCategory"></div>
<div class="hero-task-title" id="heroPausedTask"></div>
<div class="hero-sub" id="heroPausedNoteRef"></div>
</div>
<div class="hero-right">
<button class="hero-btn hero-btn--ghost" id="heroPausedFocusBtn" aria-label="Set mood">🎯 focus ▾</button>
<button class="hero-btn hero-btn--resume" id="heroResumeBtn" aria-label="Resume timer">▶ resume</button>
<button class="hero-btn hero-btn--ghost" id="heroPausedStopBtn" aria-label="Stop timer">■ stop</button>
</div>
</div>
</div>
<!-- ④ STOPPED — 6-second confirmation window -->
<div class="hero-panel hero-stopped" id="heroPanelStopped" style="display:none">
<div class="hero-inner">
<div class="hero-left">
<div class="hero-eyebrow hero-eyebrow--stopped" aria-hidden="true">
<span class="hero-dot-stopped" aria-hidden="true"></span>
Logged
</div>
<div class="hero-clock hero-clock--stopped" id="heroStoppedElapsed" aria-label="Session duration">0:00:00</div>
<div class="hero-sub" id="heroStoppedRange"></div>
</div>
<div class="hero-middle">
<div class="hero-task-category" id="heroStoppedCategory"></div>
<div class="hero-task-title" id="heroStoppedTask"></div>
<div class="hero-sub" id="heroStoppedSessions"></div>
</div>
<div class="hero-right">
<button class="hero-btn hero-btn--ghost" id="heroUndoBtn" aria-label="Undo this log entry">↶ undo</button>
<button class="hero-btn hero-btn--ghost" id="heroNoteBtn" aria-label="Add a note">+ note</button>
<button class="hero-btn hero-btn--done" id="heroDoneBtn" aria-label="Dismiss confirmation">✓ done</button>
</div>
</div>
</div>
<!-- Legacy focus / distract / park / hook buttons — kept hidden for existing JS bindings -->
<button class="emergency-btn-trigger" id="emergencyBtn"
aria-label="Enter focus mode" aria-haspopup="dialog" style="display:none">🚨 focus</button>
<span id="timerHandoffLbl" aria-hidden="true" style="display:none"></span>
<input id="timerHandoff" aria-label="Handoff note" style="display:none"/>
<button id="timerDistract" aria-label="Log a distraction" style="display:none">😵 distracted</button>
<button id="timerParkBtn" aria-label="Park a thought" style="display:none">💭</button>
<input id="parkCapture" aria-label="Thought to park" style="display:none"/>
<button id="timerHookBtn" aria-label="Make this interesting" style="display:none">✨</button>
</div>
<div id="timerHookPanel" class="timer-hook-panel" style="display:none" role="region" aria-label="Task engagement suggestions">
<div class="timer-hook-content" id="timerHookContent"></div>
<div style="margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end;">
<button class="timer-hook-regen" id="timerHookRegen" aria-label="Regenerate suggestions" title="fetch new suggestions">↻ regenerate</button>
</div>
<button class="timer-hook-close" id="timerHookClose" aria-label="Close suggestions">×</button>
</div>
<!-- Emergency Mode Screen -->
<div class="emergency-screen" id="emergencyScreen" role="dialog" aria-modal="true" aria-label="Focus mode">
<div>
<div class="emergency-label" aria-hidden="true">currently working on</div>
<div class="emergency-task" id="emergencyTask" aria-live="polite" aria-atomic="true">—</div>
</div>
<div class="emergency-cps-wrap" id="emergencyCpsWrap" style="display:none">
<div class="emergency-cps-label" aria-hidden="true">next steps</div>
<div id="emergencyCps" role="list" aria-label="Task checkpoints"></div>
</div>
<div id="sprintFocusIntention" class="sprint-focus-intention" style="display:none"></div>
<div class="emergency-next-wrap">
<label class="emergency-label" for="emergencyNext">smallest next action</label>
<input class="emergency-next" id="emergencyNext" aria-label="Smallest next action" placeholder="what's the one thing to do right now?" />
</div>
<button class="emergency-exit" id="emergencyExit">exit focus mode</button>
</div>
<!-- Analytics section (streak, task count, epic count) — default collapsed -->
<div class="analytics-section plan-section collapsed" id="analyticsSection">
<div class="plan-header analytics-header" id="analyticsHeader" role="button" tabindex="0" aria-expanded="false" aria-controls="analyticsBody">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg></span>
<span class="plan-header-title">analytics</span>
<!-- Inline summary visible when the section is collapsed.
No aria-hidden: screen-reader users deserve the same at-a-glance
summary as sighted users scanning a collapsed header. -->
<span class="analytics-summary" id="analyticsSummary"></span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body analytics-body" id="analyticsBody">
<div class="stats" role="region" aria-label="Summary statistics">
<div class="stat"><div class="stat-val" id="statToday" aria-live="polite">0</div><div class="stat-lbl">tasks today</div><div class="stat-sub" id="statTodaySub"></div></div>
<div class="stat"><div class="stat-val" id="statWeek" aria-live="polite">0</div><div class="stat-lbl">epics this week</div><div class="stat-sub" id="statWeekSub"></div></div>
<div class="stat"><div class="stat-val" id="statStreak" aria-live="polite">0</div><div class="stat-lbl">day streak</div><div class="stat-sub" id="statStreakSub"></div></div>
</div>
</div>
</div>
<!-- Calendar meeting strip -->
<div class="plan-section" id="calSection" style="display:none">
<div class="plan-header" id="calHeader" role="button" tabindex="0" aria-expanded="true" aria-controls="calMeetings">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg></span>
<span class="plan-header-title">today's meetings</span>
<span class="plan-count" id="calCount"></span>
<span class="cal-next-info" id="calNextInfo"></span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body" id="calMeetings"></div>
</div>
<div class="plan-section" id="planSection">
<div class="plan-header" id="planHeader" aria-controls="planList">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m3 17 2 2 4-4"/><path d="m3 7 2 2 4-4"/><path d="M13 6h8"/><path d="M13 12h8"/><path d="M13 18h8"/></svg></span>
<span class="plan-header-title">today's tasks</span>
<span class="plan-count" id="planCount"></span>
<button class="idkw-btn" id="idkwBtn" aria-label="Pick a random task" title="I don't know what to do — pick one for me">🎲</button>
<button class="idkw-btn" id="rapidOpenBtn" aria-label="Quick capture" title="Quick capture — log something fast">✏️</button>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body">
<div class="plan-add-row" id="planAddRow">
<input class="plan-input" id="planInput" aria-label="Add a task" placeholder="add a task or paste a Jira ticket…" autocomplete="off" />
<button class="plan-add-btn" id="planAddBtn">+ add</button>
</div>
<div id="boardCols" class="board-cols">
<div class="kb-col" id="todoCol">
<div class="kb-col__head">
<span class="kb-col__dot" style="background:#94a3b8" aria-hidden="true"></span>
<span class="kb-col__title">To Do</span>
<span class="kb-col__count" id="todoColCount" aria-live="polite"></span>
</div>
<div id="planList" class="kb-cards" role="list" aria-label="To do tasks"></div>
</div>
<div class="kb-col" id="progressCol">
<div class="kb-col__head">
<span class="kb-col__dot" style="background:#2563eb" aria-hidden="true"></span>
<span class="kb-col__title">In Progress</span>
<span class="kb-col__count" id="progressColCount" aria-live="polite"></span>
</div>
<div id="progressList" class="kb-cards" role="list" aria-label="In progress tasks"></div>
</div>
<div class="kb-col" id="doneCol">
<div class="kb-col__head">
<span class="kb-col__dot" style="background:#059669" aria-hidden="true"></span>
<span class="kb-col__title">Done</span>
<span class="kb-col__count" id="doneColCount" aria-live="polite"></span>
</div>
<div id="doneList" class="kb-cards" role="list" aria-label="Done tasks"></div>
</div>
</div>
<div id="planTrackRecent" class="plan-track-recent" style="display:none" aria-label="Track a recent entry"></div>
</div>
</div>
<!-- Compat stubs: IDs required by parse-time JS listeners — kept hidden -->
<div id="quickEntryStubs" aria-hidden="true" style="display:none">
<input class="capture-input" id="captureInput" aria-label="What did you just do?" autocomplete="off" />
<button class="add-btn" id="addBtn">+ log</button>
<button class="timer-btn" id="timerBtn" aria-label="Start timer">▶ start</button>
</div>
<div id="quickPick" style="display:none"></div>
<div class="tag-row" id="tagRow" style="display:none"></div>
<div id="distractionSection" style="margin-top:10px"></div>
<div id="parkSection" style="display:none" class="park-section">
<div class="park-header" id="parkHeader" role="button" tabindex="0">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22z"/></svg></span>
parked thoughts <span class="park-badge" id="parkBadge">0</span>
<span class="park-toggle" aria-hidden="true">▼</span>
</div>
<div id="parkList" class="park-body"></div>
</div>
<div id="newdayBanner" class="newday-banner" aria-live="polite" aria-atomic="false">
<span class="newday-icon">🌉</span>
<div style="flex:1">
<div class="newday-msg" id="newdayMsg"></div>
<div id="newdayExpanded" style="display:none;margin-top:8px;font-size:12px;color:var(--text3)"></div>
</div>
<div class="newday-actions">
<button class="newday-export" id="newdayBridgeBtn">build bridge</button>
<button class="newday-dismiss" id="newdayDismiss">dismiss</button>
</div>
</div>
<!-- TODAY'S FLOW — unified section (Flow / Log / Blocks views) -->
<section id="todayFlowSection" aria-label="Today's flow">
<div class="tf-header" id="tfHeader"></div>
<div class="tf-day-strip-wrap">
<div id="tfDayStrip"></div>
</div>
<div class="tf-gap-reminder" id="tfGapReminder" style="display:none"></div>
<!-- Flow view pane — tabindex=0 makes the panel itself keyboard-reachable
since it has no focusable children (WCAG 2.1.1) -->
<div class="tf-pane" id="tfFlowPane" role="tabpanel" aria-labelledby="tfTab-flow" tabindex="0"></div>
<!-- Log view pane — contains the editable #timeline (relocated from top-level) -->
<div class="tf-pane" id="tfLogPane" role="tabpanel" aria-labelledby="tfTab-log" tabindex="0" style="display:none">
<div id="timeline"></div>
<div class="capture-row" id="dailyLogNoteRow" style="display:none">
<label for="dailyLogNoteInput" class="sr-only">Add a note to today's log</label>
<input class="capture-input" id="dailyLogNoteInput"
placeholder="Add a note to today's log…" />
<button class="add-btn" id="dailyLogNoteBtn">+ Note</button>
</div>
</div>
<!-- Blocks view pane: existing timeblock grid embedded here -->
<div class="tf-pane" id="tfBlocksPane" role="tabpanel" aria-labelledby="tfTab-blocks" tabindex="0" style="display:none">
<div class="tb-body" id="tbBody">
<div class="tb-times" id="tbTimes"></div>
<div class="tb-grid-wrap">
<div class="tb-grid" id="tbGrid"></div>
</div>
</div>
</div>
</section>
<div class="plan-section upcoming-section" id="upcomingSection" style="display:none">
<div class="plan-header" id="upcomingHeader" role="button" tabindex="0" aria-expanded="true" aria-controls="upcomingList">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></span>
<span class="plan-header-title">upcoming tasks</span>
<span class="plan-count" id="upcomingCount"></span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body">
<div id="upcomingList" role="list" aria-label="Upcoming tasks"></div>
</div>
</div>
<div class="plan-section pending-section" id="pendingSection" style="display:none">
<div class="plan-header" id="pendingHeader" role="button" tabindex="0" aria-expanded="true" aria-controls="pendingList">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" y1="22" x2="4" y2="15"/></svg></span>
<span class="plan-header-title">pending / blocked tasks</span>
<span class="plan-count" id="pendingCount"></span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body">
<div id="pendingList" role="list" aria-label="Pending and blocked tasks"></div>
</div>
</div>
<div class="completed-section" id="completedSection" style="display:none">
<div class="completed-header" id="completedHeader" role="button" tabindex="0" aria-expanded="true" aria-controls="completedBody">
<span class="completed-title">completed in the past 14 days</span>
<span class="completed-count" id="completedCount"></span>
<span class="completed-toggle" aria-hidden="true">▼</span>
</div>
<div class="completed-body" id="completedBody"></div>
</div>
<!-- Hidden file input for backup restore — triggered from the Start of Day flow -->
<input type="file" id="backupFileInput" accept=".json" style="display:none"
aria-label="Select JSON backup file to restore" />
<div class="export-section">
<div class="export-header">
<span class="export-title">export</span>
<div style="display:flex;gap:8px;align-items:center">
<button class="expiry-btn" id="expiryBtn" aria-haspopup="dialog" title="Edit iteration expiry dates">📅 iterations</button>
<button class="eod-btn" id="eodBtn">🌙 end the day</button>
</div>
</div>
</div>
<!-- Iteration expiry dates editor modal -->
<div class="expiry-overlay" id="expiryOverlay" role="dialog" aria-modal="true" aria-labelledby="expiryModalTitle">
<div class="expiry-modal">
<div class="expiry-modal-title" id="expiryModalTitle">📅 Iteration expiry dates</div>
<div class="expiry-modal-sub" id="expiryModalDesc">One date per line in YYYY-MM-DD format. Completed tasks are hidden from the day after their iteration ends. Dates are stored in your browser.</div>
<textarea class="expiry-textarea" id="expiryTextarea" spellcheck="false" aria-labelledby="expiryModalTitle" aria-describedby="expiryModalDesc"></textarea>
<div class="expiry-feedback" id="expiryFeedback"></div>
<div class="expiry-footer">
<button class="eod-close" id="expiryCancel">Cancel</button>
<button class="eod-close" id="expirySave" style="background:var(--bg3)">Save</button>
</div>
</div>
</div>
<!-- Reflection overlay -->
<div id="reflectionOverlay" class="reflection-overlay" role="dialog" aria-modal="true"
aria-label="End of day reflection" style="display:none">
<div class="reflection-card">
<div class="reflection-title">🌅 Day wrap-up — reflection</div>
<div class="refl-group">
<div class="refl-label">Focus quality</div>
<div class="refl-stars" id="reflFocusStars" data-field="focus"></div>
<div class="refl-hint" id="reflFocusHint"></div>
</div>
<div class="refl-group">
<div class="refl-label">Energy level</div>
<div class="refl-stars" id="reflEnergyStars" data-field="energy"></div>
</div>
<div class="refl-group">
<div class="refl-label">What took longer than expected? <span class="refl-opt">(optional)</span></div>
<input class="capture-input" id="reflNote" placeholder="One sentence…" />
</div>
<div class="refl-actions">
<button class="add-btn" id="reflSkip">Skip</button>
<button class="add-btn refl-save" id="reflSave">Save & close day</button>
</div>
</div>
</div>
<!-- End of day modal -->
<div class="eod-overlay" id="eodOverlay" role="dialog" aria-modal="true" aria-labelledby="eodModalTitle">
<div class="eod-modal">
<div class="eod-title" id="eodModalTitle">🌙 End of Day</div>
<div class="eod-subtitle" id="eodSubtitle"></div>
<div id="eodExportStatus"></div>
<div class="eod-section-title">notes for tomorrow</div>
<div id="eodTaskNotes"></div>
<div class="eod-section-title">Changes implemented today</div>
<div id="eodChanges"></div>
<div class="eod-section-title">Test areas to review</div>
<div id="eodTestAreas"></div>
<button class="eod-copy-btn" id="eodCopyBtn">📋 copy to clipboard</button>
<div class="eod-footer">
<button class="eod-close" id="eodClose">Done — close</button>
</div>
</div>
</div>
<section id="monthlyLogSection" style="display:none">
<div class="ml-layout">
<div class="ml-calendar" id="mlCalendar"></div>
<div class="ml-sidebar">
<div class="ml-summary" id="mlSummary"></div>
<div class="ml-tasks" id="mlTasks"></div>
</div>
</div>
</section>
<!-- Sprint setup panel -->
<div id="sprintSetup" style="display:none">
<div class="sprint-setup-card">
<div class="sprint-setup-title">▷ New sprint</div>
<div class="refl-label">What will you finish?</div>
<div class="capture-row">
<input class="capture-input" id="sprintIntention" placeholder="Describe the outcome, not the task" autocomplete="off" />
</div>
<div class="refl-label" style="margin-top:8px">Duration</div>
<div class="sprint-durations" id="sprintDurations"></div>
<div class="sprint-setup-actions">
<button class="add-btn" id="sprintCancel">Cancel</button>
<button class="add-btn refl-save" id="sprintStartBtn">▶ Start sprint</button>
</div>
</div>
</div>
<!-- Sprint review panel -->
<div id="sprintReview" style="display:none">
<div class="sprint-review-card">
<div class="sprint-review-title">◎ Sprint review</div>
<div class="sprint-review-intention" id="sprintReviewIntention"></div>
<div class="refl-label">Did you finish what you set out to do?</div>
<div class="sprint-outcomes" id="sprintOutcomes"></div>
<input class="capture-input" id="sprintReviewNote" placeholder="What got in the way? (optional)" style="margin:10px 0" />
<button class="add-btn refl-save" id="sprintReviewSave">Save & log entry</button>
</div>
</div>
<!-- Pomodoro timer (collapsible) -->
<div class="pomo-section" id="pomoSection" role="region" aria-label="Pomodoro timer">
<div class="pomo-header" id="pomoHeader" role="button" tabindex="0">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg></span>
pomodoro
<span class="pomo-toggle" aria-hidden="true">▼</span>
</div>
<div class="pomo-body" id="pomoBody">
<div class="pomo-grid">
<!-- Col 1: Clock face -->
<div class="pomo-col-clock">
<div class="pomo-durations" role="group" aria-labelledby="pomoHeader">
<button class="pomo-dur active" data-min="5">5</button>
<button class="pomo-dur" data-min="10">10</button>
<button class="pomo-dur" data-min="20">20</button>
</div>
<div class="pomo-ring-wrap">
<svg id="pomoSvg" class="pomo-svg" viewBox="0 0 200 200">
<circle class="pomo-bg" cx="100" cy="100" r="90"/>
<!-- segments inserted by JS between bg and hole -->
<circle class="pomo-hole" cx="100" cy="100" r="52" id="pomoHole"/>
<circle class="pomo-border" cx="100" cy="100" r="90"/>
</svg>
<div class="pomo-center">
<div class="pomo-time" id="pomoTime">05:00</div>
<div class="pomo-status" id="pomoStatus">ready</div>
</div>
<div class="pomo-checkmark" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>
</div>
</div>
<!-- Col 2: Composer -->
<div class="pomo-col-composer">
<div class="pomo-task-label" id="pomoTaskLabel"></div>
<div class="pomo-affirmation" id="pomoAffirmation"></div>
<div class="pomo-controls">
<button class="pomo-btn pomo-start" id="pomoStart">start</button>
<button class="pomo-btn pomo-reset" id="pomoReset">reset</button>
<button class="pomo-btn sprint-mode" id="sprintModeBtn">▷ Sprint</button>
<button class="pomo-btn pomo-plus2-btn" id="pomoPlus2">+2 min</button>
<button class="pomo-btn pomo-tapout-btn" id="pomoTapOut">tap out</button>
</div>
<div class="pomo-done-controls" id="pomoDoneControls">
<button class="pomo-btn" id="pomoAnother5">↻ Another 5</button>
<button class="pomo-btn" id="pomoBreather">💧 1-min breather</button>
<button class="pomo-btn" id="pomoDismiss">Done</button>
</div>
<div class="pomo-chime">
🔔 time chime every
<select id="chimeIntervalSel" class="pomo-chime-select" aria-label="Time chime interval">
<option value="0">off</option>
<option value="15">15 min</option>
<option value="30" selected>30 min</option>
<option value="45">45 min</option>
<option value="60">60 min</option>
</select>
</div>
</div>
<!-- Col 3: 28-day sparkline -->
<div class="pomo-col-sparkline">
<div class="pomo-spark-title">28-day focus</div>
<canvas id="pomoSparkline" class="pomo-sparkline-canvas"
aria-label="28-day pomodoro session density" role="img"></canvas>
<div class="pomo-spark-foot" id="pomoSparkFoot"></div>
</div>
<!-- Col 4: Session ledger -->
<div class="pomo-col-ledger">
<div class="pomo-log">
<div class="pomo-log-title">session log</div>
<div id="pomoLog"></div>
</div>
</div>
</div><!-- /.pomo-grid -->
<!-- Ribbon footer: last-5 dots + status pill + view-all link -->
<div class="pomo-ribbon">
<div class="pomo-ribbon-dots" id="pomoRibbonDots" aria-hidden="true"></div>
<span class="pomo-ribbon-pill" id="pomoRibbonPill"></span>
<button class="pomo-ribbon-link" id="pomoRibbonLink">No sessions yet</button>
</div>
</div>
</div>
<!-- Trackers section -->
<section id="trackersSection">
<div class="section-header" id="trackerHeader">
<span>Trackers</span>
<button class="add-btn" id="trackerAddBtn" style="font-size:11px">+ New</button>
</div>
<div id="trackerList"></div>
<div id="trackerNewForm" style="display:none"></div>
</section>
<!-- Import from Jira (moved to bottom) -->
<div class="plan-section collapsed" id="jiraSection">
<div class="plan-header" id="jiraHeader" role="button" tabindex="0" aria-expanded="false" aria-controls="jiraBody">
<span class="section-icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></span>
<span class="plan-header-title">import from jira</span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body" id="jiraBody">
<div class="jira-drop" id="jiraDrop">
<input type="file" id="jiraFileIn" aria-label="Jira CSV export file" accept=".csv,text/csv" style="display:none">
<strong class="jira-drop-title">Drop Jira CSV export here, or click to browse</strong>
<span class="jira-drop-sub">Jira → select issues → Export CSV (all fields)</span>
</div>
<div class="jira-task-rows" id="jiraTaskRows" style="display:none"></div>
<div class="jira-sel-row" id="jiraSelRow" style="display:none">
<span class="jira-count" id="jiraCount"></span>
<button class="export-btn" id="jiraSelAll">all</button>
<button class="export-btn" id="jiraSelNone">none</button>
<button class="plan-add-btn" id="jiraImportBtn">⊕ add to today</button>
<span class="jira-msg" id="jiraMsg"></span>
</div>
</div>
</div>
<!-- Add link to Notion (moved to bottom) -->
<div class="plan-section collapsed" id="notionLinksSection">
<div class="plan-header" id="notionLinksHeader" role="button" tabindex="0" aria-expanded="false" aria-controls="notionLinksBody">
<span class="plan-header-title">add link to notion</span>
<span class="plan-toggle" aria-hidden="true">▼</span>
</div>
<div class="plan-body" id="notionLinksBody">
<div class="notion-form">
<div class="notion-row">
<input class="plan-input notion-url-input" id="notionUrl" placeholder="https://…" autocomplete="off" />
<button class="export-btn" id="notionFetchBtn">fetch title</button>
</div>
<div class="notion-row">
<input class="plan-input" id="notionName" placeholder="name / title" autocomplete="off" />
</div>
<div class="notion-row-2col">
<select class="notion-select" id="notionProject" aria-label="Notion project">
<option value="">— project —</option>
<!-- Add your own Notion page URLs here, e.g.:
<option value="https://www.notion.so/your-page-id">Project name</option>
-->
</select>
<select class="notion-select" id="notionType" aria-label="Link type">
<option value="Doc">Doc</option>
<option value="Reference">Reference</option>
<option value="Tool">Tool</option>
<option value="Article">Article</option>
<option value="Template">Template</option>
<option value="Video">Video</option>
<option value="Other">Other</option>
</select>
</div>
<div class="notion-save-row">
<label class="notion-pin">
<input type="checkbox" id="notionPinned" /> pin
</label>
<button class="plan-add-btn" id="notionSaveBtn">⊕ save to notion</button>
<span id="notionMsg"></span>
</div>
</div>
</div>
</div>
<style>
.notion-form { padding: 8px 0 4px; display: flex; flex-direction: column; gap: 7px; }
.notion-row { display: flex; gap: 6px; align-items: center; }
.notion-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.notion-url-input { flex: 1; }
.notion-select {
width: 100%;
padding: 5px 8px;
background: var(--bg2);
color: var(--text2);
border: 0.5px solid var(--border);
border-radius: var(--radius);
font-size: 12px;
font-family: var(--font);
outline: none;
cursor: pointer;
}
.notion-select:focus { border-color: var(--accent, #7b61ff); }
.notion-save-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.notion-pin {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--text3);
cursor: pointer;
user-select: none;
white-space: nowrap;
}
.notion-pin input { cursor: pointer; accent-color: var(--accent, #7b61ff); }
.notion-msg-ok { color: var(--green, #1a6b3a); font-size: 11px; }
.notion-msg-err { color: var(--red, #8b1f1f); font-size: 11px; }
</style>
<script>
(function () {
const RESOURCES_DS = 'collection://8b52a260-bacd-47ff-9852-0c4ace5d95b6';
// Restore stored collapse state (HTML default is collapsed).
// Prefix 'tt-open2-' mirrors COLLAPSE_PREFIX in src/js/07-lifecycle.js —
// keep both in sync if the prefix ever changes.
(function () {
const stored = localStorage.getItem('tt-open2-notionLinksSection');
document.getElementById('notionLinksSection').classList.toggle(
'collapsed',
stored === null ? true : stored === '1'
);
})();
document.getElementById('notionLinksHeader').addEventListener('click', () => {
const section = document.getElementById('notionLinksSection');
section.classList.toggle('collapsed');
// 'tt-open2-' prefix — see COLLAPSE_PREFIX in src/js/07-lifecycle.js.
localStorage.setItem('tt-open2-notionLinksSection', section.classList.contains('collapsed') ? '1' : '0');
});
document.getElementById('notionUrl').addEventListener('input', function () {
const nameEl = document.getElementById('notionName');
if (!nameEl.value.trim() && this.value.trim()) {
try { nameEl.value = new URL(this.value.trim()).hostname.replace('www.', ''); } catch {}
}
});
document.getElementById('notionFetchBtn').addEventListener('click', async function () {
const url = document.getElementById('notionUrl').value.trim();
if (!url) return;
this.textContent = '…';
this.disabled = true;
try {
const res = await fetch('/api/ai', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'claude-haiku-4-5-20251001',
max_tokens: 80,
tools: [{ type: 'web_search_20250305', name: 'web_search' }],
messages: [{ role: 'user', content: 'Reply with ONLY the page title of ' + url + ' — nothing else.' }]
})
});
if (!res.ok) throw new Error('API ' + res.status);
const data = await res.json();
const title = (data.content || []).filter(b => b.type === 'text').map(b => b.text).join('').trim();
if (title) document.getElementById('notionName').value = title;
} catch (err) {
wlLog.warn('notionFetchBtn: title fetch failed', err);
}
this.textContent = 'fetch title';
this.disabled = false;
});
document.getElementById('notionSaveBtn').addEventListener('click', async function () {
const url = document.getElementById('notionUrl').value.trim();
const name = document.getElementById('notionName').value.trim();
const proj = document.getElementById('notionProject').value;
const type = document.getElementById('notionType').value;
const pinned = document.getElementById('notionPinned').checked;
const msg = document.getElementById('notionMsg');
if (!url || !name) { setMsg(msg, 'URL and name required', false); return; }
this.disabled = true;
this.textContent = 'saving…';
msg.textContent = '';
const projLine = proj ? `\n- Project relation to page URL "${proj}"` : '';
const prompt =
`Create a page in Notion Resources database (data source ID: ${RESOURCES_DS}):\n` +
`- Name: "${name.replace(/"/g, "'")}"\n` +
`- URL: "${url}"\n` +
`- Type: "${type}"\n` +
`- Pinned: "${pinned ? '__YES__' : '__NO__'}"${projLine}\n` +
`Reply with only OK: <page_url> on success.`;
try {
const res = await fetch('/api/notion-ai', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'claude-sonnet-4-6',
max_tokens: 1000,
mcp_servers: [{ type: 'url', url: 'https://mcp.notion.com/mcp', name: 'notion' }],
messages: [{ role: 'user', content: prompt }]
})
});
if (!res.ok) throw new Error('API ' + res.status);
const data = await res.json();
const reply = (data.content || []).filter(b => b.type === 'text').map(b => b.text).join('').trim();
if (reply.toLowerCase().includes('ok') || reply.toLowerCase().includes('creat')) {
setMsg(msg, '✓ saved', true);
document.getElementById('notionUrl').value = '';
document.getElementById('notionName').value = '';
document.getElementById('notionProject').value = '';
document.getElementById('notionType').value = 'Doc';
document.getElementById('notionPinned').checked = false;
} else {
throw new Error('unexpected response');
}
} catch (e) {
setMsg(msg, '✗ failed: ' + e.message, false);
}
this.disabled = false;
this.textContent = '⊕ save to notion';
});
function setMsg(el, text, ok) {
el.textContent = text;
el.className = ok ? 'notion-msg-ok' : 'notion-msg-err';
if (ok) setTimeout(() => { el.textContent = ''; }, 4000);
}
})();
</script>
<div id="rapidOverlay" class="rapid-overlay" role="dialog" aria-modal="true"
aria-label="Quick capture" style="display:none">
<div class="rapid-card">
<!-- ── Header ─────────────────────────────────────────────────────── -->
<div class="qc-header">
<span class="qc-heading">
<span class="qc-status-dot" aria-hidden="true"></span>
Quick capture
</span>
<kbd class="qc-kbd">Esc</kbd>
<button class="rapid-close" id="rapidClose" aria-label="Close">✕</button>
</div>
<!-- ── Running strip (hidden when idle) ───────────────────────────── -->
<div class="qc-running-strip" id="qcRunningStrip" style="display:none"
aria-label="Currently tracking">
<span class="qc-run-dot" aria-hidden="true"></span>
<span class="qc-run-task" id="qcRunTask"></span>
<span class="qc-run-elapsed" id="qcRunElapsed" aria-live="off"></span>
<button class="qc-run-stop" id="qcRunStop" aria-label="Stop current timer">■ stop</button>
</div>
<!-- ── Search / filter input ──────────────────────────────────────── -->
<div class="qc-search-row">
<input class="qc-search-input" id="rapidInput"
placeholder="Filter tasks or type to log…"
autocomplete="off"
aria-label="Filter tasks, or type a description to log" />
</div>
<!-- ── Inline token preview (hidden until a token is typed) ─────────── -->
<div class="qc-token-row" id="qcTokenPreview" aria-live="polite" style="display:none"></div>
<!-- ── Category filter chips ──────────────────────────────────────── -->
<div class="rapid-cats" id="rapidCats" role="group" aria-label="Filter by category"></div>
<!-- ── Task list ──────────────────────────────────────────────────── -->
<div class="qc-task-list" id="qcTaskList" role="listbox"
aria-label="Tasks — click a row to start or switch"></div>
<!-- ── Footer ─────────────────────────────────────────────────────── -->
<div class="qc-footer">
<button class="qc-log-only-btn" id="rapidLogOnly"
aria-label="Log without starting timer">
+ Log without tracking
</button>
</div>
</div>
</div>
<!-- Migration overlay -->
<div id="migrationOverlay" class="migration-overlay" role="dialog" aria-modal="true"
aria-label="Month migration" style="display:none">
<div class="migration-card">
<div class="migration-header">
<span class="migration-title" id="migrationTitle">Month close-out</span>
<span class="migration-counter" id="migrationCounter"></span>
</div>
<div class="prog-wrap"><div class="prog-fill" id="migrationProgress" style="width:0%"></div></div>
<div id="migrationBody"></div>
<button class="add-btn" id="migrationClose" style="margin-top:14px;width:100%">Close</button>
</div>
</div>
<script type="module" src="script.js"></script>
<div id="debugInfo">
<span class="commit">Latest commit: a322f1f</span>
<span>Commit time: Check GitHub for latest</span>
<span>Page loaded: <span id="pageLoadTime"></span></span>
</div>
<script>
document.getElementById('pageLoadTime').textContent = new Date().toLocaleString('en-US', {
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit',
hour12: false
}).replace(',', '');
</script>
</body>
</html>