@zyro-sec/session-ui 0.0.0-stage → 1.0.4

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 (261) hide show
  1. package/AGENTS.md +25 -0
  2. package/bunfig.toml +2 -0
  3. package/component-tests/basic-tool.fixture.tsx +46 -0
  4. package/component-tests/basic-tool.spec.ts +63 -0
  5. package/component-tests/file-media.fixture.tsx +39 -0
  6. package/component-tests/file-media.spec.ts +13 -0
  7. package/component-tests/file-tool.spec.ts +62 -0
  8. package/component-tests/file-viewer.fixture.tsx +109 -0
  9. package/component-tests/file-viewer.spec.ts +134 -0
  10. package/component-tests/file.spec.ts +33 -0
  11. package/component-tests/line-comment-v2.spec.ts +15 -0
  12. package/component-tests/markdown-code-wrap.spec.ts +94 -0
  13. package/component-tests/markdown-readiness.spec.ts +95 -0
  14. package/component-tests/markdown.fixture.tsx +104 -0
  15. package/component-tests/markdown.spec.ts +1564 -0
  16. package/component-tests/mermaid-preview.spec.ts +43 -0
  17. package/component-tests/patch-group.spec.ts +79 -0
  18. package/component-tests/read-group.spec.ts +72 -0
  19. package/component-tests/read-image.fixture.tsx +66 -0
  20. package/component-tests/read-image.spec.ts +154 -0
  21. package/component-tests/session-compaction.spec.ts +254 -0
  22. package/component-tests/session-lifecycle.spec.ts +190 -0
  23. package/component-tests/session-message-projection.spec.ts +639 -0
  24. package/component-tests/session-notice-projection.spec.ts +20 -0
  25. package/component-tests/session-review-comments.spec.ts +179 -0
  26. package/component-tests/session-shell.spec.ts +93 -0
  27. package/component-tests/session-timeline-mobile.spec.ts +201 -0
  28. package/component-tests/session-timeline-notices.spec.ts +38 -0
  29. package/component-tests/session-timeline-reasoning.spec.ts +107 -0
  30. package/component-tests/session-timeline.spec.ts +157 -0
  31. package/component-tests/session-tool-projection.spec.ts +323 -0
  32. package/component-tests/text-lifecycle.fixture.tsx +26 -0
  33. package/component-tests/text-lifecycle.spec.ts +42 -0
  34. package/component-tests/timeline-subagent-rows.spec.ts +33 -0
  35. package/component-tests/tool-disclosure.spec.ts +48 -0
  36. package/component-tests/tool-group-sticky.spec.ts +37 -0
  37. package/component-tests/tool-group.spec.ts +290 -0
  38. package/component-tests/tool-status-title.fixture.tsx +22 -0
  39. package/component-tests/tool-status-title.spec.ts +30 -0
  40. package/component-tests/user-message-quotes.spec.ts +111 -0
  41. package/package.json +91 -4
  42. package/playwright.components.config.ts +4 -0
  43. package/playwright.local.config.ts +2 -0
  44. package/src/actions.ts +54 -0
  45. package/src/components/apply-patch-file.ts +122 -0
  46. package/src/components/basic-tool.css +487 -0
  47. package/src/components/basic-tool.tsx +258 -0
  48. package/src/components/copy-machine.ts +78 -0
  49. package/src/components/copy.ts +85 -0
  50. package/src/components/diagram-preview.tsx +28 -0
  51. package/src/components/disclosure-machine.ts +188 -0
  52. package/src/components/disclosure.ts +129 -0
  53. package/src/components/dock-prompt.stories.tsx +73 -0
  54. package/src/components/dock-prompt.tsx +29 -0
  55. package/src/components/file-comment-selection.tsx +146 -0
  56. package/src/components/file-media-machine.ts +165 -0
  57. package/src/components/file-media.stories.tsx +112 -0
  58. package/src/components/file-media.tsx +323 -0
  59. package/src/components/file-search.tsx +73 -0
  60. package/src/components/file.css +59 -0
  61. package/src/components/file.tsx +1300 -0
  62. package/src/components/image-preview.tsx +35 -0
  63. package/src/components/line-comment-annotations.tsx +580 -0
  64. package/src/components/line-comment-machine.ts +262 -0
  65. package/src/components/line-comment-styles.ts +293 -0
  66. package/src/components/line-comment.stories.tsx +152 -0
  67. package/src/components/line-comment.tsx +448 -0
  68. package/src/components/link-segments.ts +20 -0
  69. package/src/components/linked-text.tsx +21 -0
  70. package/src/components/markdown-cache-machine.ts +257 -0
  71. package/src/components/markdown-cache.tsx +556 -0
  72. package/src/components/markdown-clipboard.ts +101 -0
  73. package/src/components/markdown-code-machine.ts +200 -0
  74. package/src/components/markdown-code-state.ts +22 -0
  75. package/src/components/markdown-fragment-links.ts +74 -0
  76. package/src/components/markdown-github.svg +3 -0
  77. package/src/components/markdown-globe.svg +5 -0
  78. package/src/components/markdown-image-machine.ts +170 -0
  79. package/src/components/markdown-image.ts +156 -0
  80. package/src/components/markdown-inline-code-kind.ts +39 -0
  81. package/src/components/markdown-mermaid.ts +18 -0
  82. package/src/components/markdown-phase-machine.ts +102 -0
  83. package/src/components/markdown-projection.ts +13 -0
  84. package/src/components/markdown-session-links.ts +183 -0
  85. package/src/components/markdown-solid.test.tsx +92 -0
  86. package/src/components/markdown-solid.tsx +113 -0
  87. package/src/components/markdown-stream.ts +95 -0
  88. package/src/components/markdown-worker-machine.ts +516 -0
  89. package/src/components/markdown-worker-protocol.ts +73 -0
  90. package/src/components/markdown-worker.ts +250 -0
  91. package/src/components/markdown.css +672 -0
  92. package/src/components/markdown.stories.tsx +199 -0
  93. package/src/components/markdown.tsx +1612 -0
  94. package/src/components/markdown.worker.ts +188 -0
  95. package/src/components/message-file.ts +102 -0
  96. package/src/components/message-nav.css +134 -0
  97. package/src/components/message-nav.tsx +159 -0
  98. package/src/components/message-part.css +2109 -0
  99. package/src/components/message-part.tsx +3 -0
  100. package/src/components/question-prompt-experimental.css +576 -0
  101. package/src/components/question-prompt.css +527 -0
  102. package/src/components/quote-highlight.css +59 -0
  103. package/src/components/review-focus-driver.ts +142 -0
  104. package/src/components/review-focus-machine.ts +95 -0
  105. package/src/components/session-compaction.css +270 -0
  106. package/src/components/session-diff.ts +358 -0
  107. package/src/components/session-error.tsx +41 -0
  108. package/src/components/session-retry.tsx +92 -0
  109. package/src/components/session-review-machine.ts +241 -0
  110. package/src/components/session-review.css +264 -0
  111. package/src/components/session-review.stories.tsx +232 -0
  112. package/src/components/session-review.tsx +733 -0
  113. package/src/components/session-turn.css +282 -0
  114. package/src/components/shell-submessage.css +24 -0
  115. package/src/components/timeline-separator.tsx +69 -0
  116. package/src/components/tool-count-label.css +57 -0
  117. package/src/components/tool-count-label.tsx +76 -0
  118. package/src/components/tool-count-summary.css +102 -0
  119. package/src/components/tool-count-summary.stories.tsx +99 -0
  120. package/src/components/tool-count-summary.tsx +44 -0
  121. package/src/components/tool-error-card.css +178 -0
  122. package/src/components/tool-error-card.stories.tsx +113 -0
  123. package/src/components/tool-error-card.tsx +202 -0
  124. package/src/components/tool-status-title-machine.ts +128 -0
  125. package/src/components/tool-status-title.css +89 -0
  126. package/src/components/tool-status-title.tsx +163 -0
  127. package/src/context/data.tsx +107 -0
  128. package/src/context/index.ts +1 -0
  129. package/src/context/markdown.tsx +129 -0
  130. package/src/context/sources.tsx +34 -0
  131. package/src/document.ts +8 -0
  132. package/src/file-presentation.ts +34 -0
  133. package/src/message/action-machine.ts +72 -0
  134. package/src/message/agent-label.ts +3 -0
  135. package/src/message/attachment-card.css +119 -0
  136. package/src/message/attachment-card.tsx +40 -0
  137. package/src/message/attachment-media-machine.ts +213 -0
  138. package/src/message/comment-card.tsx +155 -0
  139. package/src/message/compaction-entrance-machine.ts +93 -0
  140. package/src/message/current-message.tsx +157 -0
  141. package/src/message/current-tool-state.ts +161 -0
  142. package/src/message/message-content.tsx +1391 -0
  143. package/src/message/paced-text-machine.ts +73 -0
  144. package/src/message/prompt-message.stories.tsx +149 -0
  145. package/src/message/relative-time.ts +45 -0
  146. package/src/message/user-message-quote-parts.ts +16 -0
  147. package/src/message/user-message-quotes.stories.tsx +797 -0
  148. package/src/message/user-message-quotes.tsx +135 -0
  149. package/src/pierre/comment-hover-machine.ts +53 -0
  150. package/src/pierre/comment-hover.ts +131 -0
  151. package/src/pierre/comment-selection-machine.ts +257 -0
  152. package/src/pierre/commented-lines.ts +106 -0
  153. package/src/pierre/diff-selection.ts +91 -0
  154. package/src/pierre/file-find-machine.ts +323 -0
  155. package/src/pierre/file-find.ts +537 -0
  156. package/src/pierre/file-runtime.ts +42 -0
  157. package/src/pierre/file-selection.ts +140 -0
  158. package/src/pierre/index.ts +344 -0
  159. package/src/pierre/media.ts +140 -0
  160. package/src/pierre/render-machine.ts +381 -0
  161. package/src/pierre/selection-bridge.ts +82 -0
  162. package/src/pierre/selection-machine.ts +198 -0
  163. package/src/pierre/virtualizer.ts +114 -0
  164. package/src/pierre/worker.ts +46 -0
  165. package/src/sources/experiment.ts +59 -0
  166. package/src/sources/site-icon.tsx +53 -0
  167. package/src/sources/sources-chip.tsx +57 -0
  168. package/src/sources/sources-expand-machine.ts +101 -0
  169. package/src/sources/sources-panel.tsx +249 -0
  170. package/src/sources/sources-title.tsx +21 -0
  171. package/src/sources/sources.css +266 -0
  172. package/src/sources/sources.ts +141 -0
  173. package/src/storybook/current-session-fixtures.ts +1492 -0
  174. package/src/storybook/current-session-scenarios.ts +76 -0
  175. package/src/storybook/current-session-story.tsx +154 -0
  176. package/src/storybook/index.ts +43 -0
  177. package/src/styles/index.css +19 -0
  178. package/src/timeline/__snapshots__/group-labels.test.ts.snap +110 -0
  179. package/src/timeline/__snapshots__/placement.test.ts.snap +1041 -0
  180. package/src/timeline/code-blocks.stories.tsx +105 -0
  181. package/src/timeline/commentary.stories.tsx +70 -0
  182. package/src/timeline/commentary.ts +38 -0
  183. package/src/timeline/detail.ts +111 -0
  184. package/src/timeline/error-card.stories.tsx +134 -0
  185. package/src/timeline/error-spacing.stories.tsx +71 -0
  186. package/src/timeline/facts.ts +493 -0
  187. package/src/timeline/file-changes.stories.tsx +436 -0
  188. package/src/timeline/group-label-fixtures.ts +97 -0
  189. package/src/timeline/mermaid.stories.tsx +131 -0
  190. package/src/timeline/place.ts +280 -0
  191. package/src/timeline/placement-fixtures.ts +365 -0
  192. package/src/timeline/placement-reactivity.ts +133 -0
  193. package/src/timeline/projection.ts +1261 -0
  194. package/src/timeline/research-and-agents.stories.tsx +461 -0
  195. package/src/timeline/session-timeline-row.tsx +1675 -0
  196. package/src/timeline/session-timeline.tsx +68 -0
  197. package/src/timeline/steer-arrival-machine.ts +134 -0
  198. package/src/timeline/terminal-work.stories.tsx +464 -0
  199. package/src/timeline/timeline-row.stories.tsx +1069 -0
  200. package/src/timeline/timeline-row.ts +238 -0
  201. package/src/timeline/turn-phase-machine.ts +112 -0
  202. package/src/timeline/user-message-fold.stories.tsx +194 -0
  203. package/src/timeline/user-runs.ts +87 -0
  204. package/src/timeline-next/__snapshots__/placement.test.ts.snap +990 -0
  205. package/src/timeline-next/compaction.tsx +236 -0
  206. package/src/timeline-next/errors.ts +101 -0
  207. package/src/timeline-next/event-row.tsx +168 -0
  208. package/src/timeline-next/events.ts +103 -0
  209. package/src/timeline-next/index.ts +10 -0
  210. package/src/timeline-next/nested-rail.ts +125 -0
  211. package/src/timeline-next/projection.ts +1028 -0
  212. package/src/timeline-next/row.tsx +1728 -0
  213. package/src/timeline-next/rules.ts +89 -0
  214. package/src/timeline-next/separator.tsx +73 -0
  215. package/src/timeline-next/spacing.ts +127 -0
  216. package/src/timeline-next/status-line.tsx +41 -0
  217. package/src/timeline-next/status.ts +33 -0
  218. package/src/timeline-next/stories/compare-renderer.stories.tsx +190 -0
  219. package/src/timeline-next/stories/compare-sessions/.gitignore +3 -0
  220. package/src/timeline-next/stories/compare.stories.tsx +486 -0
  221. package/src/timeline-next/stories/playground.stories.tsx +297 -0
  222. package/src/timeline-next/stories/session-replay.ts +1156 -0
  223. package/src/timeline-next/stories/session-timeline.tsx +50 -0
  224. package/src/timeline-next/stories/subagent-status.stories.tsx +132 -0
  225. package/src/timeline-next/timeline-next.css +649 -0
  226. package/src/timeline-next/tools/__snapshots__/activity-label.test.ts.snap +39 -0
  227. package/src/timeline-next/tools/activity-label.ts +166 -0
  228. package/src/timeline-next/tools/assistant-content.tsx +84 -0
  229. package/src/timeline-next/tools/context-group.tsx +619 -0
  230. package/src/timeline-next/tools/error-card.tsx +147 -0
  231. package/src/timeline-next/tools/explore.tsx +119 -0
  232. package/src/timeline-next/tools/file-group.tsx +128 -0
  233. package/src/timeline-next/tools/patch.tsx +174 -0
  234. package/src/timeline-next/tools/shell.tsx +186 -0
  235. package/src/timeline-next/tools/thought.tsx +87 -0
  236. package/src/timeline-next/tools/tool-display.tsx +119 -0
  237. package/src/tools/ansi.ts +8 -0
  238. package/src/tools/context-group-label.ts +123 -0
  239. package/src/tools/file-runs.ts +35 -0
  240. package/src/tools/project-path.ts +18 -0
  241. package/src/tools/read-group.stories.tsx +159 -0
  242. package/src/tools/run-machine.ts +185 -0
  243. package/src/tools/shell-output-machine.ts +233 -0
  244. package/src/tools/shell-output.ts +91 -0
  245. package/src/tools/subagent-row-variants.stories.tsx +129 -0
  246. package/src/tools/tool-group.stories.tsx +345 -0
  247. package/src/tools/tool-renderer.tsx +2876 -0
  248. package/src/v2/components/line-comment-annotations-v2.tsx +215 -0
  249. package/src/v2/components/session-file-panel-v2.tsx +149 -0
  250. package/src/v2/components/session-progress-indicator-v2.css +5 -0
  251. package/src/v2/components/session-progress-indicator-v2.stories.tsx +86 -0
  252. package/src/v2/components/session-progress-indicator-v2.tsx +16 -0
  253. package/src/v2/components/session-review-empty-changes-v2.tsx +17 -0
  254. package/src/v2/components/session-review-empty-no-git-v2.tsx +28 -0
  255. package/src/v2/components/session-review-file-preview-v2-virtualize.ts +5 -0
  256. package/src/v2/components/session-review-file-preview-v2.tsx +266 -0
  257. package/src/v2/components/session-review-v2.css +653 -0
  258. package/src/v2/components/session-review-v2.tsx +422 -0
  259. package/src/v2/components/sidebar-presence-machine.ts +69 -0
  260. package/tsconfig.json +20 -0
  261. package/README.md +0 -3
@@ -0,0 +1,649 @@
1
+ /*
2
+ * The New timeline's styles. Every rule hangs off [data-timeline="next"], which only the New timeline's rows and status
3
+ * lane carry, so none of them can reach the current timeline.
4
+ */
5
+
6
+ [data-timeline="next"] [data-component="context-tool-group-trigger"] {
7
+ /* An activity label: what the agent did, muted, then what it touched in base text. */
8
+ [data-slot="context-tool-group-title"][data-activity] {
9
+ gap: 6px;
10
+ }
11
+
12
+ [data-slot="context-tool-group-verb"],
13
+ [data-slot="context-tool-group-detail"],
14
+ [data-slot="context-tool-group-separator"],
15
+ [data-slot="context-tool-group-elapsed"] {
16
+ flex-shrink: 0;
17
+ font-family: var(--v2-font-family-sans);
18
+ font-size: 13px;
19
+ font-weight: 440;
20
+ line-height: var(--line-height-compact);
21
+ letter-spacing: -0.04px;
22
+ white-space: nowrap;
23
+ }
24
+
25
+ [data-slot="context-tool-group-verb"],
26
+ [data-slot="context-tool-group-separator"],
27
+ [data-slot="context-tool-group-elapsed"] {
28
+ color: var(--v2-text-text-muted);
29
+ }
30
+
31
+ [data-slot="context-tool-group-detail"] {
32
+ flex-shrink: 1;
33
+ min-width: 0;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ color: var(--v2-text-text-base);
37
+ }
38
+ }
39
+
40
+ /* Thoughts one after another read as one, a paragraph apart. */
41
+ [data-timeline="next"] [data-slot="reasoning-part-run"] {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 12px;
45
+ }
46
+
47
+ /* A script's changes, each its own card, keep the spacing of a direct patch's files. */
48
+ [data-timeline="next"] [data-script-change="patch"] + [data-script-change="patch"] {
49
+ margin-top: var(--timeline-gap-s);
50
+ }
51
+
52
+ /* Each changed file is its own accordion, rather than one stacked group, as far from the next
53
+ as any two rows. */
54
+ [data-timeline="next"] [data-component="accordion"][data-scope="apply-patch"] {
55
+ gap: var(--timeline-gap-s);
56
+
57
+ [data-slot="accordion-item"] + [data-slot="accordion-item"] {
58
+ margin-top: 0;
59
+ }
60
+
61
+ [data-slot="accordion-item"] [data-slot="accordion-header"] [data-slot="accordion-trigger"] {
62
+ border-radius: var(--radius-lg);
63
+ }
64
+
65
+ [data-slot="accordion-item"][data-expanded] [data-slot="accordion-header"] [data-slot="accordion-trigger"] {
66
+ border-bottom-left-radius: 0;
67
+ border-bottom-right-radius: 0;
68
+ }
69
+
70
+ [data-slot="accordion-item"][data-expanded] [data-slot="accordion-content"] {
71
+ border-bottom-left-radius: var(--radius-lg);
72
+ border-bottom-right-radius: var(--radius-lg);
73
+ }
74
+
75
+ /* A created file is all new, so its code reads plain rather than as one long addition. */
76
+ [data-slot="accordion-item"][data-type="add"] {
77
+ --opencode-diffs-addition-bg: transparent;
78
+ --opencode-diffs-addition-number-fg: var(--v2-text-text-faint);
79
+ --opencode-diffs-addition-color: transparent;
80
+ --diffs-addition-color-override: transparent;
81
+ }
82
+ }
83
+
84
+ /* A command the user ran is its command and output, always showing, as an agent's command shows once opened. */
85
+ [data-timeline="next"] [data-component="shell-tool"] [data-slot="shell-tool-writing"] {
86
+ display: block;
87
+ font-size: 13px;
88
+ line-height: var(--line-height-compact);
89
+ color: var(--v2-text-text-muted);
90
+ }
91
+
92
+ /* A file's change counts follow its name, showing only the side that changed; its change bars are quieter; and its
93
+ toggle sits as far from the right edge as the file icon does from the left, since the icon's arrows are drawn narrow
94
+ inside their box. */
95
+ [data-timeline="next"] [data-component="accordion"][data-scope="apply-patch"] [data-slot="accordion-item"] {
96
+ --opencode-diffs-bar-opacity: 0.5;
97
+
98
+ [data-slot="apply-patch-file-name-container"] {
99
+ flex-grow: 0;
100
+ }
101
+
102
+ [data-component="diff-changes"] {
103
+ flex-shrink: 0;
104
+ }
105
+
106
+ [data-component="diff-changes"] [data-empty] {
107
+ display: none;
108
+ }
109
+
110
+ [data-slot="apply-patch-trigger-actions"] > :last-child {
111
+ margin-inline-end: -4px;
112
+ }
113
+
114
+ /* Half the usual hover overlay, so the header only hints that it toggles. */
115
+ @media (hover: hover) {
116
+ [data-slot="accordion-header"] [data-slot="accordion-trigger"]:hover:not([data-disabled]) {
117
+ background-color: color-mix(in srgb, var(--v2-overlay-simple-overlay-hover) 50%, transparent);
118
+ }
119
+ }
120
+ }
121
+
122
+ /* Anything nested under a row hangs from a line 2px in from the row's leading edge, with the
123
+ content 14px in: a group's rows, a thought's text, search results, an error. */
124
+ [data-timeline="next"]
125
+ [data-component="collapsible"].tool-collapsible:not([data-rail="false"])
126
+ > [data-slot="collapsible-content"] {
127
+ position: relative;
128
+ margin-inline-start: 0;
129
+ padding-inline-start: 14px;
130
+
131
+ /* Its ends follow the first and last text, measured by nested-rail.ts. Half the border color at rest; the strip it
132
+ sits in closes the row, and brightens it while the pointer is over it. */
133
+ &::before {
134
+ content: "";
135
+ display: block;
136
+ position: absolute;
137
+ inset-inline-start: 2px;
138
+ inset-block-start: var(--rail-top, 4px);
139
+ inset-block-end: var(--rail-bottom, 4px);
140
+ width: 1px;
141
+ background-color: color-mix(in srgb, var(--v2-border-border-base) 50%, transparent);
142
+ pointer-events: none;
143
+ }
144
+
145
+ &[data-rail-hover]::before {
146
+ background-color: var(--v2-border-border-base);
147
+ }
148
+ }
149
+
150
+ /* A goal the user set reads as their message, opening with a /goal tag centered on the first line. The tag sits as far
151
+ from the bubble's leading edge as from its top: the top padding plus the space the 16px tag leaves in that line. The
152
+ gap is a registered length, so it resolves against the bubble's line and the smaller tag inherits that value. */
153
+ @property --timeline-next-goal-tag-gap {
154
+ syntax: "<length>";
155
+ inherits: true;
156
+ initial-value: 0px;
157
+ }
158
+
159
+ [data-timeline="next"] [data-component="user-message"][data-goal] [data-slot="user-message-text"] {
160
+ --timeline-next-goal-tag-gap: calc((1lh - 16px) / 2);
161
+ padding-inline-start: calc(8px + var(--timeline-next-goal-tag-gap));
162
+
163
+ [data-slot="user-message-goal-badge"] {
164
+ margin-block-start: var(--timeline-next-goal-tag-gap);
165
+ margin-inline-end: 6px;
166
+ vertical-align: top;
167
+ }
168
+ }
169
+
170
+ /* Rows in an opened group read like the group's own label: the tool muted, what it worked on bright, counts muted, all at
171
+ one weight. A tool shown on its own row, as the most detailed settings show each call, reads the same. */
172
+ [data-timeline="next"]
173
+ :is(
174
+ [data-component="context-tool-group-list"] [data-slot="context-tool-group-item"],
175
+ [data-slot="session-turn-assistant-content"] > [data-component="tool-part-wrapper"],
176
+ [data-slot="session-turn-assistant-content"] > [data-component="read-tool-group"]
177
+ ) {
178
+ [data-slot="basic-tool-tool-title"],
179
+ [data-slot="basic-tool-tool-subtitle"],
180
+ [data-slot="basic-tool-tool-arg"],
181
+ [data-slot="context-tool-group-matches"] {
182
+ font-weight: 440;
183
+ }
184
+
185
+ [data-slot="basic-tool-tool-title"] {
186
+ color: var(--v2-text-text-muted);
187
+ }
188
+
189
+ [data-slot="basic-tool-tool-subtitle"],
190
+ [data-slot="basic-tool-tool-arg"] {
191
+ color: var(--v2-text-text-base);
192
+ }
193
+
194
+ [data-slot="context-tool-group-matches"] {
195
+ color: var(--v2-text-text-muted);
196
+ }
197
+
198
+ /* A compact row sets its title's weight from a more specific rule, so this one names the trigger too. */
199
+ [data-component="collapsible"] > [data-slot="collapsible-trigger"] [data-slot="basic-tool-tool-title"] {
200
+ font-weight: 440;
201
+ }
202
+
203
+ [data-slot="context-tool-group-match-count"] {
204
+ flex-shrink: 0;
205
+ }
206
+
207
+ /* A thought's subtitle is how long it took, which the label keeps muted. */
208
+ [data-component="reasoning-part"] [data-slot="basic-tool-tool-subtitle"] {
209
+ color: var(--v2-text-text-muted);
210
+ }
211
+
212
+ [data-slot="tool-loaded-label"] {
213
+ font-weight: 440;
214
+ color: var(--v2-text-text-muted);
215
+ }
216
+ /* A fetched page's link reads like a link in the user's message: the row's text color, underlined faintly. */
217
+ [data-slot="basic-tool-tool-subtitle"].webfetch-link {
218
+ color: var(--v2-text-text-base);
219
+
220
+ [data-slot="webfetch-link-text"] {
221
+ text-decoration: underline;
222
+ text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
223
+ text-underline-offset: 2px;
224
+ }
225
+
226
+ &:hover [data-slot="webfetch-link-text"] {
227
+ text-decoration-color: currentColor;
228
+ }
229
+
230
+ .webfetch-link-icon {
231
+ display: none;
232
+ }
233
+ }
234
+ }
235
+
236
+ /* An event row opens to the subagents and shells it counts, each read like a nested row and leading to its session or
237
+ to the call that ran it. An opened activity group lists the ones it started or heard back from the same way. */
238
+ [data-timeline="next"] [data-component="timeline-event-list"] {
239
+ display: flex;
240
+ flex-direction: column;
241
+ gap: 8px;
242
+ padding-top: 4px;
243
+ }
244
+
245
+ [data-timeline="next"]
246
+ :is(
247
+ [data-component="timeline-event-list"],
248
+ [data-slot="context-tool-group-item"],
249
+ [data-component="timeline-subagent"]
250
+ ) {
251
+ [data-slot="timeline-event-item"] {
252
+ display: flex;
253
+ align-items: center;
254
+ gap: 6px;
255
+ min-height: 28px;
256
+ min-width: 0;
257
+ font-family: var(--v2-font-family-sans);
258
+ font-size: 13px;
259
+ font-weight: 440;
260
+ line-height: var(--line-height-compact);
261
+ letter-spacing: -0.04px;
262
+ text-decoration: none;
263
+ cursor: default;
264
+
265
+ &[aria-disabled] {
266
+ pointer-events: none;
267
+ }
268
+
269
+ &:focus-visible {
270
+ outline: 2px solid var(--v2-border-border-focus);
271
+ outline-offset: 2px;
272
+ border-radius: 4px;
273
+ }
274
+ }
275
+
276
+ /* Agents are named as configured, often in lowercase; the subagent card capitalizes them the same way. */
277
+ [data-slot="timeline-event-item-name"] {
278
+ flex-shrink: 0;
279
+ color: var(--v2-text-text-muted);
280
+ white-space: nowrap;
281
+ text-transform: capitalize;
282
+ }
283
+
284
+ [data-slot="timeline-event-item-title"] {
285
+ min-width: 0;
286
+ overflow: hidden;
287
+ text-overflow: ellipsis;
288
+ white-space: nowrap;
289
+ color: var(--v2-text-text-base);
290
+ }
291
+
292
+ [data-slot="timeline-event-item"] [data-component="tag"] {
293
+ flex-shrink: 0;
294
+ }
295
+
296
+ /* A subagent's status: a bar and word, in the state's color, say what happened, so no status word follows the
297
+ title. Updated is info blue softened toward muted; the others use their state colors as they are. */
298
+ [data-slot="timeline-event-item-status"] {
299
+ display: inline-flex;
300
+ flex-shrink: 0;
301
+ align-items: center;
302
+ gap: 6px;
303
+ font-weight: 530;
304
+ white-space: nowrap;
305
+
306
+ &::before {
307
+ content: "";
308
+ flex-shrink: 0;
309
+ width: 3px;
310
+ height: 10px;
311
+ border-radius: 999px;
312
+ background: currentColor;
313
+ }
314
+
315
+ &[data-state="started"] {
316
+ color: var(--v2-text-text-faint);
317
+ }
318
+
319
+ &[data-state="updated"] {
320
+ color: color-mix(in srgb, var(--v2-state-fg-info) 70%, var(--v2-text-text-muted));
321
+ }
322
+
323
+ &[data-state="completed"] {
324
+ color: var(--v2-state-fg-success);
325
+ }
326
+
327
+ &[data-state="failed"] {
328
+ color: var(--v2-state-fg-danger);
329
+ }
330
+
331
+ &[data-state="stopped"] {
332
+ color: var(--v2-text-text-muted);
333
+ }
334
+ }
335
+ }
336
+
337
+ /* Rows are spaced by block: rows that continue a block sit the small gap below the one above, and a
338
+ row starting a block (the user's message, the agent's work in reply, an interruption) sits the large gap below.
339
+ The row directly above holds the gap, below its content: the turn gap before a turn's first row, else the row
340
+ before. It is a frame's only space; rows add none of their own. A gap above a row's content would grow that row
341
+ when the row before it loads, and move the rows on screen. */
342
+ [data-timeline="next"] {
343
+ --timeline-gap-s: 16px;
344
+ --timeline-gap-m: 20px;
345
+ --timeline-gap-l: 32px;
346
+ }
347
+
348
+ [data-timeline="next"][data-timeline-gap="s"] {
349
+ padding-bottom: var(--timeline-gap-s);
350
+ }
351
+
352
+ [data-timeline="next"][data-timeline-gap="m"] {
353
+ padding-bottom: var(--timeline-gap-m);
354
+ }
355
+
356
+ [data-timeline="next"][data-timeline-gap="l"] {
357
+ padding-bottom: var(--timeline-gap-l);
358
+ }
359
+
360
+ /* Rows are as tall as their text, so the gaps between them are the gaps that show. A row's 28px click area stays: 6px of
361
+ padding above and below, taken back by margins of the same size, so neighbouring click areas meet without overlapping.
362
+ An open row's header ends the small gap above its first nested row. */
363
+ [data-timeline="next"] {
364
+ [data-component="timeline-subagent"] {
365
+ display: grid;
366
+
367
+ > [data-slot="timeline-event-item"] {
368
+ gap: 8px;
369
+ }
370
+ }
371
+
372
+ [data-component="timeline-subagent"] > [data-slot="timeline-event-item"],
373
+ [data-component="collapsible"].tool-collapsible > [data-slot="collapsible-trigger"],
374
+ [data-component="card"][data-kind="tool-error-card"]
375
+ > [data-component="collapsible"]
376
+ > [data-slot="collapsible-trigger"] {
377
+ height: calc(var(--line-height-compact) + 12px);
378
+ padding-block: 6px;
379
+ margin-block: -6px;
380
+ }
381
+
382
+ [data-component="collapsed-tool-group"] > [data-component="collapsible"].tool-collapsible {
383
+ --tool-content-gap: var(--timeline-gap-s);
384
+ gap: 0;
385
+
386
+ > [data-slot="collapsible-trigger"] {
387
+ height: calc(var(--line-height-compact) + 12px);
388
+ padding-block: 6px;
389
+ margin-block: -6px;
390
+ }
391
+
392
+ > [data-slot="collapsible-trigger"][aria-expanded="true"] {
393
+ height: calc(var(--line-height-compact) + 6px + var(--timeline-gap-s));
394
+ padding-bottom: var(--timeline-gap-s);
395
+ margin-bottom: 0;
396
+ }
397
+ }
398
+
399
+ [data-component="context-tool-group-trigger"] {
400
+ height: var(--line-height-compact);
401
+ min-height: 0;
402
+ }
403
+
404
+ /* Rows a group draws itself, and its row of reads, sit on the same line of text as any other. */
405
+ [data-slot="context-tool-group-item"] {
406
+ [data-component="tool-trigger"],
407
+ [data-slot="basic-tool-tool-trigger-content"],
408
+ [data-slot="basic-tool-tool-info"] {
409
+ min-height: 0;
410
+ line-height: var(--line-height-compact);
411
+ }
412
+ }
413
+
414
+ [data-component="read-tool-group"] {
415
+ --read-tool-group-height: var(--line-height-compact);
416
+
417
+ [data-component="tool-trigger"],
418
+ [data-slot="basic-tool-tool-trigger-content"],
419
+ [data-slot="basic-tool-tool-info"] {
420
+ min-height: 0;
421
+ line-height: var(--line-height-compact);
422
+ }
423
+ }
424
+
425
+ /* The agent's text has a taller line than its rows; trimming the half-leading at its edges puts its first and last
426
+ lines where a row's text would sit, so the gaps around it read the same. */
427
+ [data-component="text-part"] [data-component="markdown"],
428
+ [data-component="reasoning-part"] [data-component="markdown"] {
429
+ text-box: trim-both text;
430
+ }
431
+
432
+ [data-component="text-part"] {
433
+ margin-top: 0;
434
+ }
435
+
436
+ /* A reply's footer sits below the line box, as in the current timeline, so its last line keeps the bottom half-leading. */
437
+ [data-component="text-part"]:has(> [data-slot="text-part-footer"], > [data-slot="text-part-copy-wrapper"])
438
+ [data-component="markdown"] {
439
+ text-box: trim-start text;
440
+ }
441
+
442
+ [data-component="context-tool-group-list"],
443
+ [data-component="timeline-event-list"] {
444
+ gap: var(--timeline-gap-s);
445
+ padding-top: 0;
446
+ }
447
+
448
+ [data-component="context-tool-group-list"] [data-slot="context-tool-group-item"],
449
+ [data-component="context-tool-group-list"] [data-slot="timeline-event-item"],
450
+ [data-component="timeline-event-list"] [data-slot="timeline-event-item"] {
451
+ min-height: var(--line-height-compact);
452
+ }
453
+
454
+ [data-component="context-tool-group-list"]
455
+ [data-slot="context-tool-group-item"]
456
+ > [data-component="tool-part-wrapper"]
457
+ > [data-component="collapsible"]
458
+ > [data-slot="collapsible-trigger"] {
459
+ height: calc(var(--line-height-compact) + 12px);
460
+ padding-block: 6px;
461
+ margin-block: -6px;
462
+ }
463
+
464
+ /* An open row's nested content starts the small gap below its header. */
465
+ [data-component="collapsible"].tool-collapsible:has(> [data-slot="collapsible-content"]) {
466
+ gap: 0;
467
+
468
+ > [data-slot="collapsible-trigger"][aria-expanded="true"] {
469
+ margin-bottom: 0;
470
+ padding-bottom: var(--timeline-gap-s);
471
+ height: calc(var(--line-height-compact) + 6px + var(--timeline-gap-s));
472
+ }
473
+ }
474
+
475
+ /* Answers are spaced by the row gaps and trimmed to their text, as the agent's text is. */
476
+ [data-component="question-answers"] {
477
+ gap: var(--timeline-gap-s);
478
+ padding: 0;
479
+ line-height: var(--line-height-base);
480
+
481
+ [data-slot="question-answer-item"] {
482
+ gap: 4px;
483
+ }
484
+
485
+ [data-slot="question-text"],
486
+ [data-slot="answer-text"] {
487
+ text-box: trim-both text;
488
+ }
489
+ }
490
+
491
+ /* A row's action is as tall as its line, so its button never makes the row taller. */
492
+ [data-slot="basic-tool-action"] {
493
+ height: var(--line-height-compact);
494
+
495
+ [data-component="icon-button-v2"] {
496
+ width: 20px;
497
+ height: 20px;
498
+ }
499
+ }
500
+
501
+ /* The quiet compaction draws the same line as the other dividers. */
502
+ [data-component="session-compaction-message"][data-quiet] {
503
+ [data-slot="session-compaction-line"]::before {
504
+ background: var(--v2-border-border-base);
505
+ }
506
+
507
+ [data-slot="session-compaction-summary"] {
508
+ padding-bottom: 0;
509
+ }
510
+ }
511
+ }
512
+
513
+ /* The live thought sits where the row it settles into will, which its frame spaces like any other row. */
514
+ [data-timeline="next"] [data-component="session-turn"] [data-slot="session-turn-thinking-row"][data-live-slot] {
515
+ margin-top: 0;
516
+ }
517
+
518
+ /* Rows fill the column, so shell output and other cards span the timeline whatever their content. */
519
+ [data-timeline="next"] [data-component="session-turn"] [data-slot="session-turn-message-container"] {
520
+ align-items: stretch;
521
+ }
522
+
523
+ /* Laid out like the agent's next row: a line of text below the gap that row would take, so the status line sits where
524
+ that row lands and the live thought takes its exact place. */
525
+ [data-timeline="next"][data-component="timeline-status-lane"] {
526
+ --timeline-status-space: 0px;
527
+ display: flex;
528
+ align-items: center;
529
+ gap: 8px;
530
+ height: calc(var(--line-height-compact) + var(--timeline-status-space));
531
+ padding-top: var(--timeline-status-space);
532
+
533
+ /* The timeline's gaps between rows, which the lane sits outside of. */
534
+ &[data-spacing="s"] {
535
+ --timeline-status-space: var(--timeline-gap-s);
536
+ }
537
+
538
+ &[data-spacing="m"] {
539
+ --timeline-status-space: var(--timeline-gap-m);
540
+ }
541
+
542
+ &[data-spacing="l"] {
543
+ --timeline-status-space: var(--timeline-gap-l);
544
+ }
545
+
546
+ /* The background hint's 24px button is centred on the 16px line and reaches 4px past it. A row clips at its own
547
+ height, so in a row the lane keeps that room below the line, whether or not the hint shows, so the input waiting
548
+ below does not move when it comes and goes. */
549
+ &[data-in-row] {
550
+ --timeline-status-hint-overflow: calc((24px - var(--line-height-compact)) / 2);
551
+ height: calc(var(--line-height-compact) + var(--timeline-status-space) + var(--timeline-status-hint-overflow));
552
+ padding-bottom: var(--timeline-status-hint-overflow);
553
+ }
554
+
555
+ &[data-collapsed] {
556
+ height: 0;
557
+ padding-top: 0;
558
+ padding-bottom: 0;
559
+ overflow: hidden;
560
+ }
561
+
562
+ [data-slot="timeline-status-label"] {
563
+ font-family: var(--v2-font-family-sans);
564
+ font-size: 13px;
565
+ font-weight: 440;
566
+ line-height: var(--line-height-compact);
567
+ letter-spacing: -0.04px;
568
+ color: var(--v2-text-text-muted);
569
+ }
570
+ }
571
+
572
+ /* A failed call reads like the other rows: the tool muted, its subject bright, then a Failed
573
+ tag. Opening it shows the error in full. */
574
+ [data-timeline="next"] [data-component="card"][data-kind="tool-error-card"] {
575
+ [data-slot="basic-tool-tool-title"] {
576
+ font-weight: 440;
577
+ color: var(--v2-text-text-muted);
578
+ }
579
+
580
+ [data-slot="basic-tool-tool-subtitle"] {
581
+ color: var(--v2-text-text-base);
582
+ }
583
+
584
+ [data-slot="tool-error-card-failed"] {
585
+ flex-shrink: 0;
586
+ }
587
+
588
+ /* A row's line of text inside its 28px click area, as the timeline's other rows have; the card's own 24px trigger
589
+ would leave less room than the line and clip it. Open, it ends the small gap above the error. */
590
+ > [data-component="collapsible"] > [data-slot="collapsible-trigger"] {
591
+ height: calc(var(--line-height-compact) + 12px);
592
+ }
593
+
594
+ > [data-component="collapsible"] > [data-slot="collapsible-trigger"][aria-expanded="true"] {
595
+ height: calc(var(--line-height-compact) + 6px + var(--timeline-gap-s));
596
+ }
597
+
598
+ /* Its taller lines trim to their text at the edges, so the gaps around the error read like the gaps between rows. */
599
+ [data-slot="tool-error-card-content"] [data-slot="card-description"] {
600
+ text-box: trim-both text;
601
+ }
602
+
603
+ /* Without the warning icon, the error hangs from the nested line like any other row's content. */
604
+ [data-slot="tool-error-card-content"] {
605
+ padding-left: 0;
606
+ }
607
+
608
+ > [data-component="collapsible"].tool-collapsible > [data-slot="collapsible-content"] {
609
+ padding-inline-start: 14px;
610
+
611
+ &::before {
612
+ display: block;
613
+ }
614
+ }
615
+ }
616
+
617
+ /* A row's line clips only sideways, where its subtitle truncates, so a tag as tall as the line is never cut at the
618
+ top or bottom by rounding. */
619
+ [data-timeline="next"] [data-slot="basic-tool-tool-info-main"] {
620
+ overflow: clip visible;
621
+ }
622
+
623
+ /* Keyboard focus rings the row's line of text, rounded, inside its click area. The trigger itself also holds that area
624
+ and, open, the gap below the row, so a ring on it would take in the gap. */
625
+ [data-timeline="next"] [data-slot="collapsible-trigger"]:focus-visible {
626
+ outline: none;
627
+
628
+ > [data-component="tool-trigger"] {
629
+ border-radius: 4px;
630
+ outline: 2px solid var(--v2-border-border-focus);
631
+ outline-offset: 2px;
632
+ }
633
+ }
634
+
635
+ /* An open group's sticky header ends the gap above its first row and would paint over that row's ring. Its last 4px,
636
+ the width of a ring outside its row, stay unpainted, so the ring shows there and a row scrolling under the header
637
+ still passes beneath it. */
638
+ [data-timeline="next"]
639
+ [data-component="collapsed-tool-group"]
640
+ > [data-component="collapsible"].tool-collapsible
641
+ > [data-slot="collapsible-trigger"][aria-expanded="true"] {
642
+ clip-path: inset(-8px -8px min(4px, var(--tool-content-gap)) -8px);
643
+ }
644
+
645
+ /* A command set in its monospace face sits on the line's top rather than its baseline, so the row stays one line tall
646
+ with it as without it, and opening the row never moves its label. */
647
+ [data-timeline="next"] [data-component="shell-submessage"] [data-slot="shell-submessage-value"] {
648
+ vertical-align: top;
649
+ }
@@ -0,0 +1,39 @@
1
+ // Bun Snapshot v1, https://bun.sh/docs/test/snapshots
2
+
3
+ exports[`group labels the New timeline names a group by what it did 1`] = `
4
+ {
5
+ "background outcomes only": "Finished 2 shells",
6
+ "edits": "Edited 3 files · 1 read",
7
+ "empty": "Updates",
8
+ "failed calls": "Edited a.ts · 1 command, 1 read",
9
+ "mixed tools": "Ran 1 command · Questions, Browser, custom_tool, 1 read",
10
+ "one edit": "Edited a.ts",
11
+ "reads and searches": "Explored 2 files, 2 searches, 1 web search, 1 page",
12
+ "shells with background outcomes": "Ran 1 command · finished 1 shell, started 1 shell, stopped 1 shell",
13
+ "skills": "Explored 2 skills",
14
+ "still running": "Ran 1 command · 1 read",
15
+ "thoughts": "Used 1 Thought",
16
+ "thoughts and tools": "Explored 1 file",
17
+ "v1 tool names": "Edited z.ts · 1 command",
18
+ }
19
+ `;
20
+
21
+ exports[`group labels background shells count once, as how they ended 1`] = `
22
+ {
23
+ "failed": 0,
24
+ "verbs": [
25
+ {
26
+ "count": 1,
27
+ "verb": "finished",
28
+ },
29
+ {
30
+ "count": 1,
31
+ "verb": "started",
32
+ },
33
+ {
34
+ "count": 1,
35
+ "verb": "stopped",
36
+ },
37
+ ],
38
+ }
39
+ `;