@zyro-sec/session-ui 0.0.0-stage → 1.0.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 (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,797 @@
1
+ import { For, Show, type JSX } from "solid-js"
2
+ import type { PromptAttachment, SessionMessageUser } from "@zyro-sec/client/promise"
3
+ import type { SessionUserActions, SessionUserComment } from "../actions"
4
+ import { CurrentUserMessageDisplay } from "./message-content"
5
+ import { CurrentSessionProviders } from "../storybook/current-session-story"
6
+ import { CURRENT_SESSION_ID, STORY_MODEL, STORY_TIME } from "../storybook/current-session-fixtures"
7
+
8
+ /*
9
+ * A prompt's quotes, file comments and notes: as cards below the text (Cards, what beta and prod show), and inline in
10
+ * the bubble after the text (Inline, `inlineQuotes`, on in local and dev builds). Every case renders the shipped
11
+ * CurrentUserMessageDisplay both ways.
12
+ */
13
+
14
+ type Quote = Extract<SessionUserComment, { type: "quote" }>
15
+
16
+ type Status = NonNullable<ReturnType<NonNullable<SessionUserActions["pending"]>["status"]>>
17
+
18
+ type Case = {
19
+ name: string
20
+ description: string
21
+ text?: string
22
+ comments: SessionUserComment[]
23
+ status?: Status
24
+ voice?: boolean
25
+ /** A bubble sent just before, so the two form a run. */
26
+ run?: boolean
27
+ /** Forces Collapse long messages on for this case. */
28
+ fold?: boolean
29
+ files?: PromptAttachment[]
30
+ agents?: SessionMessageUser["agents"]
31
+ }
32
+
33
+ export default {
34
+ title: "OpenCode/Conversation/Prompt quotes",
35
+ id: "current-prompt-quotes",
36
+ parameters: { layout: "fullscreen" },
37
+ args: { width: 480, scheme: "lab", direction: "ltr", fold: false, touch: false },
38
+ argTypes: {
39
+ width: { control: { type: "range", min: 320, max: 840, step: 20 } },
40
+ scheme: { options: ["lab", "light", "dark"] },
41
+ direction: { options: ["ltr", "rtl"] },
42
+ },
43
+ }
44
+
45
+ const terminal = { label: "Terminal", icon: "terminal" }
46
+
47
+ const longQuote =
48
+ "The scrollbar thumb has a 32px minimum height, capped at the track height, so very long sessions still show a grabbable handle. The remaining space is reserved for the timeline content, and the thumb fades out after 800ms without scrolling. On touch devices the thumb is hidden entirely and the native overscroll takes over, which is why the gutter collapses to zero there."
49
+
50
+ const mentionsText = "Use @review to check @projects.tsx before changing the sidebar spacing"
51
+
52
+ const quote = (text: string, comment?: string, source?: Quote["source"]): Quote => ({
53
+ type: "quote",
54
+ text,
55
+ comment,
56
+ source,
57
+ })
58
+
59
+ const mention = (text: string, token: string) => ({
60
+ text: token,
61
+ start: text.indexOf(token),
62
+ end: text.indexOf(token) + token.length,
63
+ })
64
+
65
+ const image: PromptAttachment = {
66
+ data: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
67
+ mime: "image/png",
68
+ name: "sidebar.png",
69
+ source: { type: "inline" },
70
+ }
71
+
72
+ const notes: PromptAttachment = {
73
+ data: "e30=",
74
+ mime: "application/json",
75
+ name: "spacing.json",
76
+ source: { type: "inline" },
77
+ }
78
+
79
+ const cases = {
80
+ oneCommented: {
81
+ name: "One quote with a comment",
82
+ description: "The simplest case: a short quote and what to do about it.",
83
+ comments: [quote("gap-2 on the Projects section", "drop it to gap 1")],
84
+ },
85
+ severalCommented: {
86
+ name: "Several short quotes, each commented",
87
+ description: "Every quote carries its own instruction, with no composer text.",
88
+ comments: [
89
+ quote("gap-2 on the Projects section", "drop it to gap 1"),
90
+ quote("12px is the gap-3 between the Projects section and the Pinned group header above it", "make this gap2"),
91
+ quote("gap-2 in the Pinned group", "make it gap 1"),
92
+ quote("mb-2 on the heading (8px) plus the tab list's 3px row padding", "change it to gap 1"),
93
+ ],
94
+ },
95
+ shortAndLong: {
96
+ name: "Short and long quotes mixed",
97
+ description: "A long quote clamps to three lines; click it to read the rest.",
98
+ comments: [
99
+ quote("The menu is hovered.", "remove this"),
100
+ quote(longQuote, "can we drop the fade and keep the thumb visible while hovering the timeline?"),
101
+ quote("gap-2 in the Pinned group", "make it gap 1"),
102
+ ],
103
+ },
104
+ quoteOnly: {
105
+ name: "Quote only",
106
+ description: "A quote sent with no comment and no composer text.",
107
+ comments: [quote("gap-2 on the Projects section")],
108
+ },
109
+ quotesOnly: {
110
+ name: "Several quotes, none commented",
111
+ description: "Bare quotes stack with the same rhythm as commented ones.",
112
+ comments: [
113
+ quote("gap-2 on the Projects section"),
114
+ quote("12px is the gap-3 between the Projects section and the Pinned group header above it"),
115
+ quote("mb-2 on the heading (8px) plus the tab list's 3px row padding"),
116
+ ],
117
+ },
118
+ bareQuoteWithText: {
119
+ name: "Quote without a comment, text in the composer",
120
+ description: "The composer text leads; the quote follows as its context.",
121
+ text: "coat with granite solution",
122
+ comments: [quote("Kitchen: oil countertops (guess: oil or sealant?)")],
123
+ },
124
+ bareQuotesWithText: {
125
+ name: "Several bare quotes, text in the composer",
126
+ description: "One instruction about several quoted passages.",
127
+ text: "make both of these gap 1, and check the same spacing on mobile",
128
+ comments: [quote("gap-2 on the Projects section"), quote("gap-2 in the Pinned group")],
129
+ },
130
+ mixed: {
131
+ name: "Commented and bare quotes, text in the composer",
132
+ description: "The composer text first, then each quote with its own comment when it has one.",
133
+ text: "and run the sidebar story at 360px after",
134
+ comments: [
135
+ quote("gap-2 on the Projects section", "drop it to gap 1"),
136
+ quote("gap-2 in the Pinned group"),
137
+ quote("12px is the gap-3 between the Projects section and the Pinned group header above it", "make this gap 2"),
138
+ ],
139
+ },
140
+ longText: {
141
+ name: "Long composer text and a long comment",
142
+ description: "Both wrap; the comment stays tied to its quote.",
143
+ text: "These are all in the sidebar, so please keep the change local to the sidebar CSS and do not touch the shared spacing tokens. After that, run the sidebar story at 360px and 1280px and attach screenshots of both to the PR.",
144
+ comments: [
145
+ quote(
146
+ "gap-2 on the Projects section",
147
+ "drop it to gap 1, but only on desktop. On mobile the rows are already taller because of the 44px touch target, so the extra gap there is what keeps the section from feeling cramped against the pinned group.",
148
+ ),
149
+ ],
150
+ },
151
+ multiline: {
152
+ name: "Multi-line quote with line breaks",
153
+ description: "A quote of code or log output keeps its line breaks and clamps by laid-out lines.",
154
+ comments: [
155
+ quote(
156
+ "$ bun typecheck\nsrc/message/comment-card.tsx:42:7 - error TS2322\nType 'string | undefined' is not assignable to type 'string'.\n\nFound 1 error in 1 file.",
157
+ "fix this one",
158
+ ),
159
+ ],
160
+ },
161
+ unbroken: {
162
+ name: "Unbroken long token",
163
+ description: "A URL or hash with no spaces must wrap instead of widening the bubble.",
164
+ comments: [
165
+ quote(
166
+ "https://github.com/anomalyco/opencode/actions/runs/19283746501/job/55128374650#step:7:1342-the-flaky-upload-test",
167
+ "is this the same failure as yesterday?",
168
+ ),
169
+ ],
170
+ },
171
+ source: {
172
+ name: "Quote from a source",
173
+ description: "A quote from outside the timeline names where it came from.",
174
+ comments: [
175
+ quote(
176
+ "error: Cannot find module '@zyro-sec/ui/tooltip' imported from packages/session-ui/src/message/comment-card.tsx",
177
+ "why does this only fail in the stories build?",
178
+ terminal,
179
+ ),
180
+ quote("$ make\nmake: *** No rule to make target 'stories'. Stop.", undefined, terminal),
181
+ ],
182
+ },
183
+ overflow: {
184
+ name: "Many quotes",
185
+ description:
186
+ "No item limit. With Collapse long messages on, the whole bubble folds past 12 lines to its first 8, with Read more.",
187
+ text: "spacing pass on the sidebar",
188
+ comments: [
189
+ quote("gap-2 on the Projects section", "drop it to gap 1"),
190
+ quote("12px is the gap-3 between the Projects section and the Pinned group header above it", "make this gap2"),
191
+ quote("gap-2 in the Pinned group"),
192
+ quote("mb-2 on the heading (8px) plus the tab list's 3px row padding", "change it to gap 1"),
193
+ quote("The menu is hovered.", "remove this"),
194
+ quote("The footer has 16px of bottom padding.", "match the header"),
195
+ quote("Section headers use 12px uppercase labels.", "sentence case"),
196
+ quote("The collapse chevron rotates 90 degrees."),
197
+ ],
198
+ },
199
+ withCards: {
200
+ name: "Quotes with file and note comments",
201
+ description:
202
+ "Quotes, file-line and page-element comments share one blockquote style, in the order they were added.",
203
+ text: "tidy the sidebar",
204
+ comments: [
205
+ quote("gap-2 on the Projects section", "drop it to gap 1"),
206
+ {
207
+ path: "packages/app/src/sidebar/projects.tsx",
208
+ comment: "this gap comes from here",
209
+ selection: { startLine: 118, endLine: 124 },
210
+ },
211
+ {
212
+ type: "note",
213
+ label: "nav.sidebar",
214
+ icon: "code",
215
+ title: "nav.sidebar",
216
+ subtitle: "Browser annotation",
217
+ comment: "and this",
218
+ },
219
+ ],
220
+ },
221
+ references: {
222
+ name: "File and note comments only",
223
+ description: "Lines of a file, a whole file, a page element with and without a comment, and a long path.",
224
+ text: "tidy the sidebar spacing",
225
+ comments: [
226
+ {
227
+ path: "packages/app/src/sidebar/projects.tsx",
228
+ comment: "this gap comes from here",
229
+ selection: { startLine: 118, endLine: 124 },
230
+ },
231
+ { path: "packages/app/src/sidebar/pinned.tsx", comment: "same here", selection: { startLine: 42, endLine: 42 } },
232
+ { path: "packages/ui/src/styles/tokens/spacing.css", comment: "don't change anything in this file" },
233
+ {
234
+ type: "note",
235
+ label: "nav.sidebar",
236
+ icon: "code",
237
+ title: "nav.sidebar",
238
+ subtitle: "Browser annotation",
239
+ comment: "and this",
240
+ },
241
+ {
242
+ type: "note",
243
+ label: "button#collapse",
244
+ icon: "code",
245
+ title: "button#collapse",
246
+ subtitle: "Browser annotation",
247
+ comment: "",
248
+ },
249
+ {
250
+ path: "packages/session-ui/src/timeline-next/tools/context-group/very-long-component-name-for-narrow-layouts.tsx",
251
+ comment: "check this at 360px",
252
+ selection: { startLine: 1200, endLine: 1288 },
253
+ },
254
+ ],
255
+ },
256
+ pending: {
257
+ name: "Pending: steering",
258
+ description: "A prompt the server has not delivered yet mutes the whole bubble, quotes included.",
259
+ text: "and run the sidebar story at 360px after",
260
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
261
+ status: "steering",
262
+ },
263
+ rtl: {
264
+ name: "Right-to-left quote and comment",
265
+ description: "The bar follows the reading direction of the message.",
266
+ text: "תבדוק גם במובייל",
267
+ comments: [
268
+ quote("המרווח בין הקטגוריות הוא 12 פיקסלים", "תקטין ל-8"),
269
+ quote("gap-2 on the Projects section", "تصغير إلى gap 1"),
270
+ ],
271
+ },
272
+ mentions: {
273
+ name: "Mentions in the text and in a comment",
274
+ description: "@agent and @file in the composer text keep their highlight; a comment's @path is attached as a file.",
275
+ text: mentionsText,
276
+ files: [
277
+ {
278
+ data: "e30=",
279
+ mime: "text/plain",
280
+ name: "projects.tsx",
281
+ source: { type: "inline" },
282
+ mention: mention(mentionsText, "@projects.tsx"),
283
+ },
284
+ ],
285
+ agents: [{ name: "review", mention: mention(mentionsText, "@review") }],
286
+ comments: [
287
+ quote("gap-2 on the Projects section", "compare with @packages/app/src/sidebar/pinned.tsx first"),
288
+ {
289
+ path: "packages/app/src/sidebar/projects.tsx",
290
+ comment: "the token is defined in @packages/ui/src/styles/tokens/spacing.css",
291
+ selection: { startLine: 118, endLine: 124 },
292
+ },
293
+ ],
294
+ },
295
+ chevron: {
296
+ name: "Quote first, under the actions chevron",
297
+ description: "Hover the bubble: with no composer text, the chevron sits over the end of the first quote line.",
298
+ comments: [
299
+ quote("gap-2 on the Projects section and the Pinned group header above it", "make both gap 1"),
300
+ quote("mb-2 on the heading"),
301
+ ],
302
+ },
303
+ attachments: {
304
+ name: "Attachments with quotes",
305
+ description: "Images and files sit above the bubble, as today.",
306
+ text: "match the screenshot",
307
+ files: [image, notes],
308
+ comments: [quote("gap-2 on the Projects section", "drop it to gap 1"), quote("gap-2 in the Pinned group")],
309
+ },
310
+ run: {
311
+ name: "Bubbles in a run",
312
+ description: "A message right after another tightens the corners where they meet; hover shows the meta line.",
313
+ text: "and these too",
314
+ run: true,
315
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
316
+ },
317
+ voice: {
318
+ name: "Voice message with a quote",
319
+ description: "The voice badge sits on the bubble's top leading corner, above the first line.",
320
+ text: "can you make this smaller",
321
+ voice: true,
322
+ comments: [quote("gap-2 on the Projects section")],
323
+ },
324
+ voiceQuoteFirst: {
325
+ name: "Voice message, quote only",
326
+ description: "With no text, the badge meets the quote's bar.",
327
+ voice: true,
328
+ comments: [quote("gap-2 on the Projects section", "smaller")],
329
+ },
330
+ sending: {
331
+ name: "Pending: sending",
332
+ description: "Not yet admitted by the server: no actions chevron.",
333
+ text: "and run the sidebar story at 360px after",
334
+ status: "sending",
335
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
336
+ },
337
+ starting: {
338
+ name: "Pending: starting",
339
+ description: "Admitted, about to run.",
340
+ text: "and run the sidebar story at 360px after",
341
+ status: "starting",
342
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
343
+ },
344
+ queued: {
345
+ name: "Pending: queued",
346
+ description: "Waiting in the queue.",
347
+ text: "and run the sidebar story at 360px after",
348
+ status: "queued",
349
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
350
+ },
351
+ stranded: {
352
+ name: "Pending: stranded",
353
+ description: "A steer the run ended before delivering.",
354
+ text: "and run the sidebar story at 360px after",
355
+ status: "stranded",
356
+ comments: [quote("gap-2 in the Pinned group", "make it gap 1")],
357
+ },
358
+ foldAndExpand: {
359
+ name: "Collapsed bubble with a cut-off quote",
360
+ description:
361
+ "Collapse long messages is on. Read more, then click the long quote: opening it grows the bubble past the fold again.",
362
+ text: "two things on the scrollbar",
363
+ fold: true,
364
+ comments: [
365
+ quote(longQuote, "drop the fade"),
366
+ quote("The thumb uses the border-strong token.", "use border-base"),
367
+ quote(longQuote, "and check touch"),
368
+ ],
369
+ },
370
+ nested: {
371
+ name: "Quote of a message that had quotes",
372
+ description: "Selecting across a quote and its comment in an earlier bubble quotes both as plain lines.",
373
+ comments: [quote("gap-2 on the Projects section\ndrop it to gap 1", "did this land?")],
374
+ },
375
+ whitespace: {
376
+ name: "Blank lines and whitespace",
377
+ description:
378
+ "Blank lines around a quote are trimmed, a whitespace-only quote shows only its comment, and a whitespace-only comment is dropped.",
379
+ comments: [
380
+ quote("\n\n gap-2 on the Projects section \n\n", "trailing lines above"),
381
+ quote(" \n ", "the quote above is only whitespace"),
382
+ quote("gap-2 in the Pinned group", " "),
383
+ ],
384
+ },
385
+ markdown: {
386
+ name: "Code and markdown in a quote",
387
+ description: "Fences, backticks and headings show as plain text.",
388
+ comments: [quote("# Spacing\n```ts\nconst gap = 8\n```\nUse `gap-2` in the **sidebar**.", "is this right?")],
389
+ },
390
+ legacyNotes: {
391
+ name: "Old-style and right-to-left notes",
392
+ description: "A note with only a label, and one with a right-to-left subtitle.",
393
+ comments: [
394
+ { type: "note", label: "Legacy element", icon: "code", comment: "fix this" },
395
+ {
396
+ type: "note",
397
+ label: "زر الحفظ",
398
+ icon: "code",
399
+ title: "button#save",
400
+ subtitle: "تعليق المتصفح",
401
+ comment: "تحقق من هذا",
402
+ },
403
+ ],
404
+ },
405
+ oddFiles: {
406
+ name: "File without an extension, and a folder",
407
+ description: "Each gets its own icon.",
408
+ comments: [
409
+ { path: "Makefile", comment: "add a stories target" },
410
+ { path: "packages/app/src/sidebar/", comment: "everything in here" },
411
+ ],
412
+ },
413
+ } satisfies Record<string, Case>
414
+
415
+ const heMentions = "תשתמש ב-@review כדי לבדוק את @projects.tsx לפני שמשנים את המרווחים"
416
+
417
+ const heLongQuote =
418
+ "לפס הגלילה יש גובה מינימלי של 32 פיקסלים, מוגבל לגובה המסילה, כך שגם בשיחות ארוכות מאוד נשארת ידית שאפשר לתפוס. שאר המקום שמור לתוכן ציר הזמן, והפס נעלם אחרי 800 מילישניות בלי גלילה. במכשירי מגע הפס מוסתר לגמרי והגלילה המקורית לוקחת פיקוד, ולכן המרווח מתכווץ לאפס."
419
+
420
+ /** English content keeps its own direction inside an RTL timeline, so the RTL stories need right-to-left content. */
421
+ const rtlCases = {
422
+ oneCommented: {
423
+ name: "RTL: one quote with a comment",
424
+ description: "Hebrew quote and comment: the bar sits on the right, at the start of the line.",
425
+ comments: [quote("המרווח בקטע הפרויקטים הוא gap-2", "תקטין ל-gap-1")],
426
+ },
427
+ severalCommented: {
428
+ name: "RTL: several short quotes, each commented",
429
+ description: "Every quote carries its own instruction.",
430
+ comments: [
431
+ quote("המרווח בקטע הפרויקטים הוא gap-2", "תקטין ל-gap-1"),
432
+ quote("יש 12 פיקסלים בין קטע הפרויקטים לכותרת הקבוצה המוצמדת שמעליו", "תעשה את זה gap-2"),
433
+ quote("gap-2 בקבוצה המוצמדת", "תעשה gap-1"),
434
+ ],
435
+ },
436
+ shortAndLong: {
437
+ name: "RTL: short and long quotes mixed",
438
+ description: "The long quote clamps to three lines; click it to read the rest.",
439
+ comments: [quote("התפריט במצב ריחוף.", "תסיר את זה"), quote(heLongQuote, "אפשר לוותר על ההיעלמות?")],
440
+ },
441
+ quotesOnly: {
442
+ name: "RTL: quotes only",
443
+ description: "No comment and no composer text.",
444
+ comments: [quote("המרווח בקטע הפרויקטים הוא gap-2"), quote("gap-2 בקבוצה המוצמדת")],
445
+ },
446
+ mixed: {
447
+ name: "RTL: commented and bare quotes, text in the composer",
448
+ description: "The composer text first, then each quote with its comment.",
449
+ text: "ואחר כך תריץ את הסטורי של סרגל הצד ב-360 פיקסלים",
450
+ comments: [
451
+ quote("המרווח בקטע הפרויקטים הוא gap-2", "תקטין ל-gap-1"),
452
+ quote("gap-2 בקבוצה המוצמדת"),
453
+ quote("יש 12 פיקסלים בין קטע הפרויקטים לכותרת שמעליו", "תעשה gap-2"),
454
+ ],
455
+ },
456
+ mixedLanguage: {
457
+ name: "RTL: English quotes in a Hebrew message",
458
+ description:
459
+ "Each quote reads in its own direction, but lines up with the bubble: bar on the right, text from the right.",
460
+ text: "תבדוק את שניהם",
461
+ comments: [
462
+ quote("gap-2 on the Projects section", "תקטין ל-gap-1"),
463
+ quote("12px is the gap-3 between the Projects section and the Pinned group header above it"),
464
+ ],
465
+ },
466
+ source: {
467
+ name: "RTL: terminal quote with a Hebrew comment",
468
+ description: "Terminal output stays left-to-right inside a right-to-left bubble.",
469
+ comments: [
470
+ quote(
471
+ "error: Cannot find module '@zyro-sec/ui/tooltip' imported from packages/session-ui/src/message/comment-card.tsx",
472
+ "למה זה נכשל רק בבנייה של הסטוריז?",
473
+ terminal,
474
+ ),
475
+ ],
476
+ },
477
+ references: {
478
+ name: "RTL: file and note comments",
479
+ description: "File names and selectors stay left-to-right; the comments read right-to-left.",
480
+ text: "תסדר את המרווחים בסרגל הצד",
481
+ comments: [
482
+ {
483
+ path: "packages/app/src/sidebar/projects.tsx",
484
+ comment: "המרווח מגיע מכאן",
485
+ selection: { startLine: 118, endLine: 124 },
486
+ },
487
+ {
488
+ type: "note",
489
+ label: "nav.sidebar",
490
+ icon: "code",
491
+ title: "nav.sidebar",
492
+ subtitle: "הערת דפדפן",
493
+ comment: "וגם זה",
494
+ },
495
+ ],
496
+ },
497
+ mentions: {
498
+ name: "RTL: mentions",
499
+ description: "@agent and @file inside Hebrew text.",
500
+ text: heMentions,
501
+ files: [
502
+ {
503
+ data: "e30=",
504
+ mime: "text/plain",
505
+ name: "projects.tsx",
506
+ source: { type: "inline" },
507
+ mention: mention(heMentions, "@projects.tsx"),
508
+ },
509
+ ],
510
+ agents: [{ name: "review", mention: mention(heMentions, "@review") }],
511
+ comments: [quote("gap-2 בקבוצה המוצמדת", "תשווה ל-@packages/app/src/sidebar/pinned.tsx")],
512
+ },
513
+ arabic: {
514
+ name: "RTL: Arabic",
515
+ description: "The same layout in Arabic.",
516
+ text: "تحقق من هذه أيضاً على الجوال",
517
+ comments: [quote("المسافة بين الأقسام هي 12 بكسل", "صغّرها إلى 8"), quote("العنوان يستخدم حروفاً كبيرة")],
518
+ },
519
+ pending: {
520
+ name: "RTL: pending steer",
521
+ description: "Muted while it waits.",
522
+ text: "ואחר כך תריץ את הסטורי",
523
+ status: "steering",
524
+ comments: [quote("gap-2 בקבוצה המוצמדת", "תעשה gap-1")],
525
+ },
526
+ fold: {
527
+ name: "RTL: collapsed bubble",
528
+ description: "Collapse long messages on: Read more sits at the start of the line.",
529
+ text: "שני דברים על פס הגלילה",
530
+ fold: true,
531
+ comments: [
532
+ quote(heLongQuote, "בלי היעלמות"),
533
+ quote("הפס משתמש בצבע border-strong.", "תעבור ל-border-base"),
534
+ quote(heLongQuote, "ותבדוק מגע"),
535
+ ],
536
+ },
537
+ } satisfies Record<string, Case>
538
+
539
+ type Args = {
540
+ width: number
541
+ /** The lab sets one scheme for every story, so a story forces its own here; "lab" follows the lab's toggle. */
542
+ scheme: "lab" | "light" | "dark"
543
+ direction: "ltr" | "rtl"
544
+ fold: boolean
545
+ touch: boolean
546
+ }
547
+
548
+ export const AllCases = {
549
+ render: (args: Args) => (
550
+ <Page args={args}>
551
+ <For each={Object.values(cases)}>{(item) => <Compare case={item} args={args} />}</For>
552
+ </Page>
553
+ ),
554
+ }
555
+
556
+ export const AllCasesLight = { ...AllCases, args: { scheme: "light" } }
557
+
558
+ export const AllCasesDark = { ...AllCases, args: { scheme: "dark" } }
559
+
560
+ export const AllCasesNarrow = { ...AllCases, args: { width: 360 } }
561
+
562
+ /** A phone: 320px and no hover, so the actions chevron always shows and keeps room on the first line. */
563
+ export const AllCasesPhone = { ...AllCases, args: { width: 320, touch: true } }
564
+
565
+ export const AllCasesRtl = {
566
+ args: { direction: "rtl" },
567
+ render: (args: Args) => (
568
+ <Page args={args}>
569
+ <For each={Object.values(rtlCases)}>{(item) => <Compare case={item} args={args} />}</For>
570
+ </Page>
571
+ ),
572
+ }
573
+
574
+ export const AllCasesCollapsed = { ...AllCases, args: { fold: true } }
575
+
576
+ const single = (item: Case) => ({
577
+ render: (args: Args) => (
578
+ <Page args={args}>
579
+ <Compare case={item} args={args} />
580
+ </Page>
581
+ ),
582
+ })
583
+
584
+ export const OneCommented = single(cases.oneCommented)
585
+
586
+ export const SeveralCommented = single(cases.severalCommented)
587
+
588
+ export const ShortAndLong = single(cases.shortAndLong)
589
+
590
+ export const QuoteOnly = single(cases.quoteOnly)
591
+
592
+ export const QuotesOnly = single(cases.quotesOnly)
593
+
594
+ export const BareQuoteWithText = single(cases.bareQuoteWithText)
595
+
596
+ export const BareQuotesWithText = single(cases.bareQuotesWithText)
597
+
598
+ export const Mixed = single(cases.mixed)
599
+
600
+ export const LongText = single(cases.longText)
601
+
602
+ export const Multiline = single(cases.multiline)
603
+
604
+ export const Unbroken = single(cases.unbroken)
605
+
606
+ export const Source = single(cases.source)
607
+
608
+ export const Overflow = { ...single(cases.overflow), args: { fold: true } }
609
+
610
+ export const WithCards = single(cases.withCards)
611
+
612
+ export const References = single(cases.references)
613
+
614
+ export const Mentions = single(cases.mentions)
615
+
616
+ export const Chevron = single(cases.chevron)
617
+
618
+ export const Attachments = single(cases.attachments)
619
+
620
+ export const Run = single(cases.run)
621
+
622
+ export const Voice = single(cases.voice)
623
+
624
+ export const VoiceQuoteFirst = single(cases.voiceQuoteFirst)
625
+
626
+ export const Steering = single(cases.pending)
627
+
628
+ export const Sending = single(cases.sending)
629
+
630
+ export const Starting = single(cases.starting)
631
+
632
+ export const Queued = single(cases.queued)
633
+
634
+ export const Stranded = single(cases.stranded)
635
+
636
+ export const FoldAndExpand = single(cases.foldAndExpand)
637
+
638
+ export const Nested = single(cases.nested)
639
+
640
+ export const Whitespace = single(cases.whitespace)
641
+
642
+ export const Markdown = single(cases.markdown)
643
+
644
+ export const LegacyNotes = single(cases.legacyNotes)
645
+
646
+ export const OddFiles = single(cases.oddFiles)
647
+
648
+ export const Rtl = { ...single(cases.rtl), args: { direction: "rtl" } }
649
+
650
+ export const Touch = { ...single(cases.chevron), args: { width: 320, touch: true } }
651
+
652
+ function Page(props: { args: Args; children: JSX.Element }) {
653
+ return (
654
+ <CurrentSessionProviders
655
+ document={{ sessionID: CURRENT_SESSION_ID, messages: [], status: { type: "idle" }, diffs: [] }}
656
+ >
657
+ <style>{STORY_CSS}</style>
658
+ <section
659
+ class="flex min-h-full w-max min-w-full flex-col gap-10 p-6"
660
+ data-story-page
661
+ data-story-touch={props.args.touch ? "" : undefined}
662
+ data-color-scheme={props.args.scheme === "lab" ? undefined : props.args.scheme}
663
+ >
664
+ {props.children}
665
+ </section>
666
+ </CurrentSessionProviders>
667
+ )
668
+ }
669
+
670
+ function Compare(props: { case: Case; args: Args }) {
671
+ const fold = () => props.case.fold ?? props.args.fold
672
+
673
+ return (
674
+ <article class="flex flex-col gap-3">
675
+ <header class="flex flex-col gap-0.5">
676
+ <h2 class="text-[14px] leading-5 [font-weight:530]">{props.case.name}</h2>
677
+ <p class="text-[13px] leading-5" data-story-muted>
678
+ {props.case.description}
679
+ </p>
680
+ </header>
681
+ <div class="flex items-start gap-6">
682
+ <For each={[false, true]}>
683
+ {(inline) => (
684
+ <Column label={inline ? "Inline" : "Cards"} width={props.args.width} direction={props.args.direction}>
685
+ {/* The timeline puts 4px between the bubbles of a run. */}
686
+ <div class="flex flex-col gap-1">
687
+ <Show when={props.case.run}>
688
+ <CurrentUserMessageDisplay
689
+ sessionID={CURRENT_SESSION_ID}
690
+ message={{
691
+ id: "msg_quotes_run_start",
692
+ type: "user",
693
+ text: "",
694
+ time: { created: STORY_TIME },
695
+ files: [],
696
+ }}
697
+ text="tidy the sidebar spacing"
698
+ agent="build"
699
+ model={STORY_MODEL}
700
+ run={{ above: false, below: true }}
701
+ />
702
+ </Show>
703
+ <Message case={props.case} fold={fold()} inline={inline} />
704
+ </div>
705
+ </Column>
706
+ )}
707
+ </For>
708
+ </div>
709
+ </article>
710
+ )
711
+ }
712
+
713
+ // Only the timeline area takes the direction; the story's headings and column order stay put for comparison.
714
+ function Column(props: { label: string; width: number; direction: Args["direction"]; children: JSX.Element }) {
715
+ return (
716
+ <div class="flex shrink-0 flex-col gap-2" style={{ width: `${props.width}px` }}>
717
+ <span class="text-[12px] leading-4 [font-weight:530]" data-story-faint>
718
+ {props.label}
719
+ </span>
720
+ <div class="rounded-[8px] px-4 py-4" data-story-surface dir={props.direction}>
721
+ {props.children}
722
+ </div>
723
+ </div>
724
+ )
725
+ }
726
+
727
+ function Message(props: { case: Case; fold: boolean; inline: boolean }) {
728
+ const status = props.case.status
729
+
730
+ return (
731
+ <CurrentUserMessageDisplay
732
+ sessionID={CURRENT_SESSION_ID}
733
+ message={message(props.case)}
734
+ text={props.case.text ?? ""}
735
+ agent="build"
736
+ model={STORY_MODEL}
737
+ comments={props.case.comments}
738
+ fold={props.fold}
739
+ inlineQuotes={props.inline}
740
+ voice={props.case.voice}
741
+ run={props.case.run ? { above: true, below: false } : undefined}
742
+ actions={{
743
+ revert: () => {},
744
+ fork: () => {},
745
+ pending: status ? { status: () => status, queue: async () => {}, remove: async () => {} } : undefined,
746
+ }}
747
+ />
748
+ )
749
+ }
750
+
751
+ function message(item: Case): SessionMessageUser {
752
+ return {
753
+ id: `msg_quotes_${item.name.toLowerCase().replaceAll(/\W+/g, "_")}`,
754
+ type: "user",
755
+ text: item.text ?? "",
756
+ time: { created: STORY_TIME },
757
+ files: item.files ?? [],
758
+ agents: item.agents,
759
+ }
760
+ }
761
+
762
+ const STORY_CSS = `
763
+ /* Tailwind's color utilities resolve the theme at the root, so a forced scheme on the story would miss them. The
764
+ story's own chrome reads the theme variables directly instead. */
765
+ [data-story-page] {
766
+ background: var(--v2-background-bg-layer-01);
767
+ color: var(--v2-text-text-base);
768
+ }
769
+
770
+ [data-story-muted] {
771
+ color: var(--v2-text-text-muted);
772
+ }
773
+
774
+ [data-story-faint] {
775
+ color: var(--v2-text-text-faint);
776
+ }
777
+
778
+ [data-story-surface] {
779
+ background: var(--v2-background-bg-base);
780
+ box-shadow: inset 0 0 0 0.5px var(--v2-border-border-base);
781
+ }
782
+
783
+ /* Hover-less screens, which the lab can't emulate: the chevron always shows and keeps room on the first line. */
784
+ [data-story-touch] [data-component="user-message"] [data-slot="user-message-text"] > [data-slot="user-message-menu"] {
785
+ opacity: 1;
786
+ pointer-events: auto;
787
+ padding: 0;
788
+ background: none;
789
+ }
790
+
791
+ [data-story-touch] [data-component="user-message"] [data-slot="user-message-text"]:has(> [data-slot="user-message-menu"])::before {
792
+ content: "";
793
+ float: inline-end;
794
+ width: 20px;
795
+ height: 1lh;
796
+ }
797
+ `