vpschatbotwidget 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +56 -16
  2. package/dist-lib/types/chatbot/api/chatbot-types.d.ts +8 -1
  3. package/dist-lib/types/chatbot/core/AgentReasoning.d.ts +4 -1
  4. package/dist-lib/types/chatbot/core/ChatContext.d.ts +5 -1
  5. package/dist-lib/types/chatbot/core/ChatHeader.d.ts +2 -0
  6. package/dist-lib/types/chatbot/core/ChatInlineCitation.d.ts +5 -0
  7. package/dist-lib/types/chatbot/core/ChatInput.d.ts +5 -0
  8. package/dist-lib/types/chatbot/core/ChatMarkdown.d.ts +4 -1
  9. package/dist-lib/types/chatbot/core/ChatMessage.d.ts +1 -0
  10. package/dist-lib/types/chatbot/core/ChatMessageActions.d.ts +7 -0
  11. package/dist-lib/types/chatbot/core/ChatMessageList.d.ts +3 -1
  12. package/dist-lib/types/chatbot/core/ChatProvider.d.ts +2 -2
  13. package/dist-lib/types/chatbot/core/GroundedSources.d.ts +5 -0
  14. package/dist-lib/types/chatbot/embedded/EmbeddedChatbot.d.ts +2 -2
  15. package/dist-lib/types/chatbot/hooks/useCopyText.d.ts +4 -0
  16. package/dist-lib/types/chatbot/hooks/useResponseSound.d.ts +6 -0
  17. package/dist-lib/types/chatbot/index.d.ts +1 -1
  18. package/dist-lib/types/chatbot/widget/ChatbotWidget.d.ts +2 -2
  19. package/dist-lib/types/components/ai-elements/inline-citation.d.ts +52 -0
  20. package/dist-lib/types/components/ai-elements/reasoning.d.ts +21 -0
  21. package/dist-lib/types/components/ai-elements/suggestion.d.ts +9 -0
  22. package/dist-lib/types/components/ui/bubble.d.ts +6 -0
  23. package/dist-lib/types/components/ui/button.d.ts +8 -0
  24. package/dist-lib/types/components/ui/hover-card.d.ts +5 -0
  25. package/dist-lib/types/components/ui/input-group.d.ts +5 -0
  26. package/dist-lib/types/components/ui/marker.d.ts +6 -0
  27. package/dist-lib/types/components/ui/message.d.ts +8 -0
  28. package/dist-lib/types/components/ui/trace.d.ts +19 -0
  29. package/dist-lib/types/lib/safeHref.d.ts +1 -0
  30. package/dist-lib/vps-chatbot.cjs +110 -29
  31. package/dist-lib/vps-chatbot.js +9540 -1654
  32. package/package.json +6 -2
  33. package/src/chatbot/api/chatbot-api.ts +1 -0
  34. package/src/chatbot/api/chatbot-types.ts +9 -1
  35. package/src/chatbot/chatbot.test.tsx +125 -7
  36. package/src/chatbot/core/AgentReasoning.tsx +68 -36
  37. package/src/chatbot/core/ChatContext.tsx +5 -0
  38. package/src/chatbot/core/ChatEmptyState.tsx +14 -13
  39. package/src/chatbot/core/ChatError.tsx +20 -12
  40. package/src/chatbot/core/ChatHeader.tsx +17 -1
  41. package/src/chatbot/core/ChatInlineCitation.tsx +63 -0
  42. package/src/chatbot/core/ChatInput.tsx +73 -51
  43. package/src/chatbot/core/ChatMarkdown.tsx +70 -24
  44. package/src/chatbot/core/ChatMessage.tsx +77 -88
  45. package/src/chatbot/core/ChatMessageActions.tsx +51 -0
  46. package/src/chatbot/core/ChatMessageList.tsx +15 -7
  47. package/src/chatbot/core/ChatPanel.tsx +19 -7
  48. package/src/chatbot/core/ChatProvider.tsx +58 -10
  49. package/src/chatbot/core/ChatSuggestions.tsx +14 -34
  50. package/src/chatbot/core/GroundedSources.tsx +113 -90
  51. package/src/chatbot/core/grounding.test.tsx +111 -4
  52. package/src/chatbot/embedded/EmbeddedChatbot.tsx +2 -2
  53. package/src/chatbot/hooks/useCopyText.ts +23 -0
  54. package/src/chatbot/hooks/useResponseSound.ts +74 -0
  55. package/src/chatbot/index.ts +1 -0
  56. package/src/chatbot/widget/ChatbotWidget.tsx +2 -2
  57. package/src/components/ai-elements/inline-citation.tsx +299 -0
  58. package/src/components/ai-elements/reasoning.tsx +126 -0
  59. package/src/components/ai-elements/suggestion.tsx +42 -0
  60. package/src/components/ui/bubble.tsx +18 -0
  61. package/src/components/ui/button.tsx +43 -0
  62. package/src/components/ui/hover-card.tsx +43 -0
  63. package/src/components/ui/input-group.tsx +18 -0
  64. package/src/components/ui/marker.tsx +18 -0
  65. package/src/components/ui/message.tsx +26 -0
  66. package/src/components/ui/trace.tsx +68 -0
  67. package/src/index.css +579 -272
  68. package/src/lib/safeHref.ts +6 -0
package/src/index.css CHANGED
@@ -772,6 +772,7 @@ button {
772
772
  .chat-header-actions {
773
773
  display: flex;
774
774
  align-items: center;
775
+ flex-shrink: 0;
775
776
  gap: 4px;
776
777
  }
777
778
 
@@ -788,10 +789,6 @@ button {
788
789
  flex-shrink: 0;
789
790
  }
790
791
 
791
- .avatar-circle--mt {
792
- margin-top: 2px;
793
- }
794
-
795
792
  /* Back button */
796
793
  .icon-btn-back {
797
794
  display: flex;
@@ -830,42 +827,65 @@ button {
830
827
  color: var(--text-main);
831
828
  }
832
829
 
830
+ .chat-sound-btn[aria-pressed="true"] {
831
+ color: var(--light-blue-900);
832
+ }
833
+
834
+ .chat-sound-btn:focus-visible {
835
+ outline: 2px solid var(--action);
836
+ outline-offset: 1px;
837
+ }
838
+
833
839
  /* ── ChatInput ──────────────────────────────────────────────── */
834
840
  .chat-input-wrapper {
835
841
  background-color: var(--card-bg);
836
- padding: 8px 16px 12px;
842
+ padding: 8px 16px 10px;
837
843
  }
838
844
 
839
- .chat-input-row {
845
+ .chat-input-group {
840
846
  display: flex;
841
- align-items: flex-end;
842
- gap: 8px;
843
- border-radius: 12px;
844
- background-color: var(--input-bg);
845
- padding: 6px 10px;
847
+ flex-direction: column;
848
+ border: 1px solid var(--border-light);
849
+ border-radius: 16px;
850
+ background-color: var(--card-bg);
851
+ padding: 4px 8px 7px;
852
+ }
853
+
854
+ .chat-input-group:focus-within {
855
+ border-color: var(--light-blue-900);
846
856
  }
847
857
 
848
858
  .chat-textarea {
859
+ display: block;
860
+ width: 100%;
861
+ min-height: 32px;
849
862
  max-height: 96px;
850
- flex: 1;
851
863
  resize: none;
852
864
  background: transparent;
853
865
  border: none;
854
866
  outline: none;
855
- padding: 6px 0;
856
- font-size: 13.5px;
867
+ padding: 7px 5px 4px;
868
+ font-size: 14px;
869
+ line-height: 1.45;
857
870
  color: var(--text-main);
858
871
  font-family: inherit;
859
872
  }
860
873
 
861
874
  .chat-textarea::placeholder {
862
- color: var(--text-subtle);
875
+ color: var(--neutral-500);
863
876
  }
864
877
 
865
878
  .chat-textarea:disabled {
866
879
  opacity: 0.6;
867
880
  }
868
881
 
882
+ .chat-input-actions {
883
+ display: flex;
884
+ align-items: center;
885
+ justify-content: space-between;
886
+ gap: 8px;
887
+ }
888
+
869
889
  .chat-send-btn {
870
890
  display: flex;
871
891
  height: 32px;
@@ -873,12 +893,12 @@ button {
873
893
  flex-shrink: 0;
874
894
  align-items: center;
875
895
  justify-content: center;
876
- border-radius: 8px;
896
+ border-radius: 50%;
877
897
  border: none;
878
898
  background-color: var(--action);
879
899
  color: var(--text-on-action);
880
900
  cursor: pointer;
881
- margin-bottom: 2px;
901
+ margin-inline-start: auto;
882
902
  transition: background 0.15s;
883
903
  }
884
904
 
@@ -891,30 +911,37 @@ button {
891
911
  opacity: 0.4;
892
912
  }
893
913
 
914
+ .chat-send-btn:focus-visible,
915
+ .chat-model-picker select:focus-visible {
916
+ outline: 2px solid var(--action);
917
+ outline-offset: 2px;
918
+ }
919
+
894
920
  .chat-input-footer {
895
- margin-top: 8px;
921
+ margin: 8px 0 0;
896
922
  text-align: center;
897
923
  font-size: 11px;
898
924
  font-weight: 500;
899
925
  color: var(--text-subtle);
900
926
  }
901
927
 
928
+ .chat-input-note {
929
+ display: block;
930
+ color: var(--light-blue-900);
931
+ }
932
+
902
933
  .chat-model-picker {
903
- display: flex;
904
- align-items: center;
905
- gap: 8px;
906
- padding-top: 8px;
934
+ min-width: 0;
907
935
  font-size: 12px;
908
- color: var(--text-secondary, #64748b);
936
+ color: var(--light-blue-900);
909
937
  }
910
938
 
911
939
  .chat-model-picker select {
912
- min-width: 0;
913
- max-width: 180px;
914
- padding: 4px 8px;
915
- border: 1px solid var(--border-color, #cbd5e1);
940
+ max-width: min(100%, 180px);
941
+ padding: 4px 6px;
942
+ border: 0;
916
943
  border-radius: 6px;
917
- background: var(--bg-primary, #fff);
944
+ background: var(--surface-muted);
918
945
  color: inherit;
919
946
  font: inherit;
920
947
  }
@@ -929,63 +956,205 @@ button {
929
956
  text-decoration: underline;
930
957
  }
931
958
 
932
- /* ── ChatMessage ─────────────────────────────────────────────── */
933
- .msg-row {
934
- display: flex;
935
- align-items: flex-start;
936
- gap: 10px;
959
+ /* ── Message layout ─────────────────────────────────────────── */
960
+ .chat-message {
961
+ --message-column: 2;
962
+ --avatar-column: 1;
963
+ display: grid;
964
+ grid-template-columns: max-content minmax(0, 1fr);
965
+ grid-template-rows: auto auto auto;
966
+ min-width: 0;
967
+ }
968
+
969
+ .chat-message[data-align="end"] {
970
+ --message-column: 1;
971
+ --avatar-column: 2;
972
+ grid-template-columns: minmax(0, 1fr) max-content;
973
+ }
974
+
975
+ .chat-message:has(> .chat-message-avatar) {
976
+ column-gap: 10px;
977
+ }
978
+
979
+ .chat-message-avatar {
980
+ grid-column: var(--avatar-column);
981
+ grid-row: 2;
982
+ align-self: end;
983
+ width: 28px;
984
+ height: 28px;
985
+ }
986
+
987
+ .chat-message:not(:has(.chat-message-body, .chat-bubble)) > .chat-message-avatar {
988
+ grid-row: 1;
989
+ align-self: start;
990
+ }
991
+
992
+ .chat-message-content {
993
+ display: contents;
994
+ }
995
+
996
+ .chat-message-content > * {
997
+ grid-column: var(--message-column);
998
+ min-width: 0;
937
999
  }
938
1000
 
939
- .msg-row--user {
940
- flex-direction: row-reverse;
1001
+ .chat-message-header {
1002
+ grid-row: 1;
1003
+ margin-bottom: 5px;
941
1004
  }
942
1005
 
943
- .msg-col {
1006
+ .chat-message-footer {
1007
+ grid-row: 3;
944
1008
  display: flex;
945
- max-width: 82%;
946
- flex-direction: column;
1009
+ align-items: center;
1010
+ gap: 6px;
1011
+ margin-top: 3px;
947
1012
  }
948
1013
 
949
- .msg-col--user {
950
- align-items: flex-end;
1014
+ .chat-message[data-align="end"] .chat-message-footer {
1015
+ justify-content: flex-end;
951
1016
  }
952
1017
 
953
- .msg-bubble {
954
- border-radius: 16px;
955
- padding: 10px 14px;
1018
+ .chat-message-body,
1019
+ .chat-bubble {
1020
+ grid-row: 2;
1021
+ overflow-wrap: anywhere;
1022
+ }
1023
+
1024
+ .chat-bubble {
1025
+ justify-self: start;
1026
+ max-width: min(100%, 36ch);
1027
+ border-radius: 14px 14px 14px 5px;
1028
+ padding: 9px 12px;
1029
+ background: var(--bubble-assistant-bg);
1030
+ color: var(--text-main);
956
1031
  font-size: 13.5px;
957
1032
  line-height: 1.55;
958
1033
  }
959
1034
 
960
- .msg-bubble--user {
961
- border-radius: 16px 4px 16px 16px;
962
- background-color: var(--bubble-user-bg);
1035
+ .chat-bubble[data-align="end"] {
1036
+ justify-self: end;
1037
+ border-radius: 14px 14px 5px 14px;
1038
+ background: var(--bubble-user-bg);
963
1039
  color: var(--bubble-user-text);
964
1040
  font-weight: 500;
965
1041
  }
966
1042
 
967
- .msg-bubble--bot {
968
- border-radius: 4px 16px 16px 16px;
969
- border: 1px solid var(--border-light);
970
- background-color: var(--bubble-bot-message-bg);
971
- color: var(--text-main);
972
- }
973
-
974
- .msg-bubble--error {
975
- border-radius: 4px 16px 16px 16px;
1043
+ .chat-bubble[data-variant="destructive"] {
976
1044
  border: 1px solid var(--error-border);
977
- background-color: var(--error-bg);
1045
+ background: var(--error-bg);
978
1046
  color: var(--error-text);
979
1047
  }
980
1048
 
1049
+ .chat-bubble-content {
1050
+ min-width: 0;
1051
+ }
1052
+
1053
+ .chat-message-footer .msg-tick {
1054
+ color: var(--success-700);
1055
+ }
1056
+
1057
+ .chat-marker {
1058
+ display: flex;
1059
+ align-items: center;
1060
+ gap: 7px;
1061
+ min-width: 0;
1062
+ min-height: 24px;
1063
+ color: var(--light-blue-900);
1064
+ font-size: 12px;
1065
+ }
1066
+
1067
+ .chat-marker[data-variant="border"] {
1068
+ border-block-end: 1px solid var(--border-light);
1069
+ }
1070
+
1071
+ .chat-marker[data-variant="separator"]::before,
1072
+ .chat-marker[data-variant="separator"]::after {
1073
+ content: "";
1074
+ flex: 1;
1075
+ border-top: 1px solid var(--border-light);
1076
+ }
1077
+
1078
+ .chat-marker-icon {
1079
+ display: inline-flex;
1080
+ align-items: center;
1081
+ justify-content: center;
1082
+ width: 13px;
1083
+ flex-shrink: 0;
1084
+ }
1085
+
1086
+ .chat-marker-content {
1087
+ min-width: 0;
1088
+ overflow-wrap: anywhere;
1089
+ }
1090
+
1091
+ .chat-marker.sr-only {
1092
+ min-height: 0;
1093
+ }
1094
+
1095
+ .chat-progress-dot {
1096
+ width: 5px;
1097
+ height: 5px;
1098
+ border-radius: 50%;
1099
+ background-color: currentColor;
1100
+ }
1101
+
1102
+ .msg-bubble {
1103
+ border-radius: 16px;
1104
+ padding: 10px 14px;
1105
+ font-size: 13.5px;
1106
+ line-height: 1.55;
1107
+ }
1108
+
981
1109
  .msg-user-pre {
982
1110
  white-space: pre-wrap;
983
1111
  margin: 0;
984
1112
  }
985
1113
 
986
- .msg-tick {
987
- margin-top: 4px;
988
- color: var(--success);
1114
+ .chat-message-actions {
1115
+ display: flex;
1116
+ flex-wrap: wrap;
1117
+ align-items: center;
1118
+ gap: 2px;
1119
+ }
1120
+
1121
+ .chat-message-action {
1122
+ display: inline-grid;
1123
+ place-items: center;
1124
+ width: 30px;
1125
+ height: 30px;
1126
+ padding: 0;
1127
+ border: 0;
1128
+ border-radius: 6px;
1129
+ color: var(--light-blue-900);
1130
+ background: transparent;
1131
+ }
1132
+
1133
+ .chat-message-action:hover:not(:disabled),
1134
+ .chat-message-action[aria-pressed="true"] {
1135
+ color: var(--text-main);
1136
+ background: var(--surface-muted);
1137
+ }
1138
+
1139
+ .chat-message-action[aria-pressed="true"] {
1140
+ background: var(--dark-blue-100);
1141
+ box-shadow: inset 0 0 0 1px var(--dark-blue-200);
1142
+ }
1143
+
1144
+ .chat-message-action:focus-visible {
1145
+ outline: 2px solid var(--action);
1146
+ outline-offset: 1px;
1147
+ }
1148
+
1149
+ .chat-message-action:disabled {
1150
+ cursor: default;
1151
+ opacity: 0.6;
1152
+ }
1153
+
1154
+ .chat-message-copy-status {
1155
+ margin-left: 4px;
1156
+ font-size: 11px;
1157
+ color: var(--light-blue-900);
989
1158
  }
990
1159
 
991
1160
  /* Sources panel */
@@ -1045,25 +1214,6 @@ button {
1045
1214
  white-space: nowrap;
1046
1215
  }
1047
1216
 
1048
- /* Tool call badges */
1049
- .tool-badges {
1050
- margin-top: 8px;
1051
- display: flex;
1052
- flex-wrap: wrap;
1053
- gap: 6px;
1054
- }
1055
-
1056
- .tool-badge {
1057
- display: inline-flex;
1058
- align-items: center;
1059
- border-radius: 9999px;
1060
- border: 1px solid var(--border-light);
1061
- background-color: var(--surface-muted);
1062
- padding: 2px 8px;
1063
- font-size: 11px;
1064
- color: var(--text-muted);
1065
- }
1066
-
1067
1217
  /* ── ChatMarkdown ─────────────────────────────────────────────── */
1068
1218
  .md-content {
1069
1219
  font-family: var(--font-main);
@@ -1137,15 +1287,59 @@ button {
1137
1287
  font-size: 12.5px;
1138
1288
  }
1139
1289
 
1140
- .md-pre {
1290
+ .md-code-block {
1141
1291
  margin: 8px 0;
1142
- overflow-x: auto;
1143
1292
  border-radius: 8px;
1144
- background-color: var(--vps-dark-blue);
1145
- padding: 10px 12px;
1293
+ overflow: hidden;
1294
+ background-color: var(--code-bg);
1295
+ color: var(--text-on-action);
1296
+ }
1297
+
1298
+ .md-code-header {
1299
+ display: flex;
1300
+ align-items: center;
1301
+ gap: 6px;
1302
+ min-height: 34px;
1303
+ padding: 2px 6px 2px 12px;
1304
+ border-bottom: 1px solid var(--vps-light-blue);
1305
+ font-size: 11px;
1306
+ }
1307
+
1308
+ .md-code-status {
1309
+ margin-inline-start: auto;
1310
+ }
1311
+
1312
+ .md-code-header .chat-message-action {
1313
+ color: var(--text-on-action);
1314
+ }
1315
+
1316
+ .md-code-header .chat-message-action:hover:not(:disabled) {
1317
+ background-color: var(--vps-light-blue);
1318
+ }
1319
+
1320
+ .md-code-header .chat-message-action:focus-visible {
1321
+ outline-color: var(--text-on-action);
1322
+ }
1323
+
1324
+ .md-pre {
1325
+ margin: 0;
1326
+ overflow-x: auto;
1327
+ padding: 8px 12px;
1146
1328
  font-family: monospace;
1147
1329
  font-size: 12px;
1148
- color: var(--text-on-action);
1330
+ }
1331
+
1332
+ .md-code-line {
1333
+ display: block;
1334
+ }
1335
+
1336
+ .md-code-number {
1337
+ display: inline-block;
1338
+ min-width: 2ch;
1339
+ margin-inline-end: 12px;
1340
+ color: var(--vps-light-grey);
1341
+ text-align: end;
1342
+ user-select: none;
1149
1343
  }
1150
1344
 
1151
1345
  .md-code {
@@ -1326,46 +1520,109 @@ button {
1326
1520
  }
1327
1521
  }
1328
1522
 
1329
- /* ── ChatSuggestions ─────────────────────────────────────────── */
1330
- .suggestions-badge-list {
1331
- margin-bottom: 8px;
1332
- display: flex;
1333
- flex-wrap: wrap;
1334
- gap: 6px;
1335
- list-style: none;
1336
- padding: 0;
1523
+ /* ── Shared buttons and suggestions ───────────────────────────── */
1524
+ .vps-ui-button {
1525
+ display: inline-flex;
1526
+ align-items: center;
1527
+ justify-content: center;
1528
+ flex-shrink: 0;
1529
+ gap: 4px;
1530
+ border: 1px solid transparent;
1531
+ border-radius: 7px;
1532
+ font-size: 12px;
1533
+ font-weight: 600;
1534
+ font-family: inherit;
1535
+ white-space: nowrap;
1337
1536
  }
1338
1537
 
1339
- .suggestion-badge-item {
1340
- max-width: 100%;
1538
+ .vps-ui-button:focus-visible {
1539
+ outline: 2px solid var(--action);
1540
+ outline-offset: 1px;
1341
1541
  }
1342
1542
 
1343
- .suggestion-badge-btn {
1344
- max-width: 100%;
1345
- overflow: hidden;
1346
- text-overflow: ellipsis;
1347
- white-space: nowrap;
1348
- border-radius: 9999px;
1349
- border: 1px solid var(--border-light);
1543
+ .vps-ui-button:disabled {
1544
+ opacity: 0.55;
1545
+ cursor: not-allowed;
1546
+ }
1547
+
1548
+ .vps-ui-button--default {
1549
+ background-color: var(--action);
1550
+ color: var(--text-on-action);
1551
+ }
1552
+
1553
+ .vps-ui-button--outline {
1554
+ border-color: var(--border-light);
1350
1555
  background-color: var(--card-bg);
1351
- padding: 4px 10px;
1352
- text-align: left;
1353
- font-size: 11.5px;
1354
- font-weight: 600;
1355
1556
  color: var(--text-main);
1356
- cursor: pointer;
1357
- transition: border-color 0.15s, background 0.15s, color 0.15s;
1358
1557
  }
1359
1558
 
1360
- .suggestion-badge-btn:hover:not(:disabled) {
1361
- border-color: var(--primary);
1362
- background-color: var(--tint-solus-10);
1363
- color: var(--primary);
1559
+ .vps-ui-button--secondary {
1560
+ background-color: var(--surface-muted);
1561
+ color: var(--light-blue-900);
1364
1562
  }
1365
1563
 
1366
- .suggestion-badge-btn:disabled {
1367
- cursor: not-allowed;
1368
- opacity: 0.5;
1564
+ .vps-ui-button--ghost,
1565
+ .vps-ui-button--link {
1566
+ background-color: transparent;
1567
+ color: var(--light-blue-900);
1568
+ }
1569
+
1570
+ .vps-ui-button--destructive {
1571
+ background-color: var(--error-bg);
1572
+ color: var(--error-text);
1573
+ }
1574
+
1575
+ .vps-ui-button--outline:hover:not(:disabled),
1576
+ .vps-ui-button--secondary:hover:not(:disabled),
1577
+ .vps-ui-button--ghost:hover:not(:disabled) {
1578
+ background-color: var(--dark-blue-100);
1579
+ }
1580
+
1581
+ .vps-ui-button--link:hover:not(:disabled) {
1582
+ text-decoration: underline;
1583
+ }
1584
+
1585
+ .vps-ui-button--size-default { min-height: 32px; padding-inline: 11px; }
1586
+ .vps-ui-button--size-xs { min-height: 24px; padding-inline: 6px; }
1587
+ .vps-ui-button--size-sm { min-height: 28px; padding-inline: 10px; }
1588
+ .vps-ui-button--size-lg { min-height: 36px; padding-inline: 13px; }
1589
+ .vps-ui-button--size-icon { width: 32px; height: 32px; padding: 0; }
1590
+ .vps-ui-button--size-icon-xs { width: 24px; height: 24px; padding: 0; }
1591
+ .vps-ui-button--size-icon-sm { width: 28px; height: 28px; padding: 0; }
1592
+ .vps-ui-button--size-icon-lg { width: 36px; height: 36px; padding: 0; }
1593
+
1594
+ [data-slot="suggestions"] {
1595
+ display: flex;
1596
+ gap: 8px;
1597
+ overflow-x: auto;
1598
+ overscroll-behavior-x: contain;
1599
+ scrollbar-width: none;
1600
+ }
1601
+
1602
+ [data-slot="suggestions"] > * {
1603
+ flex-shrink: 0;
1604
+ }
1605
+
1606
+ .chat-suggestion-strip {
1607
+ margin-bottom: 5px;
1608
+ padding: 3px 3px 5px;
1609
+ }
1610
+
1611
+ .chat-suggestion-strip .vps-ui-button {
1612
+ border-radius: 999px;
1613
+ }
1614
+
1615
+ @supports (animation-timeline: scroll(self inline)) {
1616
+ .scroll-fade-x {
1617
+ animation: vps-suggestion-edge linear both;
1618
+ animation-timeline: scroll(self inline);
1619
+ }
1620
+
1621
+ @keyframes vps-suggestion-edge {
1622
+ 0% { mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent); }
1623
+ 3%, 97% { mask-image: linear-gradient(to right, transparent, #000 12px calc(100% - 16px), transparent); }
1624
+ 100% { mask-image: linear-gradient(to right, transparent, #000 12px); }
1625
+ }
1369
1626
  }
1370
1627
 
1371
1628
  .suggestions-list {
@@ -1375,47 +1632,119 @@ button {
1375
1632
  gap: 8px;
1376
1633
  }
1377
1634
 
1378
- .suggestion-list-btn {
1379
- border-radius: 8px;
1380
- border: 1px solid var(--border-light);
1635
+ .suggestions-list .vps-ui-button {
1636
+ width: 100%;
1637
+ justify-content: flex-start;
1638
+ }
1639
+
1640
+ /* Post-reply suggestion block shown after last assistant message */
1641
+ .chat-post-reply-suggestions {
1642
+ padding: 4px 0 8px;
1643
+ }
1644
+
1645
+ .chat-post-reply-suggestions .suggestions-list {
1646
+ margin-top: 4px;
1647
+ }
1648
+
1649
+ .chat-post-reply-suggestions .vps-ui-button {
1381
1650
  background-color: var(--card-bg);
1382
- padding: 10px 14px;
1383
- text-align: left;
1384
- font-size: 13px;
1385
- font-weight: 600;
1651
+ border-color: var(--border-light);
1386
1652
  color: var(--text-main);
1387
- cursor: pointer;
1388
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
1389
- transition: transform 0.15s, border-color 0.15s, background 0.15s;
1653
+ font-size: 12.5px;
1654
+ font-weight: 500;
1655
+ text-align: left;
1656
+ border-radius: 10px;
1657
+ transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
1390
1658
  }
1391
1659
 
1392
- .suggestion-list-btn:hover:not(:disabled) {
1393
- transform: translateY(-1px);
1394
- border-color: var(--vps-light-grey);
1395
- background-color: var(--surface-muted);
1660
+ .chat-post-reply-suggestions .vps-ui-button:hover:not(:disabled) {
1661
+ border-color: var(--primary);
1662
+ background-color: var(--orange-50);
1663
+ box-shadow: 0 1px 4px rgba(255, 71, 23, 0.1);
1396
1664
  }
1397
1665
 
1398
- .suggestion-list-btn:disabled {
1399
- cursor: not-allowed;
1400
- opacity: 0.5;
1666
+ /* ── Inline citations ─────────────────────────────────────────── */
1667
+ .inline-citation {
1668
+ display: inline-block;
1669
+ vertical-align: baseline;
1401
1670
  }
1402
1671
 
1403
- /* ── ChatEmptyState ──────────────────────────────────────────── */
1404
- .chat-empty-row {
1405
- display: flex;
1406
- align-items: flex-start;
1407
- gap: 10px;
1672
+ .inline-citation [data-slot="hover-card-trigger"] {
1673
+ border-radius: 999px;
1674
+ font-size: 11px;
1675
+ line-height: 1.2;
1676
+ }
1677
+
1678
+ .vps-hover-card-positioner {
1679
+ isolation: isolate;
1680
+ z-index: 1100;
1408
1681
  }
1409
1682
 
1410
- .chat-empty-bubble {
1411
- max-width: 82%;
1412
- border-radius: 16px 16px 16px 4px;
1683
+ .vps-hover-card {
1684
+ width: min(18rem, calc(100vw - 24px));
1685
+ max-height: min(20rem, var(--available-height, 20rem));
1686
+ overflow: auto;
1413
1687
  border: 1px solid var(--border-light);
1414
- background-color: var(--bubble-assistant-bg);
1415
- padding: 10px 14px;
1416
- font-size: 13.5px;
1417
- line-height: 1.55;
1688
+ border-radius: 12px;
1689
+ background: var(--card-bg);
1418
1690
  color: var(--text-main);
1691
+ box-shadow: 0 8px 28px #1a1a3126;
1692
+ padding: 12px;
1693
+ font: 13px/1.45 var(--font-main);
1694
+ overflow-wrap: anywhere;
1695
+ outline: none;
1696
+ }
1697
+
1698
+ .inline-citation-title {
1699
+ font-weight: 700;
1700
+ }
1701
+
1702
+ .inline-citation-source a {
1703
+ display: inline-block;
1704
+ margin-top: 3px;
1705
+ color: var(--orange-900);
1706
+ text-underline-offset: 2px;
1707
+ }
1708
+
1709
+ .inline-citation-source p,
1710
+ .inline-citation-quote {
1711
+ margin: 6px 0 0;
1712
+ }
1713
+
1714
+ .inline-citation-quote {
1715
+ border-inline-start: 2px solid var(--border-light);
1716
+ padding-inline-start: 8px;
1717
+ color: var(--light-blue-900);
1718
+ }
1719
+
1720
+ .inline-citation-carousel-header {
1721
+ display: flex;
1722
+ align-items: center;
1723
+ gap: 3px;
1724
+ margin-bottom: 6px;
1725
+ color: var(--light-blue-900);
1726
+ font-size: 11px;
1727
+ }
1728
+
1729
+ .inline-citation-carousel-header [aria-live] {
1730
+ margin-inline-end: auto;
1731
+ }
1732
+
1733
+ .inline-citation-viewport { overflow: hidden; }
1734
+ .inline-citation-track { display: flex; touch-action: pan-y pinch-zoom; }
1735
+ .inline-citation-slide { flex: 0 0 100%; min-width: 0; }
1736
+ .inline-citation-carousel[data-orientation="vertical"] .inline-citation-track { flex-direction: column; }
1737
+
1738
+ .reasoning-content .md-content {
1739
+ color: var(--light-blue-900);
1740
+ }
1741
+
1742
+ .reasoning-content [data-streamdown="strong"] {
1743
+ font-weight: 700;
1744
+ }
1745
+
1746
+ .reasoning-text {
1747
+ white-space: pre-wrap;
1419
1748
  }
1420
1749
 
1421
1750
  /* ── ChatError ───────────────────────────────────────────────── */
@@ -1429,8 +1758,12 @@ button {
1429
1758
  color: var(--error-text);
1430
1759
  }
1431
1760
 
1761
+ .chat-error-banner .chat-error-title {
1762
+ white-space: normal;
1763
+ overflow-wrap: anywhere;
1764
+ }
1765
+
1432
1766
  .chat-error-retry-btn {
1433
- margin-top: 6px;
1434
1767
  font-size: 12px;
1435
1768
  font-weight: 600;
1436
1769
  background: none;
@@ -1745,6 +2078,15 @@ button {
1745
2078
  content-visibility: auto;
1746
2079
  }
1747
2080
 
2081
+ .msg-scroller-item[data-role="assistant"] + .msg-scroller-item[data-role="assistant"],
2082
+ .msg-scroller-item[data-role="user"] + .msg-scroller-item[data-role="user"] {
2083
+ margin-top: -8px;
2084
+ }
2085
+
2086
+ .msg-scroller-item[data-role="assistant"]:has(+ .msg-scroller-item[data-role="assistant"]) .chat-message-avatar {
2087
+ visibility: hidden;
2088
+ }
2089
+
1748
2090
  .msg-scroller-btn {
1749
2091
  position: absolute;
1750
2092
  left: 50%;
@@ -1826,175 +2168,139 @@ button {
1826
2168
  transform: rotate(180deg);
1827
2169
  }
1828
2170
 
1829
- /* ── Live response progress and timing ────────────────────────── */
1830
- .msg-streaming-text {
1831
- white-space: pre-wrap;
1832
- overflow-wrap: anywhere;
1833
- line-height: 1.55;
1834
- }
1835
-
1836
- .agent-reasoning-container {
1837
- margin-bottom: 8px;
2171
+ /* ── Chat response trace ──────────────────────────────────────── */
2172
+ .trace {
2173
+ display: flex;
2174
+ flex-direction: column;
2175
+ align-items: flex-start;
2176
+ gap: 2px;
2177
+ min-width: 0;
1838
2178
  font-family: var(--font-main);
2179
+ font-size: 12px;
1839
2180
  }
1840
2181
 
1841
- .agent-reasoning-header {
1842
- display: inline-flex;
1843
- align-items: center;
1844
- gap: 6px;
1845
- padding: 4px 10px;
1846
- border-radius: 8px;
1847
- background: var(--dark-blue-50);
1848
- border: 1px solid var(--dark-blue-100);
1849
- color: var(--vps-dark-blue);
1850
- font-family: var(--font-main);
1851
- font-size: 11.5px;
1852
- font-weight: 500;
1853
- cursor: default;
1854
- user-select: none;
1855
- transition: all 0.15s ease;
2182
+ .trace > * {
2183
+ max-width: 100%;
1856
2184
  }
1857
2185
 
1858
- .agent-reasoning--active .agent-reasoning-header {
1859
- background: var(--dark-blue-50);
1860
- border-color: var(--dark-blue-100);
1861
- color: var(--vps-dark-blue);
2186
+ .trace-line {
2187
+ display: flex;
2188
+ min-width: 0;
2189
+ max-width: 100%;
2190
+ min-height: 24px;
2191
+ align-items: center;
2192
+ gap: 7px;
2193
+ color: var(--light-blue-900);
1862
2194
  }
1863
2195
 
1864
- .agent-reasoning-header-left {
1865
- display: inline-flex;
1866
- align-items: center;
1867
- gap: 6px;
2196
+ .trace-line[data-status="error"] {
2197
+ color: var(--error-text);
1868
2198
  }
1869
2199
 
1870
- .agent-reasoning-spinner {
1871
- color: var(--primary, #0284c7);
1872
- flex-shrink: 0;
1873
- animation: spinSlow 1s linear infinite;
2200
+ .trace-line[data-status="pending"] {
2201
+ opacity: 0.7;
1874
2202
  }
1875
2203
 
1876
- .agent-reasoning-done-icon {
1877
- color: var(--green-600, #16a34a);
2204
+ .trace-icon {
2205
+ display: inline-flex;
1878
2206
  flex-shrink: 0;
1879
2207
  }
1880
2208
 
1881
- .agent-reasoning-title {
1882
- font-size: 11.5px;
1883
- font-weight: 500;
1884
- font-family: var(--font-main);
1885
- letter-spacing: -0.01em;
2209
+ .trace-title {
2210
+ min-width: 0;
2211
+ overflow: hidden;
2212
+ text-overflow: ellipsis;
2213
+ white-space: nowrap;
2214
+ font-weight: 600;
1886
2215
  }
1887
2216
 
1888
- /* ── Grounded Knowledge Sources ───────────────────────────────── */
1889
- .grounded-sources-card {
1890
- margin-top: 10px;
1891
- padding-top: 8px;
1892
- border-top: 1px dashed var(--grey-300);
1893
- display: flex;
1894
- flex-direction: column;
1895
- gap: 7px;
1896
- font-family: var(--font-main);
2217
+ .trace-description {
2218
+ flex-shrink: 0;
2219
+ font-size: 11px;
2220
+ font-variant-numeric: tabular-nums;
1897
2221
  }
1898
2222
 
1899
- .grounded-sources-header {
2223
+ .trace-trigger {
1900
2224
  display: flex;
1901
2225
  align-items: center;
1902
- justify-content: space-between;
2226
+ gap: 5px;
2227
+ width: fit-content;
2228
+ max-width: 100%;
2229
+ min-height: 28px;
2230
+ border: 0;
2231
+ border-radius: 6px;
2232
+ padding: 2px 5px;
2233
+ margin-left: -5px;
2234
+ background: transparent;
2235
+ color: var(--light-blue-900);
2236
+ font: inherit;
2237
+ text-align: left;
1903
2238
  }
1904
2239
 
1905
- .grounded-sources-badge {
1906
- display: inline-flex;
1907
- align-items: center;
1908
- gap: 6px;
1909
- font-size: 11.5px;
1910
- font-weight: 600;
1911
- color: var(--vps-dark-blue);
1912
- font-family: var(--font-main);
2240
+ .trace-trigger:hover,
2241
+ .trace-trigger:focus-visible,
2242
+ .grounded-source-selected {
2243
+ background: var(--surface-muted);
2244
+ color: var(--text-main);
1913
2245
  }
1914
2246
 
1915
- .grounded-shield-icon {
1916
- color: var(--success-600);
1917
- flex-shrink: 0;
2247
+ .trace-trigger:focus-visible {
2248
+ outline: 2px solid var(--action);
2249
+ outline-offset: 1px;
1918
2250
  }
1919
2251
 
1920
- .grounded-toggle-btn {
1921
- display: inline-flex;
1922
- align-items: center;
1923
- gap: 4px;
1924
- background: var(--orange-50);
1925
- border: 1px solid var(--orange-100);
1926
- font-size: 10.5px;
1927
- font-weight: 600;
1928
- color: var(--vps-orange);
1929
- cursor: pointer;
1930
- padding: 2px 7px;
1931
- border-radius: 4px;
1932
- font-family: var(--font-main);
1933
- transition: all 0.15s ease;
2252
+ .trace-trigger[aria-expanded="true"] > .trace-chevron {
2253
+ transform: rotate(90deg);
1934
2254
  }
1935
2255
 
1936
- .grounded-toggle-btn:hover {
1937
- background: var(--orange-100);
1938
- color: var(--orange-600);
2256
+ .chat-response-trace > [data-slot="trace-collapsible"],
2257
+ .chat-response-trace .trace-trigger {
2258
+ width: 100%;
1939
2259
  }
1940
2260
 
1941
- .grounded-pills-row {
1942
- display: flex;
1943
- flex-wrap: wrap;
1944
- gap: 5px;
2261
+ .trace-content {
2262
+ margin: 2px 0 4px 6px;
2263
+ border-left: 1px solid var(--border-light);
2264
+ padding-left: 13px;
2265
+ overflow-wrap: anywhere;
1945
2266
  }
1946
2267
 
1947
- .grounded-source-pill {
1948
- display: inline-flex;
1949
- align-items: center;
1950
- gap: 5px;
1951
- padding: 3px 8px;
1952
- border-radius: 6px;
1953
- background: var(--vps-white);
1954
- border: 1px solid var(--grey-200);
1955
- font-size: 11px;
1956
- color: var(--vps-dark-blue);
1957
- cursor: pointer;
1958
- font-family: var(--font-main);
1959
- transition: all 0.15s ease;
1960
- user-select: none;
1961
- }
2268
+ @media (prefers-reduced-motion: no-preference) {
2269
+ .trace-spinner {
2270
+ animation: spinSlow 1s linear infinite;
2271
+ }
1962
2272
 
1963
- .grounded-source-pill:hover {
1964
- background: var(--orange-50);
1965
- border-color: var(--vps-orange);
1966
- color: var(--vps-orange);
1967
- }
2273
+ .trace-line[data-status="running"] .trace-title {
2274
+ background-image: linear-gradient(100deg, currentColor 40%, var(--grey-700) 50%, currentColor 60%);
2275
+ background-size: 220% 100%;
2276
+ background-clip: text;
2277
+ -webkit-text-fill-color: transparent;
2278
+ animation: trace-shimmer 2s linear infinite;
2279
+ }
1968
2280
 
1969
- .grounded-source-pill--selected {
1970
- background: var(--orange-50);
1971
- border-color: var(--vps-orange);
1972
- color: var(--vps-orange);
1973
- font-weight: 600;
2281
+ @keyframes trace-shimmer {
2282
+ from { background-position: 100% 0; }
2283
+ to { background-position: 0 0; }
2284
+ }
1974
2285
  }
1975
2286
 
1976
- .grounded-book-icon {
1977
- color: var(--vps-orange);
1978
- flex-shrink: 0;
2287
+ @media (forced-colors: active) {
2288
+ .trace-line[data-status="running"] .trace-title {
2289
+ -webkit-text-fill-color: currentColor;
2290
+ animation: none;
2291
+ }
1979
2292
  }
1980
2293
 
1981
- .grounded-pill-title {
1982
- max-width: 140px;
1983
- overflow: hidden;
1984
- text-overflow: ellipsis;
1985
- white-space: nowrap;
1986
- font-family: var(--font-main);
2294
+ /* ── Grounded Knowledge Sources ───────────────────────────────── */
2295
+ .grounded-sources-card {
2296
+ align-items: stretch;
2297
+ margin-top: 10px;
2298
+ padding-top: 8px;
2299
+ border-top: 1px dashed var(--grey-300);
1987
2300
  }
1988
2301
 
1989
- .grounded-pill-score {
1990
- font-size: 9.5px;
1991
- font-weight: 600;
1992
- color: var(--success-600);
1993
- background: var(--success-50);
1994
- border: 1px solid var(--success-200, #bef4d4);
1995
- padding: 1px 4px;
1996
- border-radius: 3px;
1997
- font-family: var(--font-main);
2302
+ .grounded-source-rows {
2303
+ padding-left: 18px;
1998
2304
  }
1999
2305
 
2000
2306
  .grounded-sources-details-list {
@@ -2025,6 +2331,7 @@ button {
2025
2331
 
2026
2332
  .grounded-detail-top {
2027
2333
  display: flex;
2334
+ flex-wrap: wrap;
2028
2335
  align-items: center;
2029
2336
  justify-content: space-between;
2030
2337
  gap: 8px;