session-turn.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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) + 24px);
  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: 18px;
  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-message-header"] {
  83. display: flex;
  84. align-items: center;
  85. align-self: stretch;
  86. height: 32px;
  87. }
  88. [data-slot="session-turn-message-content"] {
  89. margin-top: 0;
  90. max-width: 100%;
  91. }
  92. [data-component="user-message"] [data-slot="user-message-text"] {
  93. max-height: var(--user-message-collapsed-height, 64px);
  94. }
  95. [data-component="user-message"][data-expanded="true"] [data-slot="user-message-text"] {
  96. max-height: none;
  97. }
  98. [data-component="user-message"][data-can-expand="true"] [data-slot="user-message-text"] {
  99. padding-right: 36px;
  100. padding-bottom: 28px;
  101. }
  102. [data-component="user-message"][data-can-expand="true"]:not([data-expanded="true"])
  103. [data-slot="user-message-text"]::after {
  104. content: "";
  105. position: absolute;
  106. left: 0;
  107. right: 0;
  108. height: 8px;
  109. bottom: 0px;
  110. background:
  111. linear-gradient(to bottom, transparent, var(--surface-weak)),
  112. linear-gradient(to bottom, transparent, var(--surface-weak));
  113. pointer-events: none;
  114. }
  115. [data-component="user-message"] [data-slot="user-message-text"] [data-slot="user-message-expand"] {
  116. display: none;
  117. position: absolute;
  118. bottom: 6px;
  119. right: 6px;
  120. padding: 0;
  121. }
  122. [data-component="user-message"][data-can-expand="true"]
  123. [data-slot="user-message-text"]
  124. [data-slot="user-message-expand"],
  125. [data-component="user-message"][data-expanded="true"]
  126. [data-slot="user-message-text"]
  127. [data-slot="user-message-expand"] {
  128. display: inline-flex;
  129. align-items: center;
  130. justify-content: center;
  131. height: 22px;
  132. width: 22px;
  133. border: none;
  134. border-radius: 6px;
  135. background: transparent;
  136. cursor: pointer;
  137. color: var(--text-weak);
  138. [data-slot="icon-svg"] {
  139. transition: transform 0.15s ease;
  140. }
  141. }
  142. [data-component="user-message"][data-expanded="true"]
  143. [data-slot="user-message-text"]
  144. [data-slot="user-message-expand"]
  145. [data-slot="icon-svg"] {
  146. transform: rotate(180deg);
  147. }
  148. [data-component="user-message"] [data-slot="user-message-text"] [data-slot="user-message-expand"]:hover {
  149. background: var(--surface-raised-base);
  150. color: var(--text-base);
  151. }
  152. [data-slot="session-turn-user-badges"] {
  153. display: flex;
  154. align-items: center;
  155. gap: 6px;
  156. padding-left: 16px;
  157. }
  158. [data-slot="session-turn-message-title"] {
  159. width: 100%;
  160. font-size: var(--font-size-large);
  161. font-weight: 500;
  162. color: var(--text-strong);
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. min-width: 0;
  166. white-space: nowrap;
  167. }
  168. [data-slot="session-turn-message-title"] h1 {
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. min-width: 0;
  172. white-space: nowrap;
  173. font-size: inherit;
  174. font-weight: inherit;
  175. }
  176. [data-slot="session-turn-typewriter"] {
  177. overflow: hidden;
  178. text-overflow: ellipsis;
  179. min-width: 0;
  180. white-space: nowrap;
  181. }
  182. [data-slot="session-turn-summary-section"] {
  183. width: 100%;
  184. display: flex;
  185. flex-direction: column;
  186. gap: 24px;
  187. align-items: flex-start;
  188. align-self: stretch;
  189. }
  190. [data-slot="session-turn-summary-header"] {
  191. display: flex;
  192. flex-direction: column;
  193. align-items: flex-start;
  194. gap: 4px;
  195. align-self: stretch;
  196. [data-slot="session-turn-summary-title-row"] {
  197. width: 100%;
  198. display: flex;
  199. align-items: center;
  200. justify-content: space-between;
  201. gap: 12px;
  202. }
  203. [data-slot="session-turn-response"] {
  204. width: 100%;
  205. }
  206. [data-slot="session-turn-response-copy-wrapper"] {
  207. opacity: 0;
  208. pointer-events: none;
  209. transition: opacity 0.15s ease;
  210. }
  211. &:hover [data-slot="session-turn-response-copy-wrapper"],
  212. &:focus-within [data-slot="session-turn-response-copy-wrapper"] {
  213. opacity: 1;
  214. pointer-events: auto;
  215. }
  216. p {
  217. font-size: var(--font-size-base);
  218. line-height: var(--line-height-x-large);
  219. }
  220. }
  221. [data-slot="session-turn-summary-title"] {
  222. font-size: 13px;
  223. /* text-12-medium */
  224. font-weight: 500;
  225. color: var(--text-weak);
  226. }
  227. [data-slot="session-turn-markdown"],
  228. [data-slot="session-turn-accordion"] [data-slot="accordion-content"] {
  229. -webkit-user-select: text;
  230. user-select: text;
  231. }
  232. [data-slot="session-turn-markdown"] {
  233. &[data-diffs="true"] {
  234. font-size: 15px;
  235. }
  236. &[data-fade="true"] > * {
  237. animation: fadeUp 0.4s ease-out forwards;
  238. opacity: 0;
  239. &:nth-child(1) {
  240. animation-delay: 0.1s;
  241. }
  242. &:nth-child(2) {
  243. animation-delay: 0.2s;
  244. }
  245. &:nth-child(3) {
  246. animation-delay: 0.3s;
  247. }
  248. &:nth-child(4) {
  249. animation-delay: 0.4s;
  250. }
  251. &:nth-child(5) {
  252. animation-delay: 0.5s;
  253. }
  254. &:nth-child(6) {
  255. animation-delay: 0.6s;
  256. }
  257. &:nth-child(7) {
  258. animation-delay: 0.7s;
  259. }
  260. &:nth-child(8) {
  261. animation-delay: 0.8s;
  262. }
  263. &:nth-child(9) {
  264. animation-delay: 0.9s;
  265. }
  266. &:nth-child(10) {
  267. animation-delay: 1s;
  268. }
  269. &:nth-child(11) {
  270. animation-delay: 1.1s;
  271. }
  272. &:nth-child(12) {
  273. animation-delay: 1.2s;
  274. }
  275. &:nth-child(13) {
  276. animation-delay: 1.3s;
  277. }
  278. &:nth-child(14) {
  279. animation-delay: 1.4s;
  280. }
  281. &:nth-child(15) {
  282. animation-delay: 1.5s;
  283. }
  284. &:nth-child(16) {
  285. animation-delay: 1.6s;
  286. }
  287. &:nth-child(17) {
  288. animation-delay: 1.7s;
  289. }
  290. &:nth-child(18) {
  291. animation-delay: 1.8s;
  292. }
  293. &:nth-child(19) {
  294. animation-delay: 1.9s;
  295. }
  296. &:nth-child(20) {
  297. animation-delay: 2s;
  298. }
  299. &:nth-child(21) {
  300. animation-delay: 2.1s;
  301. }
  302. &:nth-child(22) {
  303. animation-delay: 2.2s;
  304. }
  305. &:nth-child(23) {
  306. animation-delay: 2.3s;
  307. }
  308. &:nth-child(24) {
  309. animation-delay: 2.4s;
  310. }
  311. &:nth-child(25) {
  312. animation-delay: 2.5s;
  313. }
  314. &:nth-child(26) {
  315. animation-delay: 2.6s;
  316. }
  317. &:nth-child(27) {
  318. animation-delay: 2.7s;
  319. }
  320. &:nth-child(28) {
  321. animation-delay: 2.8s;
  322. }
  323. &:nth-child(29) {
  324. animation-delay: 2.9s;
  325. }
  326. &:nth-child(30) {
  327. animation-delay: 3s;
  328. }
  329. }
  330. }
  331. [data-slot="session-turn-summary-section"] {
  332. position: relative;
  333. [data-slot="session-turn-summary-copy"] {
  334. position: absolute;
  335. top: 0;
  336. right: 0;
  337. opacity: 0;
  338. transition: opacity 0.15s ease;
  339. }
  340. &:hover [data-slot="session-turn-summary-copy"] {
  341. opacity: 1;
  342. }
  343. }
  344. [data-slot="session-turn-accordion"] {
  345. width: 100%;
  346. }
  347. [data-component="sticky-accordion-header"] {
  348. top: var(--sticky-header-height, 0px);
  349. }
  350. [data-component="sticky-accordion-header"][data-expanded]::before,
  351. [data-slot="accordion-item"][data-expanded] [data-component="sticky-accordion-header"]::before {
  352. top: calc(-1 * var(--sticky-header-height, 0px));
  353. }
  354. [data-slot="session-turn-accordion-trigger-content"] {
  355. display: flex;
  356. align-items: center;
  357. justify-content: space-between;
  358. width: 100%;
  359. gap: 20px;
  360. [data-expandable="false"] {
  361. pointer-events: none;
  362. }
  363. }
  364. [data-slot="session-turn-file-info"] {
  365. flex-grow: 1;
  366. display: flex;
  367. align-items: center;
  368. gap: 20px;
  369. min-width: 0;
  370. }
  371. [data-slot="session-turn-file-icon"] {
  372. flex-shrink: 0;
  373. width: 16px;
  374. height: 16px;
  375. }
  376. [data-slot="session-turn-file-path"] {
  377. display: flex;
  378. flex-grow: 1;
  379. min-width: 0;
  380. }
  381. [data-slot="session-turn-directory"] {
  382. color: var(--text-base);
  383. text-overflow: ellipsis;
  384. overflow: hidden;
  385. white-space: nowrap;
  386. direction: rtl;
  387. text-align: left;
  388. }
  389. [data-slot="session-turn-filename"] {
  390. color: var(--text-strong);
  391. flex-shrink: 0;
  392. }
  393. [data-slot="session-turn-accordion-actions"] {
  394. flex-shrink: 0;
  395. display: flex;
  396. gap: 16px;
  397. align-items: center;
  398. justify-content: flex-end;
  399. }
  400. [data-slot="session-turn-accordion-content"] {
  401. max-height: 240px;
  402. /* max-h-60 */
  403. overflow-y: auto;
  404. scrollbar-width: none;
  405. }
  406. [data-slot="session-turn-accordion-content"]::-webkit-scrollbar {
  407. display: none;
  408. }
  409. [data-slot="session-turn-response-section"] {
  410. width: calc(100% + 9px);
  411. min-width: 0;
  412. margin-left: -9px;
  413. padding-left: 9px;
  414. }
  415. [data-slot="session-turn-collapsible"] {
  416. gap: 32px;
  417. overflow: visible;
  418. }
  419. [data-slot="session-turn-collapsible-trigger-content"] {
  420. max-width: 100%;
  421. min-width: 0;
  422. display: flex;
  423. align-items: center;
  424. gap: 8px;
  425. color: var(--text-weak);
  426. [data-slot="session-turn-trigger-icon"] {
  427. color: var(--icon-base);
  428. }
  429. [data-component="spinner"] {
  430. width: 12px;
  431. height: 12px;
  432. margin-right: 4px;
  433. }
  434. [data-component="icon"] {
  435. width: 14px;
  436. height: 14px;
  437. }
  438. }
  439. [data-slot="session-turn-retry-message"] {
  440. font-weight: 500;
  441. color: var(--syntax-critical);
  442. min-width: 0;
  443. overflow: hidden;
  444. text-overflow: ellipsis;
  445. white-space: nowrap;
  446. }
  447. [data-slot="session-turn-retry-seconds"] {
  448. color: var(--text-weak);
  449. }
  450. [data-slot="session-turn-retry-attempt"] {
  451. color: var(--text-weak);
  452. }
  453. [data-slot="session-turn-status-text"] {
  454. overflow: hidden;
  455. text-overflow: ellipsis;
  456. }
  457. [data-slot="session-turn-details-text"] {
  458. font-size: 13px;
  459. /* text-12-medium */
  460. font-weight: 500;
  461. }
  462. .error-card {
  463. color: var(--text-on-critical-base);
  464. max-height: 240px;
  465. white-space: pre-wrap;
  466. overflow-wrap: anywhere;
  467. word-break: break-word;
  468. overflow-y: auto;
  469. }
  470. [data-slot="session-turn-collapsible-content-inner"] {
  471. width: 100%;
  472. min-width: 0;
  473. display: flex;
  474. flex-direction: column;
  475. align-self: stretch;
  476. gap: 12px;
  477. margin-left: 12px;
  478. padding-left: 12px;
  479. padding-right: 12px;
  480. border-left: 1px solid var(--border-base);
  481. > :first-child > [data-component="markdown"]:first-child {
  482. margin-top: 0;
  483. }
  484. }
  485. [data-slot="session-turn-permission-parts"] {
  486. width: 100%;
  487. min-width: 0;
  488. display: flex;
  489. flex-direction: column;
  490. gap: 12px;
  491. }
  492. [data-slot="session-turn-question-parts"] {
  493. width: 100%;
  494. min-width: 0;
  495. display: flex;
  496. flex-direction: column;
  497. gap: 12px;
  498. }
  499. [data-slot="session-turn-answered-question-parts"] {
  500. width: 100%;
  501. min-width: 0;
  502. display: flex;
  503. flex-direction: column;
  504. gap: 12px;
  505. }
  506. }