agent-things 1.2.1 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,8 +6,12 @@
6
6
  <title>Agent Things 会话任务进度 · 任务进展</title>
7
7
  <style>
8
8
  :root {
9
- --accent: #0169cc;
10
- --accent-hover: #005bb3;
9
+ --accent: var(--primary, #2F75C3);
10
+ --accent-hover: color-mix(in oklab, var(--accent) 88%, var(--at-ink, #000));
11
+ --accent-pressed: color-mix(in oklab, var(--accent) 78%, var(--at-ink, #000));
12
+ --on-accent: var(--primary-foreground, #ffffff);
13
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
14
+ --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
11
15
  --at-ink: #e6edf3;
12
16
  --at-secondary: #a0a6ad;
13
17
  --at-muted: #828c96;
@@ -20,8 +24,7 @@
20
24
  --at-selected: #ffffff10;
21
25
  --at-source-bg: #ffffff0a;
22
26
  --at-number-line: #ffffff25;
23
- --at-thumb: #e6edf3;
24
- --at-thumb-edge: #ffffff30;
27
+ --at-thumb: #ffffff;
25
28
  --danger: #ef7777;
26
29
  --error: #f7ad86;
27
30
  --at-panel-bg: #0e1318;
@@ -88,7 +91,7 @@
88
91
  border-radius: 5px;
89
92
  outline-offset: 4px;
90
93
  cursor: default;
91
- transition: max-height 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease, transform 0.22s ease, margin 0.22s ease;
94
+ transition: max-height 200ms var(--ease-out), opacity 180ms var(--ease-out), transform 200ms var(--ease-out);
92
95
  max-height: 60px;
93
96
  opacity: 1;
94
97
  transform: translateY(0);
@@ -102,7 +105,7 @@
102
105
  visibility: hidden;
103
106
  margin: 0;
104
107
  padding: 0;
105
- transform: translateY(-20px);
108
+ transform: translateY(-10px);
106
109
  overflow: hidden;
107
110
  pointer-events: none;
108
111
  }
@@ -133,21 +136,29 @@
133
136
  height: 32px;
134
137
  display: block;
135
138
  }
139
+ .title-progress .progress-pie,
136
140
  .title-progress text {
137
- opacity: 0;
138
- transition: opacity 0.15s ease;
141
+ transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
142
+ transform-origin: 12px 12px;
139
143
  pointer-events: none;
140
144
  }
145
+ .title-progress text {
146
+ opacity: 0;
147
+ transform: scale(0.94);
148
+ }
141
149
  .title-progress text.progress-unknown {
142
150
  opacity: 1;
151
+ transform: none;
143
152
  }
144
153
  .title-heading:hover .progress-pie,
145
154
  .title-heading:focus-visible .progress-pie {
146
155
  opacity: 0;
156
+ transform: scale(0.94);
147
157
  }
148
158
  .title-heading:hover text,
149
159
  .title-heading:focus-visible text {
150
160
  opacity: 1;
161
+ transform: scale(1);
151
162
  }
152
163
 
153
164
  .panel-body {
@@ -158,7 +169,7 @@
158
169
  margin-top: 14px;
159
170
  scrollbar-width: none;
160
171
  -ms-overflow-style: none;
161
- transition: margin-top 0.22s ease;
172
+ transition: margin-top 200ms var(--ease-out);
162
173
  }
163
174
  .shell.is-scrolled .panel-body {
164
175
  margin-top: 0;
@@ -249,7 +260,7 @@
249
260
  .meter {
250
261
  height: 4px;
251
262
  background: var(--at-track);
252
- border-radius: 3px;
263
+ border-radius: 999px;
253
264
  margin: 10px 0 8px;
254
265
  overflow: hidden;
255
266
  }
@@ -258,6 +269,10 @@
258
269
  display: block;
259
270
  height: 100%;
260
271
  width: var(--fill, 0%);
272
+ background: var(--mark, var(--accent));
273
+ border-radius: inherit;
274
+ transition: width 220ms var(--ease-out), background-color 180ms var(--ease-out);
275
+ }
261
276
  background: var(--mark, #b4b7be);
262
277
  border-radius: inherit;
263
278
  }
@@ -333,7 +348,7 @@
333
348
  .primary {
334
349
  border: 0;
335
350
  background: var(--accent);
336
- color: #fff;
351
+ color: var(--on-accent, #fff);
337
352
  border-radius: 9px;
338
353
  padding: 9px 14px;
339
354
  font-weight: 550;
@@ -341,11 +356,16 @@
341
356
  font-size: 13px;
342
357
  white-space: nowrap;
343
358
  flex-shrink: 0;
344
- transition: background 0.15s ease;
359
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.14);
360
+ transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms var(--ease-out);
345
361
  }
346
- .primary:hover {
362
+ .primary:hover:not(:disabled) {
347
363
  background: var(--accent-hover);
348
- color: #fff;
364
+ color: var(--on-accent, #fff);
365
+ }
366
+ .primary:active:not(:disabled) {
367
+ background: var(--accent-pressed, var(--accent-hover));
368
+ transform: scale(0.97);
349
369
  }
350
370
  .text-button, .clear, .back {
351
371
  border: 0;
@@ -355,11 +375,14 @@
355
375
  font-size: 12px;
356
376
  white-space: nowrap;
357
377
  cursor: pointer;
358
- transition: color 0.12s ease;
378
+ transition: transform 160ms var(--ease-out), color 150ms var(--ease-out);
359
379
  }
360
380
  .text-button:hover, .back:hover {
361
381
  color: inherit;
362
382
  }
383
+ .text-button:active:not(:disabled), .clear:active:not(:disabled), .back:active:not(:disabled) {
384
+ transform: scale(0.97);
385
+ }
363
386
  .actions .clear {
364
387
  margin-left: auto;
365
388
  font-size: 11px;
@@ -381,17 +404,20 @@
381
404
  border: 1px solid var(--at-line);
382
405
  font-size: 11px;
383
406
  pointer-events: none;
407
+ transform-origin: bottom right;
384
408
  opacity: 0;
409
+ transform: scale(0.96) translateY(3px);
385
410
  visibility: hidden;
386
- transition: opacity 0.08s, visibility 0s;
411
+ transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s linear 150ms;
387
412
  white-space: nowrap;
388
- box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
413
+ box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
389
414
  z-index: 10;
390
415
  }
391
416
  .clear:is(:hover, :focus-visible) .clear-tooltip {
392
417
  opacity: 1;
418
+ transform: scale(1) translateY(0);
393
419
  visibility: visible;
394
- transition-delay: 0.1s;
420
+ transition: opacity 150ms var(--ease-out) 160ms, transform 150ms var(--ease-out) 160ms, visibility 0s linear 160ms;
395
421
  }
396
422
 
397
423
  .section-head {
@@ -471,7 +497,7 @@
471
497
  opacity: 0;
472
498
  pointer-events: none;
473
499
  transform: translateX(6px);
474
- transition: opacity 0.16s ease, transform 0.16s ease;
500
+ transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
475
501
  }
476
502
  .task-row:hover .task-source,
477
503
  .task-row:focus-within .task-source {
@@ -488,6 +514,10 @@
488
514
  font-size: 11px;
489
515
  white-space: nowrap;
490
516
  cursor: pointer;
517
+ transition: transform 160ms var(--ease-out), background-color 150ms var(--ease-out);
518
+ }
519
+ .task-source > button:active:not(:disabled) {
520
+ transform: scale(0.96);
491
521
  }
492
522
  .task-source > button:disabled {
493
523
  opacity: 0.65;
@@ -514,10 +544,17 @@
514
544
  text-align: left;
515
545
  font-size: 12px;
516
546
  cursor: pointer;
517
- transition: color 0.15s ease;
547
+ transition: transform 160ms var(--ease-out), color 150ms var(--ease-out);
548
+ }
549
+ .quiet-row:active:not(:disabled) {
550
+ transform: scale(0.988);
518
551
  }
519
552
  .quiet-row span:last-child {
520
553
  color: var(--at-secondary);
554
+ transition: transform 160ms var(--ease-out), color 150ms var(--ease-out);
555
+ }
556
+ .quiet-row:hover span:last-child {
557
+ transform: translateX(2px);
521
558
  }
522
559
  .quiet-row:hover {
523
560
  color: var(--at-ink);
@@ -553,7 +590,7 @@
553
590
  margin-right: -6px;
554
591
  border-radius: 6px;
555
592
  cursor: pointer;
556
- transition: color 0.12s, background 0.12s;
593
+ transition: transform 160ms var(--ease-out), color 150ms var(--ease-out), background-color 150ms var(--ease-out);
557
594
  }
558
595
  .view-heading .back:hover {
559
596
  color: var(--at-ink);
@@ -569,7 +606,7 @@
569
606
  background: linear-gradient(to bottom, var(--at-panel-bg), transparent);
570
607
  pointer-events: none;
571
608
  opacity: 0;
572
- transition: opacity 0.2s ease-out, background 0.15s ease-out;
609
+ transition: opacity 180ms var(--ease-out);
573
610
  }
574
611
  .shell.is-scrolled .view-heading::after {
575
612
  opacity: 1;
@@ -595,11 +632,14 @@
595
632
  text-align: left;
596
633
  font-size: 13px;
597
634
  cursor: pointer;
598
- transition: background 0.12s ease;
635
+ transition: transform 160ms var(--ease-out), background-color 150ms var(--ease-out);
599
636
  }
600
637
  .choice:hover {
601
638
  background: var(--at-hover);
602
639
  }
640
+ .choice:active:not(:disabled) {
641
+ transform: scale(0.988);
642
+ }
603
643
  .choice[aria-pressed="true"] {
604
644
  background: var(--at-selected);
605
645
  }
@@ -609,6 +649,7 @@
609
649
  border: 1.6px solid var(--mark);
610
650
  border-radius: 50%;
611
651
  flex: none;
652
+ transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
612
653
  }
613
654
  .choice[aria-pressed="true"] .dot {
614
655
  background: var(--mark);
@@ -652,7 +693,7 @@
652
693
  }
653
694
  .range {
654
695
  position: relative;
655
- height: 51px;
696
+ height: 48px;
656
697
  margin-top: 2px;
657
698
  --mark: #c89b38;
658
699
  }
@@ -660,11 +701,15 @@
660
701
  position: absolute;
661
702
  left: 7px;
662
703
  right: 7px;
663
- top: 10px;
664
- height: 4px;
665
- border-radius: 3px;
666
- background: linear-gradient(to right, var(--mark) var(--fill), var(--at-track) var(--fill));
704
+ top: 9px;
705
+ height: 6px;
706
+ border-radius: 999px;
707
+ background: linear-gradient(to right, var(--range-fill, var(--mark)) var(--fill), var(--at-track) var(--fill));
667
708
  pointer-events: none;
709
+ transition: background-color 160ms var(--ease-out);
710
+ }
711
+ .range.is-dragging .range-track {
712
+ transition: none;
668
713
  }
669
714
  .range-input {
670
715
  position: relative;
@@ -678,18 +723,26 @@
678
723
  cursor: pointer;
679
724
  }
680
725
  .range-input::-webkit-slider-runnable-track {
681
- height: 4px;
726
+ height: 6px;
682
727
  background: transparent;
683
728
  }
684
729
  .range-input::-webkit-slider-thumb {
685
730
  appearance: none;
686
- width: 14px;
687
- height: 14px;
731
+ width: 16px;
732
+ height: 16px;
688
733
  margin-top: -5px;
689
734
  background: var(--at-thumb);
690
- border: 2px solid var(--at-panel-bg);
735
+ border: 0.5px solid rgba(0, 0, 0, 0.14);
691
736
  border-radius: 50%;
692
- box-shadow: 0 0 0 1px var(--at-thumb-edge);
737
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
738
+ transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
739
+ }
740
+ .range-input:hover::-webkit-slider-thumb {
741
+ transform: scale(1.06);
742
+ }
743
+ .range-input:active::-webkit-slider-thumb {
744
+ transform: scale(1.1);
745
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(0, 0, 0, 0.12);
693
746
  }
694
747
  .range-nodes {
695
748
  position: absolute;
@@ -704,23 +757,17 @@
704
757
  top: 8px;
705
758
  width: 0;
706
759
  font-size: 10px;
760
+ font-weight: 500;
761
+ opacity: 0.78;
707
762
  color: var(--at-secondary);
708
763
  font-variant-numeric: tabular-nums;
709
764
  }
710
765
  .range-node::before {
711
- content: "";
712
- display: block;
713
- width: 7px;
714
- height: 7px;
715
- transform: translateX(-50%);
716
- border-radius: 50%;
717
- background: var(--at-panel-bg);
718
- border: 1px solid var(--at-secondary);
719
- box-shadow: 0 0 0 1px var(--at-panel-bg);
766
+ display: none;
720
767
  }
721
768
  .range-node-label {
722
769
  position: absolute;
723
- top: 19px;
770
+ top: 20px;
724
771
  left: 0;
725
772
  transform: translateX(-50%);
726
773
  }
@@ -792,36 +839,162 @@
792
839
  color: #548eea;
793
840
  }
794
841
 
842
+ :root[data-color-mode="light"] {
843
+ --at-ink: #22272e;
844
+ --at-secondary: #576374;
845
+ --at-muted: #667383;
846
+ --at-note: #46515f;
847
+ --at-track: #dfe4ea;
848
+ --at-line: #dfe4ea;
849
+ --at-input-border: #c7d0da;
850
+ --at-input-bg: #f7f9fb;
851
+ --at-hover: #f0f3f6;
852
+ --at-selected: #e9edf2;
853
+ --at-source-bg: #e9eef4;
854
+ --at-number-line: #b6c1ce;
855
+ --at-thumb: #ffffff;
856
+ --danger: #bf2f3a;
857
+ --error: #b13a2d;
858
+ --at-panel-bg: #ffffff;
859
+ color: var(--at-ink);
860
+ color-scheme: light;
861
+ }
862
+ html[data-color-mode="light"] .shell {
863
+ --at-panel-bg: #ffffff;
864
+ border-color: #dfe4ea;
865
+ box-shadow: none;
866
+ }
867
+ html[data-color-mode="light"] .range {
868
+ --range-fill: color-mix(in srgb, var(--mark) 85%, #000);
869
+ }
870
+
795
871
  @media (prefers-color-scheme: light) {
796
- :root {
872
+ :root:not([data-color-mode="dark"]) {
797
873
  --at-ink: #22272e;
798
874
  --at-secondary: #576374;
799
875
  --at-muted: #667383;
800
876
  --at-note: #46515f;
801
- --at-track: #c3ccd6;
877
+ --at-track: #dfe4ea;
802
878
  --at-line: #dfe4ea;
803
879
  --at-input-border: #c7d0da;
804
- --input-bg: #f7f9fb;
805
- --hover: #f0f3f6;
806
- --selected: #e9edf2;
807
- --source-bg: #e9eef4;
808
- --number-line: #b6c1ce;
809
- --thumb: var(--accent);
810
- --thumb-edge: var(--accent);
880
+ --at-input-bg: #f7f9fb;
881
+ --at-hover: #f0f3f6;
882
+ --at-selected: #e9edf2;
883
+ --at-source-bg: #e9eef4;
884
+ --at-number-line: #b6c1ce;
885
+ --at-thumb: #ffffff;
811
886
  --danger: #bf2f3a;
812
887
  --error: #b13a2d;
813
- --panel-bg: #fff;
888
+ --at-panel-bg: #ffffff;
814
889
  color: var(--at-ink);
815
890
  color-scheme: light;
816
891
  }
817
- .shell {
818
- --panel-bg: #fff;
892
+ html:not([data-color-mode="dark"]) .shell {
893
+ --at-panel-bg: #ffffff;
819
894
  border-color: #dfe4ea;
820
895
  box-shadow: none;
821
896
  }
897
+ html:not([data-color-mode="dark"]) .range {
898
+ --range-fill: color-mix(in srgb, var(--mark) 85%, #000);
899
+ }
900
+ }
901
+ @media (prefers-reduced-motion: reduce) {
902
+ .primary:active:not(:disabled),
903
+ .text-button:active:not(:disabled),
904
+ .clear:active:not(:disabled),
905
+ .back:active:not(:disabled),
906
+ .task-source > button:active:not(:disabled),
907
+ .choice:active:not(:disabled),
908
+ .quiet-row:active:not(:disabled),
909
+ .range-input:hover::-webkit-slider-thumb,
910
+ .range-input:active::-webkit-slider-thumb {
911
+ transform: none;
912
+ }
822
913
  }
823
914
  </style>
824
915
  <script src="/preload.js"></script>
916
+ <script>
917
+ function syncThemeWithHost() {
918
+ try {
919
+ const root = document.documentElement;
920
+ const styleComp = getComputedStyle(root);
921
+ const bg = styleComp.getPropertyValue('--background').trim();
922
+ const fg = styleComp.getPropertyValue('--foreground').trim();
923
+ const mutedFg = styleComp.getPropertyValue('--muted-foreground').trim();
924
+
925
+ let isLight = null;
926
+ if (bg) {
927
+ if (bg.startsWith('#') && bg.length >= 7) {
928
+ const r = parseInt(bg.slice(1, 3), 16), g = parseInt(bg.slice(3, 5), 16), b = parseInt(bg.slice(5, 7), 16);
929
+ isLight = (0.299 * r + 0.587 * g + 0.114 * b) > 130;
930
+ } else if (bg.startsWith('rgb')) {
931
+ const m = bg.match(/\d+/g);
932
+ if (m && m.length >= 3) isLight = (0.299 * m[0] + 0.587 * m[1] + 0.114 * m[2]) > 130;
933
+ }
934
+ }
935
+ if (isLight === null) {
936
+ const cfgMode = window.__agentThingsHostTheme?.mode || root.getAttribute('data-color-mode');
937
+ if (cfgMode === 'light' || cfgMode === 'dark') {
938
+ isLight = cfgMode === 'light';
939
+ } else {
940
+ isLight = Boolean(window.matchMedia?.('(prefers-color-scheme: light)').matches);
941
+ }
942
+ }
943
+
944
+ const fallbackPrimary = window.__agentThingsHostTheme?.primary || (isLight ? '#2F75C3' : '#2F71E3');
945
+ const rawPrimary = (styleComp.getPropertyValue('--primary') || styleComp.getPropertyValue('--accent') || '').trim();
946
+ const primaryColor = rawPrimary || fallbackPrimary;
947
+ if (!rawPrimary && fallbackPrimary) {
948
+ root.style.setProperty('--primary', fallbackPrimary);
949
+ }
950
+ const primaryFg = styleComp.getPropertyValue('--primary-foreground').trim();
951
+ const hexMatch = primaryColor.match(/^#([0-9a-f]{6})$/i);
952
+ if (hexMatch) {
953
+ const hex = hexMatch[1];
954
+ const rgb = [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16)];
955
+ const lum = rgb.reduce((acc, c, i) => {
956
+ const s = c / 255;
957
+ const lin = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
958
+ return acc + lin * (i === 0 ? 0.2126 : i === 1 ? 0.7152 : 0.0722);
959
+ }, 0);
960
+ const isBrightAccent = lum > 0.45;
961
+ root.style.setProperty('--on-accent', isBrightAccent ? '#0D0D0D' : (primaryFg || '#FFFFFF'));
962
+ } else if (primaryFg) {
963
+ root.style.setProperty('--on-accent', primaryFg);
964
+ }
965
+
966
+ root.setAttribute('data-color-mode', isLight ? 'light' : 'dark');
967
+ if (isLight) {
968
+ root.style.setProperty('--at-ink', fg || '#22272e');
969
+ root.style.setProperty('--at-secondary', mutedFg || '#576374');
970
+ root.style.setProperty('--at-muted', '#667383');
971
+ root.style.setProperty('--at-note', '#46515f');
972
+ root.style.setProperty('--at-panel-bg', '#ffffff');
973
+ root.style.setProperty('--at-line', '#dfe4ea');
974
+ root.style.setProperty('--at-track', '#dfe4ea');
975
+ root.style.setProperty('--at-input-border', '#c7d0da');
976
+ root.style.setProperty('--at-input-bg', '#f6f8fa');
977
+ root.style.setProperty('--at-hover', '#f3f4f6');
978
+ root.style.setProperty('--at-source-bg', '#f6f8fa');
979
+ root.style.setProperty('color-scheme', 'light');
980
+ } else {
981
+ root.style.setProperty('--at-ink', fg || '#e6edf3');
982
+ root.style.setProperty('--at-secondary', '#a0a6ad');
983
+ root.style.setProperty('--at-muted', '#828c96');
984
+ root.style.setProperty('--at-note', '#bbc3ca');
985
+ root.style.setProperty('--at-panel-bg', '#0e1318');
986
+ root.style.setProperty('--at-line', '#ffffff14');
987
+ root.style.setProperty('--at-track', '#ffffff12');
988
+ root.style.setProperty('--at-input-border', '#ffffff18');
989
+ root.style.setProperty('--at-input-bg', '#ffffff03');
990
+ root.style.setProperty('--at-hover', '#ffffff09');
991
+ root.style.setProperty('--at-source-bg', '#ffffff0a');
992
+ root.style.setProperty('color-scheme', 'dark');
993
+ }
994
+ } catch (_) {}
995
+ }
996
+ syncThemeWithHost();
997
+ </script>
825
998
  </head>
826
999
  <body>
827
1000
  <div class="shell" id="agentThingsCard">
@@ -1410,10 +1583,14 @@
1410
1583
 
1411
1584
  function onSliderPointerDown() {
1412
1585
  isDraggingSlider = true;
1586
+ const rangeBox = document.getElementById('rangeBox');
1587
+ if (rangeBox) rangeBox.classList.add('is-dragging');
1413
1588
  }
1414
1589
 
1415
1590
  function onSliderPointerUp() {
1416
1591
  isDraggingSlider = false;
1592
+ const rangeBox = document.getElementById('rangeBox');
1593
+ if (rangeBox) rangeBox.classList.remove('is-dragging');
1417
1594
  }
1418
1595
 
1419
1596
  function onSliderInput(val) {
@@ -1542,15 +1719,28 @@
1542
1719
  }
1543
1720
  }
1544
1721
 
1722
+ let feedbackTimerId = null;
1723
+
1545
1724
  function showFeedback(msg, isError = false) {
1546
1725
  const el = document.getElementById('feedbackMsg');
1547
1726
  if (!el) return;
1727
+ if (feedbackTimerId) {
1728
+ clearTimeout(feedbackTimerId);
1729
+ feedbackTimerId = null;
1730
+ }
1548
1731
  el.textContent = msg;
1549
1732
  el.className = 'feedback-msg ' + (isError ? 'error' : 'success');
1550
- setTimeout(function() { if (el.textContent === msg) el.textContent = ''; }, 4000);
1733
+ feedbackTimerId = setTimeout(function() {
1734
+ feedbackTimerId = null;
1735
+ if (el.textContent === msg) el.textContent = '';
1736
+ }, 4000);
1551
1737
  }
1552
1738
 
1553
1739
  function clearFeedback() {
1740
+ if (feedbackTimerId) {
1741
+ clearTimeout(feedbackTimerId);
1742
+ feedbackTimerId = null;
1743
+ }
1554
1744
  const el = document.getElementById('feedbackMsg');
1555
1745
  if (el) el.textContent = '';
1556
1746
  }
@@ -1813,26 +2003,29 @@
1813
2003
  const color = colors[currentState] || colors.unstarted;
1814
2004
  const hasProgress = currentProgress !== null && currentProgress !== undefined && Number.isFinite(currentProgress);
1815
2005
  const progVal = hasProgress ? Math.max(0, Math.min(100, currentProgress)) : 0;
2006
+ const ringSig = currentState + ':' + (hasProgress ? progVal : 'null');
2007
+ if (titleProgress.dataset.ringSig !== ringSig) {
2008
+ titleProgress.dataset.ringSig = ringSig;
2009
+ let piePath = '';
2010
+ if (hasProgress && progVal > 0) {
2011
+ const angle = (progVal / 100) * Math.PI * 2;
2012
+ const x = (12 + 7.4 * Math.sin(angle)).toFixed(2);
2013
+ const y = (12 - 7.4 * Math.cos(angle)).toFixed(2);
2014
+ piePath = progVal === 100
2015
+ ? '<path d="M12 4.6a7.4 7.4 0 1 1 0 14.8a7.4 7.4 0 1 1 0-14.8" fill="' + color + '" class="progress-pie"/>'
2016
+ : '<path d="M12 12L12 4.6A7.4 7.4 0 ' + (progVal > 50 ? 1 : 0) + ' 1 ' + x + ' ' + y + 'Z" fill="' + color + '" class="progress-pie"/>';
2017
+ }
1816
2018
 
1817
- let piePath = '';
1818
- if (hasProgress && progVal > 0) {
1819
- const angle = (progVal / 100) * Math.PI * 2;
1820
- const x = (12 + 7.4 * Math.sin(angle)).toFixed(2);
1821
- const y = (12 - 7.4 * Math.cos(angle)).toFixed(2);
1822
- piePath = progVal === 100
1823
- ? '<path d="M12 4.6a7.4 7.4 0 1 1 0 14.8a7.4 7.4 0 1 1 0-14.8" fill="' + color + '" class="progress-pie"/>'
1824
- : '<path d="M12 12L12 4.6A7.4 7.4 0 ' + (progVal > 50 ? 1 : 0) + ' 1 ' + x + ' ' + y + 'Z" fill="' + color + '" class="progress-pie"/>';
1825
- }
1826
-
1827
- const isHundred = progVal === 100;
1828
- const fontSize = isHundred ? '5.8px' : '6.4px';
1829
- const letterSpacing = isHundred ? '-0.3px' : '-0.2px';
2019
+ const isHundred = progVal === 100;
2020
+ const fontSize = isHundred ? '5.8px' : '6.4px';
2021
+ const letterSpacing = isHundred ? '-0.3px' : '-0.2px';
1830
2022
 
1831
- titleProgress.innerHTML = '<svg viewBox="0 0 24 24" width="32" height="32" aria-hidden="true" style="overflow:visible">' +
1832
- '<circle cx="12" cy="12" r="10" fill="none" stroke="' + color + '" stroke-width="1.6" opacity="' + (hasProgress ? '1' : '0.85') + '"/>' +
1833
- piePath +
1834
- '<text x="12" y="12.4" text-anchor="middle" dominant-baseline="middle" fill="' + color + '" class="' + (hasProgress ? '' : 'progress-unknown') + '" style="font:600 ' + fontSize + ' -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:' + letterSpacing + ';font-variant-numeric:tabular-nums">' + (hasProgress ? (progVal + '%') : '—') + '</text>' +
1835
- '</svg>';
2023
+ titleProgress.innerHTML = '<svg viewBox="0 0 24 24" width="32" height="32" aria-hidden="true" style="overflow:visible">' +
2024
+ '<circle cx="12" cy="12" r="10" fill="none" stroke="' + color + '" stroke-width="1.6" opacity="' + (hasProgress ? '1' : '0.85') + '"/>' +
2025
+ piePath +
2026
+ '<text x="12" y="12.4" text-anchor="middle" dominant-baseline="middle" fill="' + color + '" class="' + (hasProgress ? '' : 'progress-unknown') + '" style="font:600 ' + fontSize + ' -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:' + letterSpacing + ';font-variant-numeric:tabular-nums">' + (hasProgress ? (progVal + '%') : '—') + '</text>' +
2027
+ '</svg>';
2028
+ }
1836
2029
  }
1837
2030
 
1838
2031
  if (Array.isArray(data.tasks)) {
@@ -1853,7 +2046,9 @@
1853
2046
  if (historyCount) historyCount.textContent = str('countArrowPattern', { count: completed.length });
1854
2047
 
1855
2048
  const uncompletedList = document.getElementById('uncompletedTasksList');
1856
- if (uncompletedList) {
2049
+ const remSig = activeLang + '|' + JSON.stringify(remaining.map(function(t) { return [t.id, t.status, t.title, t.summary, t.source]; }));
2050
+ if (uncompletedList && uncompletedList.dataset.tasksSig !== remSig) {
2051
+ uncompletedList.dataset.tasksSig = remSig;
1857
2052
  let html = '';
1858
2053
  if (data.tasks.length === 0) {
1859
2054
  html = '<div class="empty">' + escapeHtml(str('emptyNoTasks')) + '</div>';
@@ -1876,7 +2071,9 @@
1876
2071
  }
1877
2072
 
1878
2073
  const historyList = document.getElementById('historyList');
1879
- if (historyList) {
2074
+ const histSig = activeLang + '|' + JSON.stringify(completed.map(function(t) { return [t.id, t.title, t.summary, t.source]; }));
2075
+ if (historyList && historyList.dataset.tasksSig !== histSig) {
2076
+ historyList.dataset.tasksSig = histSig;
1880
2077
  let html = '';
1881
2078
  if (completed.length === 0) {
1882
2079
  html = '<div class="empty">' + escapeHtml(str('emptyCompleted')) + '</div>';
@@ -1992,55 +2189,6 @@
1992
2189
  }, { passive: true });
1993
2190
  }
1994
2191
 
1995
-
1996
- function syncThemeWithHost() {
1997
- try {
1998
- const bg = getComputedStyle(document.documentElement).getPropertyValue('--background').trim();
1999
- const fg = getComputedStyle(document.documentElement).getPropertyValue('--foreground').trim();
2000
- const mutedFg = getComputedStyle(document.documentElement).getPropertyValue('--muted-foreground').trim();
2001
-
2002
- let isLight = false;
2003
- if (bg) {
2004
- if (bg.startsWith('#') && bg.length >= 7) {
2005
- const r = parseInt(bg.slice(1, 3), 16), g = parseInt(bg.slice(3, 5), 16), b = parseInt(bg.slice(5, 7), 16);
2006
- if ((0.299 * r + 0.587 * g + 0.114 * b) > 130) isLight = true;
2007
- } else if (bg.startsWith('rgb')) {
2008
- const m = bg.match(/\d+/g);
2009
- if (m && m.length >= 3 && (0.299 * m[0] + 0.587 * m[1] + 0.114 * m[2]) > 130) isLight = true;
2010
- }
2011
- }
2012
-
2013
- const root = document.documentElement;
2014
- if (isLight) {
2015
- root.style.setProperty('--at-ink', fg || '#22272e');
2016
- root.style.setProperty('--at-secondary', mutedFg || '#576374');
2017
- root.style.setProperty('--at-muted', '#667383');
2018
- root.style.setProperty('--at-note', '#46515f');
2019
- root.style.setProperty('--at-panel-bg', '#ffffff');
2020
- root.style.setProperty('--at-line', '#dfe4ea');
2021
- root.style.setProperty('--at-track', '#c3ccd6');
2022
- root.style.setProperty('--at-input-border', '#c7d0da');
2023
- root.style.setProperty('--at-input-bg', '#f6f8fa');
2024
- root.style.setProperty('--at-hover', '#f3f4f6');
2025
- root.style.setProperty('--at-source-bg', '#f6f8fa');
2026
- root.style.setProperty('color-scheme', 'light');
2027
- } else {
2028
- root.style.setProperty('--at-ink', fg || '#e6edf3');
2029
- root.style.setProperty('--at-secondary', '#a0a6ad');
2030
- root.style.setProperty('--at-muted', '#828c96');
2031
- root.style.setProperty('--at-note', '#bbc3ca');
2032
- root.style.setProperty('--at-panel-bg', '#0e1318');
2033
- root.style.setProperty('--at-line', '#ffffff14');
2034
- root.style.setProperty('--at-track', '#ffffff12');
2035
- root.style.setProperty('--at-input-border', '#ffffff18');
2036
- root.style.setProperty('--at-input-bg', '#ffffff03');
2037
- root.style.setProperty('--at-hover', '#ffffff09');
2038
- root.style.setProperty('--at-source-bg', '#ffffff0a');
2039
- root.style.setProperty('color-scheme', 'dark');
2040
- }
2041
- } catch (_) {}
2042
- }
2043
-
2044
2192
  function resetToEmptySession(nextTitle) {
2045
2193
  isFormDirty = false;
2046
2194
  hideConflictNotice();
@@ -2081,7 +2229,8 @@
2081
2229
 
2082
2230
  window.addEventListener('message', (ev) => {
2083
2231
  if (ev.data?.type === 'theme-change') {
2084
- setTimeout(syncThemeWithHost, 50);
2232
+ syncThemeWithHost();
2233
+ requestAnimationFrame(syncThemeWithHost);
2085
2234
  }
2086
2235
  if (ev.data?.type === 'ANTIGRAVITY_CONVERSATION_CHANGED' || ev.data?.type === 'conversation-change') {
2087
2236
  const newId = (ev.data?.conversationId || ev.data?.id || '').trim();