session-turn.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. [data-component="session-turn"] {
  2. --session-turn-sticky-height: 0px;
  3. --sticky-header-height: calc(var(--session-title-height, 0px) + var(--session-turn-sticky-height, 0px) + 12px);
  4. /* flex: 1; */
  5. height: 100%;
  6. min-height: 0;
  7. min-width: 0;
  8. display: flex;
  9. align-items: flex-start;
  10. justify-content: flex-start;
  11. [data-slot="session-turn-content"] {
  12. flex-grow: 1;
  13. width: 100%;
  14. height: 100%;
  15. min-width: 0;
  16. overflow-y: auto;
  17. scrollbar-width: none;
  18. }
  19. [data-slot="session-turn-content"]::-webkit-scrollbar {
  20. display: none;
  21. }
  22. [data-slot="session-turn-message-container"] {
  23. display: flex;
  24. flex-direction: column;
  25. align-items: flex-start;
  26. align-self: stretch;
  27. min-width: 0;
  28. gap: 28px;
  29. overflow-anchor: none;
  30. [data-slot="session-turn-badge"] {
  31. display: inline-flex;
  32. align-items: center;
  33. padding: 2px 6px;
  34. border-radius: 4px;
  35. font-family: var(--font-family-mono);
  36. font-size: var(--font-size-x-small);
  37. font-weight: var(--font-weight-medium);
  38. line-height: var(--line-height-normal);
  39. white-space: nowrap;
  40. color: var(--text-base);
  41. background: var(--surface-raised-base);
  42. }
  43. }
  44. [data-slot="session-turn-attachments"] {
  45. width: 100%;
  46. min-width: 0;
  47. align-self: stretch;
  48. }
  49. [data-slot="session-turn-sticky"] {
  50. width: calc(100% + 9px);
  51. position: sticky;
  52. top: var(--session-title-height, 0px);
  53. z-index: 20;
  54. background-color: var(--background-stronger);
  55. margin-left: -9px;
  56. padding-left: 9px;
  57. padding-bottom: 12px;
  58. display: flex;
  59. flex-direction: column;
  60. gap: 12px;
  61. &::before {
  62. content: "";
  63. position: absolute;
  64. top: 0;
  65. bottom: 0;
  66. left: 0;
  67. right: 0;
  68. background-color: var(--background-stronger);
  69. z-index: -1;
  70. }
  71. &::after {
  72. content: "";
  73. position: absolute;
  74. top: 100%;
  75. left: 0;
  76. right: 0;
  77. height: 32px;
  78. background: linear-gradient(to bottom, var(--background-stronger), transparent);
  79. pointer-events: none;
  80. }
  81. }
  82. [data-slot="session-turn-response-trigger"] {
  83. width: fit-content;
  84. }
  85. [data-slot="session-turn-message-header"] {
  86. display: flex;
  87. align-items: center;
  88. align-self: stretch;
  89. height: 32px;
  90. }
  91. [data-slot="session-turn-message-content"] {
  92. margin-top: 0;
  93. max-width: 100%;
  94. }
  95. [data-component="user-message"] [data-slot="user-message-text"] {
  96. max-height: var(--user-message-collapsed-height, 64px);
  97. }
  98. [data-component="user-message"][data-expanded="true"] [data-slot="user-message-text"] {
  99. max-height: none;
  100. }
  101. [data-component="user-message"][data-can-expand="true"] [data-slot="user-message-text"] {
  102. padding-right: 36px;
  103. padding-bottom: 28px;
  104. }
  105. [data-component="user-message"] [data-slot="user-message-text"] [data-slot="user-message-expand"] {
  106. display: none;
  107. position: absolute;
  108. bottom: 6px;
  109. right: 6px;
  110. padding: 0;
  111. }
  112. [data-component="user-message"][data-can-expand="true"]
  113. [data-slot="user-message-text"]
  114. [data-slot="user-message-expand"],
  115. [data-component="user-message"][data-expanded="true"]
  116. [data-slot="user-message-text"]
  117. [data-slot="user-message-expand"] {
  118. display: inline-flex;
  119. align-items: center;
  120. justify-content: center;
  121. height: 22px;
  122. width: 22px;
  123. border: none;
  124. border-radius: 6px;
  125. background: transparent;
  126. cursor: pointer;
  127. color: var(--text-weak);
  128. [data-slot="icon-svg"] {
  129. transition: transform 0.15s ease;
  130. }
  131. }
  132. [data-component="user-message"][data-expanded="true"]
  133. [data-slot="user-message-text"]
  134. [data-slot="user-message-expand"]
  135. [data-slot="icon-svg"] {
  136. transform: rotate(180deg);
  137. }
  138. [data-component="user-message"] [data-slot="user-message-text"] [data-slot="user-message-expand"]:hover {
  139. background: var(--surface-raised-base);
  140. color: var(--text-base);
  141. }
  142. [data-slot="session-turn-user-badges"] {
  143. display: flex;
  144. align-items: center;
  145. gap: 6px;
  146. padding-left: 16px;
  147. }
  148. [data-slot="session-turn-message-title"] {
  149. width: 100%;
  150. font-size: var(--font-size-large);
  151. font-weight: 500;
  152. color: var(--text-strong);
  153. overflow: hidden;
  154. text-overflow: ellipsis;
  155. min-width: 0;
  156. white-space: nowrap;
  157. }
  158. [data-slot="session-turn-message-title"] h1 {
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. min-width: 0;
  162. white-space: nowrap;
  163. font-size: inherit;
  164. font-weight: inherit;
  165. }
  166. [data-slot="session-turn-typewriter"] {
  167. overflow: hidden;
  168. text-overflow: ellipsis;
  169. min-width: 0;
  170. white-space: nowrap;
  171. }
  172. [data-slot="session-turn-summary-section"] {
  173. width: 100%;
  174. display: flex;
  175. flex-direction: column;
  176. gap: 24px;
  177. align-items: flex-start;
  178. align-self: stretch;
  179. }
  180. [data-slot="session-turn-summary-header"] {
  181. display: flex;
  182. flex-direction: column;
  183. align-items: flex-start;
  184. gap: 4px;
  185. align-self: stretch;
  186. p {
  187. font-size: var(--font-size-base);
  188. line-height: var(--line-height-x-large);
  189. }
  190. }
  191. [data-slot="session-turn-summary-title"] {
  192. font-size: 13px; /* text-12-medium */
  193. font-weight: 500;
  194. color: var(--text-weak);
  195. }
  196. [data-slot="session-turn-markdown"],
  197. [data-slot="session-turn-accordion"] [data-slot="accordion-content"] {
  198. -webkit-user-select: text;
  199. user-select: text;
  200. }
  201. [data-slot="session-turn-markdown"] {
  202. &[data-diffs="true"] {
  203. font-size: 15px;
  204. }
  205. &[data-fade="true"] > * {
  206. animation: fadeUp 0.4s ease-out forwards;
  207. opacity: 0;
  208. &:nth-child(1) {
  209. animation-delay: 0.1s;
  210. }
  211. &:nth-child(2) {
  212. animation-delay: 0.2s;
  213. }
  214. &:nth-child(3) {
  215. animation-delay: 0.3s;
  216. }
  217. &:nth-child(4) {
  218. animation-delay: 0.4s;
  219. }
  220. &:nth-child(5) {
  221. animation-delay: 0.5s;
  222. }
  223. &:nth-child(6) {
  224. animation-delay: 0.6s;
  225. }
  226. &:nth-child(7) {
  227. animation-delay: 0.7s;
  228. }
  229. &:nth-child(8) {
  230. animation-delay: 0.8s;
  231. }
  232. &:nth-child(9) {
  233. animation-delay: 0.9s;
  234. }
  235. &:nth-child(10) {
  236. animation-delay: 1s;
  237. }
  238. &:nth-child(11) {
  239. animation-delay: 1.1s;
  240. }
  241. &:nth-child(12) {
  242. animation-delay: 1.2s;
  243. }
  244. &:nth-child(13) {
  245. animation-delay: 1.3s;
  246. }
  247. &:nth-child(14) {
  248. animation-delay: 1.4s;
  249. }
  250. &:nth-child(15) {
  251. animation-delay: 1.5s;
  252. }
  253. &:nth-child(16) {
  254. animation-delay: 1.6s;
  255. }
  256. &:nth-child(17) {
  257. animation-delay: 1.7s;
  258. }
  259. &:nth-child(18) {
  260. animation-delay: 1.8s;
  261. }
  262. &:nth-child(19) {
  263. animation-delay: 1.9s;
  264. }
  265. &:nth-child(20) {
  266. animation-delay: 2s;
  267. }
  268. &:nth-child(21) {
  269. animation-delay: 2.1s;
  270. }
  271. &:nth-child(22) {
  272. animation-delay: 2.2s;
  273. }
  274. &:nth-child(23) {
  275. animation-delay: 2.3s;
  276. }
  277. &:nth-child(24) {
  278. animation-delay: 2.4s;
  279. }
  280. &:nth-child(25) {
  281. animation-delay: 2.5s;
  282. }
  283. &:nth-child(26) {
  284. animation-delay: 2.6s;
  285. }
  286. &:nth-child(27) {
  287. animation-delay: 2.7s;
  288. }
  289. &:nth-child(28) {
  290. animation-delay: 2.8s;
  291. }
  292. &:nth-child(29) {
  293. animation-delay: 2.9s;
  294. }
  295. &:nth-child(30) {
  296. animation-delay: 3s;
  297. }
  298. }
  299. }
  300. [data-slot="session-turn-summary-section"] {
  301. position: relative;
  302. [data-slot="session-turn-summary-copy"] {
  303. position: absolute;
  304. top: 0;
  305. right: 0;
  306. opacity: 0;
  307. transition: opacity 0.15s ease;
  308. }
  309. &:hover [data-slot="session-turn-summary-copy"] {
  310. opacity: 1;
  311. }
  312. }
  313. [data-slot="session-turn-accordion"] {
  314. width: 100%;
  315. }
  316. [data-component="sticky-accordion-header"] {
  317. top: var(--sticky-header-height, 0px);
  318. &[data-expanded]::before {
  319. top: calc(-1 * var(--sticky-header-height, 0px));
  320. }
  321. }
  322. [data-slot="session-turn-accordion-trigger-content"] {
  323. display: flex;
  324. align-items: center;
  325. justify-content: space-between;
  326. width: 100%;
  327. gap: 20px;
  328. [data-expandable="false"] {
  329. pointer-events: none;
  330. }
  331. }
  332. [data-slot="session-turn-file-info"] {
  333. flex-grow: 1;
  334. display: flex;
  335. align-items: center;
  336. gap: 20px;
  337. min-width: 0;
  338. }
  339. [data-slot="session-turn-file-icon"] {
  340. flex-shrink: 0;
  341. width: 16px;
  342. height: 16px;
  343. }
  344. [data-slot="session-turn-file-path"] {
  345. display: flex;
  346. flex-grow: 1;
  347. min-width: 0;
  348. }
  349. [data-slot="session-turn-directory"] {
  350. color: var(--text-base);
  351. text-overflow: ellipsis;
  352. overflow: hidden;
  353. white-space: nowrap;
  354. direction: rtl;
  355. text-align: left;
  356. }
  357. [data-slot="session-turn-filename"] {
  358. color: var(--text-strong);
  359. flex-shrink: 0;
  360. }
  361. [data-slot="session-turn-accordion-actions"] {
  362. flex-shrink: 0;
  363. display: flex;
  364. gap: 16px;
  365. align-items: center;
  366. justify-content: flex-end;
  367. }
  368. [data-slot="session-turn-accordion-content"] {
  369. max-height: 240px; /* max-h-60 */
  370. overflow-y: auto;
  371. scrollbar-width: none;
  372. }
  373. [data-slot="session-turn-accordion-content"]::-webkit-scrollbar {
  374. display: none;
  375. }
  376. [data-slot="session-turn-response-section"] {
  377. width: calc(100% + 9px);
  378. min-width: 0;
  379. margin-left: -9px;
  380. padding-left: 9px;
  381. }
  382. [data-slot="session-turn-collapsible"] {
  383. gap: 32px;
  384. overflow: visible;
  385. }
  386. [data-slot="session-turn-collapsible-trigger-content"] {
  387. width: fit-content;
  388. display: flex;
  389. align-items: center;
  390. gap: 4px;
  391. color: var(--text-weak);
  392. margin-left: -9px;
  393. [data-component="spinner"] {
  394. width: 12px;
  395. height: 12px;
  396. margin-right: 4px;
  397. }
  398. [data-component="icon"] {
  399. width: 14px;
  400. height: 14px;
  401. }
  402. }
  403. [data-slot="session-turn-retry-message"] {
  404. font-weight: 500;
  405. color: var(--syntax-critical);
  406. }
  407. [data-slot="session-turn-retry-seconds"] {
  408. color: var(--text-weak);
  409. }
  410. [data-slot="session-turn-retry-attempt"] {
  411. color: var(--text-weak);
  412. }
  413. [data-slot="session-turn-details-text"] {
  414. font-size: 13px; /* text-12-medium */
  415. font-weight: 500;
  416. }
  417. .error-card {
  418. color: var(--text-on-critical-base);
  419. max-height: 240px;
  420. overflow-y: auto;
  421. }
  422. [data-slot="session-turn-collapsible-content-inner"] {
  423. width: 100%;
  424. min-width: 0;
  425. display: flex;
  426. flex-direction: column;
  427. align-self: stretch;
  428. gap: 12px;
  429. > :first-child > [data-component="markdown"]:first-child {
  430. margin-top: 0;
  431. }
  432. }
  433. [data-slot="session-turn-permission-parts"] {
  434. width: 100%;
  435. min-width: 0;
  436. display: flex;
  437. flex-direction: column;
  438. gap: 12px;
  439. }
  440. }