MessageItem.module.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /* User bubble: right-aligned column (bubble + IconActions). Figma
  2. User_Bubble/message_container 659:38813 — r22 fill, actions gap 6 below. */
  3. .userRow {
  4. display: flex;
  5. flex-direction: column;
  6. align-items: flex-end;
  7. gap: 6px;
  8. }
  9. .userStack {
  10. display: flex;
  11. flex-direction: column;
  12. align-items: flex-end;
  13. gap: 8px;
  14. min-width: 0;
  15. /* The figma 525px cap held as a share of the width axis (525/748 ≈ 0.702):
  16. resolves to the original 525px on the default column and widens with a
  17. dragged or adaptive column. The 748px fallback covers mounts outside the
  18. conversation column, where the axis variable is absent. */
  19. max-width: min(calc(var(--dsh-chat-content-width, 748px) * 0.702), 82%);
  20. }
  21. .bubble {
  22. /* Figma's 525px cap held as a share of the width axis (525/748 ≈ 0.702) so
  23. the bubble widens with a user-dragged or adaptive column; percentage
  24. keeps narrow windows sane. */
  25. max-width: 100%;
  26. background: var(--dsw-specific-bubble);
  27. border-radius: 22px;
  28. /* 42px single-line bubble at the default size: 22 line + 10 vertical
  29. padding each side; the Settings font-size preference moves size and line
  30. height together through the body-published axis. */
  31. padding: 10px 16px;
  32. font-size: var(--dsh-content-font-size, 14px);
  33. line-height: calc(22px + var(--dsh-content-font-delta, 0px));
  34. color: var(--dsw-alias-label-primary);
  35. /* The projected user text is inline runs; the bubble owns wrapping so a
  36. decorated single-line message stays one line. */
  37. white-space: pre-wrap;
  38. word-break: break-word;
  39. }
  40. .referenceSummary {
  41. color: var(--dsw-alias-label-tertiary);
  42. font-size: var(--dsh-content-font-size-secondary, 13px);
  43. line-height: calc(18px + var(--dsh-content-font-delta-secondary, 0px));
  44. }
  45. .contextRow {
  46. padding: 2px 0;
  47. }
  48. /* Compaction marker: one dim 24px row with a context icon at rest and a
  49. hover/focus disclosure for the summary body. Dimmed title (not
  50. label-primary) — the row is a boundary notice, not conversation content. */
  51. .compactionRow {
  52. padding: 2px 0;
  53. }
  54. .compactionButton {
  55. display: flex;
  56. align-items: center;
  57. width: 100%;
  58. height: calc(24px + var(--dsh-content-font-delta, 0px));
  59. min-width: 0;
  60. padding: 0;
  61. border: none;
  62. border-radius: 6px;
  63. background: none;
  64. color: inherit;
  65. font: inherit;
  66. text-align: left;
  67. }
  68. .compactionButton:not(:disabled) {
  69. cursor: pointer;
  70. }
  71. .compactionButton:not(:disabled):hover {
  72. background: var(--dsw-alias-interactive-bg-hover);
  73. }
  74. .compactionLeading {
  75. flex: none;
  76. display: inline-grid;
  77. place-items: center;
  78. width: calc(16px + var(--dsh-content-font-delta, 0px));
  79. height: calc(16px + var(--dsh-content-font-delta, 0px));
  80. margin-right: 6px;
  81. color: var(--dsw-alias-label-secondary);
  82. }
  83. /* Same glyph-scaling rule as DisclosureRow's leading: the CSS edge overrides
  84. the svg attributes so the 14px glyphs follow the font-size delta. */
  85. .compactionLeading svg {
  86. width: calc(14px + var(--dsh-content-font-delta, 0px));
  87. height: calc(14px + var(--dsh-content-font-delta, 0px));
  88. }
  89. .compactionContextIcon,
  90. .compactionDisclosureIcon {
  91. display: inline-flex;
  92. grid-area: 1 / 1;
  93. align-items: center;
  94. justify-content: center;
  95. }
  96. .compactionDisclosureIcon {
  97. opacity: 0;
  98. }
  99. .compactionButton:not(:disabled):hover .compactionContextIcon,
  100. .compactionButton:not(:disabled):focus-visible .compactionContextIcon {
  101. opacity: 0;
  102. }
  103. .compactionButton:not(:disabled):hover .compactionDisclosureIcon,
  104. .compactionButton:not(:disabled):focus-visible .compactionDisclosureIcon {
  105. opacity: 1;
  106. }
  107. .compactionTitle {
  108. flex: none;
  109. font-size: var(--dsh-content-font-size-secondary, 13px);
  110. line-height: calc(24px + var(--dsh-content-font-delta, 0px));
  111. color: var(--dsw-alias-label-primary-dimmed);
  112. }
  113. .compactionSep {
  114. flex: none;
  115. width: 2px;
  116. height: 2px;
  117. margin: 0 8px;
  118. border-radius: 1px;
  119. background: var(--dsw-alias-label-caption);
  120. }
  121. .compactionSummary {
  122. flex: 1 1 auto;
  123. min-width: 0;
  124. overflow: hidden;
  125. color: var(--dsw-alias-label-tertiary);
  126. font-size: var(--dsh-content-font-size-secondary, 13px);
  127. line-height: calc(24px + var(--dsh-content-font-delta, 0px));
  128. text-overflow: ellipsis;
  129. white-space: nowrap;
  130. }
  131. .compactionBody {
  132. /* Indent under the title, which starts at leading (16 + delta) + gap 6. */
  133. padding: 4px 0 4px calc(22px + var(--dsh-content-font-delta, 0px));
  134. color: var(--dsw-alias-label-tertiary);
  135. font-size: var(--dsh-content-font-size-secondary, 13px);
  136. line-height: calc(24px + var(--dsh-content-font-delta, 0px));
  137. }
  138. .retryRow {
  139. color: var(--dsw-alias-label-tertiary);
  140. font-size: var(--dsh-content-font-size-secondary, 13px);
  141. line-height: calc(20px + var(--dsh-content-font-delta-secondary, 0px));
  142. }
  143. .retrySummary {
  144. display: inline-flex;
  145. align-items: center;
  146. width: fit-content;
  147. padding: 2px 0;
  148. gap: 7px;
  149. border-radius: 3px;
  150. color: inherit;
  151. cursor: pointer;
  152. list-style: none;
  153. user-select: none;
  154. }
  155. .retrySummary::-webkit-details-marker {
  156. display: none;
  157. }
  158. .retrySummary::after {
  159. width: 6px;
  160. height: 6px;
  161. border-right: 1.5px solid currentcolor;
  162. border-bottom: 1.5px solid currentcolor;
  163. content: '';
  164. opacity: 0.8;
  165. transform: rotate(-45deg);
  166. transition: transform 120ms ease;
  167. }
  168. .retrySummary:hover {
  169. color: var(--dsw-alias-label-secondary);
  170. }
  171. .retrySummary:focus-visible {
  172. outline: 1.5px solid var(--dsw-alias-button-info-fill);
  173. outline-offset: 2px;
  174. }
  175. .retryText {
  176. color: inherit;
  177. }
  178. .retryRow[data-active] .retryText {
  179. background:
  180. linear-gradient(
  181. 90deg,
  182. var(--dsw-alias-label-tertiary) 0%,
  183. var(--dsw-alias-label-tertiary) 40%,
  184. var(--dsw-alias-label-secondary) 50%,
  185. var(--dsw-alias-label-tertiary) 60%,
  186. var(--dsw-alias-label-tertiary) 100%
  187. );
  188. background-position: 100% 50%;
  189. background-size: 200% 100%;
  190. background-clip: text;
  191. color: transparent;
  192. animation: retry-shimmer 1.6s ease-in-out infinite;
  193. }
  194. .retryRow[open] .retrySummary::after {
  195. transform: rotate(45deg);
  196. }
  197. .retryDetails {
  198. display: grid;
  199. gap: 2px;
  200. margin-top: 3px;
  201. padding-left: 14px;
  202. overflow-wrap: anywhere;
  203. font-size: var(--dsh-content-font-size-secondary, 13px);
  204. line-height: calc(18px + var(--dsh-content-font-delta-secondary, 0px));
  205. }
  206. .retryDetailLabel {
  207. color: var(--dsw-alias-label-secondary);
  208. }
  209. .turnErrorRow {
  210. display: grid;
  211. grid-template-columns: 10px minmax(0, 1fr) auto;
  212. gap: 8px;
  213. align-items: start;
  214. padding: 2px 0;
  215. font-size: var(--dsh-content-font-size-secondary, 13px);
  216. line-height: calc(20px + var(--dsh-content-font-delta-secondary, 0px));
  217. }
  218. .turnErrorDot {
  219. margin-top: 5px;
  220. }
  221. .turnErrorCopy {
  222. min-width: 0;
  223. overflow-wrap: anywhere;
  224. }
  225. .turnErrorTitle {
  226. margin-right: 6px;
  227. color: var(--dsw-alias-state-error-primary);
  228. font-weight: 600;
  229. }
  230. .turnErrorMessage {
  231. color: var(--dsw-alias-label-secondary);
  232. }
  233. .turnErrorCode {
  234. color: var(--dsw-alias-label-tertiary);
  235. font: var(--dsw-font-markdown-code-block-small);
  236. }
  237. .maxTokensTitle {
  238. margin-right: 6px;
  239. color: var(--dsw-alias-state-warn-primary);
  240. font-weight: 600;
  241. }
  242. @keyframes retry-shimmer {
  243. from {
  244. background-position: 100% 50%;
  245. }
  246. to {
  247. background-position: 0 50%;
  248. }
  249. }
  250. @media (prefers-reduced-motion: reduce) {
  251. .retryRow[data-active] .retryText {
  252. background: none;
  253. color: inherit;
  254. animation: none;
  255. }
  256. }
  257. .attachmentRow {
  258. display: flex;
  259. flex-wrap: wrap;
  260. justify-content: flex-end;
  261. max-width: 100%;
  262. gap: 8px;
  263. }
  264. .fileCard {
  265. display: inline-flex;
  266. flex: 0 0 240px;
  267. align-items: center;
  268. gap: 10px;
  269. width: 240px;
  270. min-height: 64px;
  271. padding: 8px 12px;
  272. border: 1px solid var(--dsw-alias-border-l2, rgba(0, 0, 0, 0.12));
  273. border-radius: 16px;
  274. background: var(--dsw-specific-input-major, transparent);
  275. box-sizing: border-box;
  276. }
  277. .fileIcon {
  278. flex: none;
  279. width: 24px;
  280. height: 28px;
  281. }
  282. .fileContent {
  283. display: flex;
  284. flex: 1;
  285. flex-direction: column;
  286. min-width: 0;
  287. }
  288. .fileName {
  289. overflow: hidden;
  290. white-space: nowrap;
  291. text-overflow: ellipsis;
  292. color: var(--dsw-alias-label-primary);
  293. font-size: 14px;
  294. font-weight: 500;
  295. line-height: 22px;
  296. }
  297. .fileMeta {
  298. overflow: hidden;
  299. white-space: nowrap;
  300. text-overflow: ellipsis;
  301. color: var(--dsw-alias-label-tertiary, rgba(0, 0, 0, 0.45));
  302. font-size: 12px;
  303. line-height: 15px;
  304. }