@dexhq/canvas 0.13.0 → 0.15.0

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 (341) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +21 -18
  3. package/app/canvas/activity.tsx +8 -15
  4. package/app/canvas/anchoring.ts +3 -5
  5. package/app/canvas/canvas-input.ts +151 -14
  6. package/app/canvas/canvas-keys.ts +9 -0
  7. package/app/canvas/canvas-model.ts +5 -42
  8. package/app/canvas/canvas-panels.ts +1 -17
  9. package/app/canvas/canvas-scene.ts +7 -3
  10. package/app/canvas/canvas-ui.ts +2 -1
  11. package/app/canvas/canvas.css +61 -26
  12. package/app/canvas/change-notice.tsx +10 -1
  13. package/app/canvas/comment-layer.tsx +2 -1
  14. package/app/canvas/comments.tsx +204 -82
  15. package/app/canvas/element-picker.ts +200 -27
  16. package/app/canvas/engine/canvas-gestures.ts +72 -17
  17. package/app/canvas/engine/canvas-store.ts +17 -1
  18. package/app/canvas/engine/engine.css +6 -3
  19. package/app/canvas/find-bar.tsx +817 -0
  20. package/app/canvas/find-model.ts +135 -0
  21. package/app/canvas/flow-canvas.tsx +18 -2
  22. package/app/canvas/follow-pin.ts +26 -6
  23. package/app/canvas/frame-node.tsx +43 -26
  24. package/app/canvas/imported-reviews.tsx +12 -22
  25. package/app/canvas/layout.ts +27 -0
  26. package/app/canvas/live-page.ts +142 -19
  27. package/app/canvas/page-find.ts +220 -0
  28. package/app/canvas/page-style.ts +23 -0
  29. package/app/canvas/section-node.tsx +2 -0
  30. package/app/canvas/spec-threads.ts +24 -23
  31. package/app/canvas/thread-focus.tsx +14 -12
  32. package/app/canvas/tool-cursors.ts +16 -16
  33. package/app/canvas/use-activity.ts +0 -8
  34. package/app/canvas/use-agent-changes.tsx +34 -40
  35. package/app/canvas/use-canvas-clipboard.tsx +11 -14
  36. package/app/canvas/xray.ts +3 -12
  37. package/app/frame.tsx +5 -0
  38. package/app/i18n/locales/en/messages.po +114 -12
  39. package/app/i18n/locales/en/messages.ts +1 -1
  40. package/app/i18n/locales/pseudo/messages.po +114 -12
  41. package/app/i18n/locales/pseudo/messages.ts +1 -1
  42. package/app/icons/{sets/lucide.tsx → glyphs.tsx} +7 -5
  43. package/app/icons/index.tsx +3 -3
  44. package/app/icons/types.ts +3 -10
  45. package/app/index.html +3 -3
  46. package/app/main.tsx +3 -0
  47. package/app/pages/canvas-settings.tsx +35 -0
  48. package/app/pages/canvas.tsx +27 -8
  49. package/app/pages/commands-settings.tsx +16 -2
  50. package/app/shell/about.tsx +5 -4
  51. package/app/shell/feedback-details.ts +0 -3
  52. package/app/shell/feedback-form.tsx +10 -21
  53. package/app/shell/feedback-link.tsx +2 -1
  54. package/app/shell/instructions-editor.tsx +1 -1
  55. package/app/shell/presence-style.ts +59 -0
  56. package/app/shell/presence.tsx +6 -3
  57. package/app/shell/scaled-frame.tsx +21 -9
  58. package/app/shell/settings-sections.ts +12 -0
  59. package/app/shell/sidebar.tsx +1 -1
  60. package/app/studio-ui.d.ts +0 -9
  61. package/app/types.ts +21 -205
  62. package/app/ui/file-drop.ts +128 -0
  63. package/app/ui/prompt-editor.tsx +1 -1
  64. package/app/ui/shadcn/input-group.tsx +2 -2
  65. package/dist/cli/banner.d.mts +4 -2
  66. package/dist/cli/banner.mjs +34 -11
  67. package/dist/cli/commands/app.mjs +19 -11
  68. package/dist/cli/commands/create.d.mts +26 -14
  69. package/dist/cli/commands/create.mjs +13 -7
  70. package/dist/cli/commands/dev.mjs +2 -3
  71. package/dist/cli/commands/hook.mjs +2 -1
  72. package/dist/cli/commands/init.d.mts +11 -6
  73. package/dist/cli/help.d.mts +1 -1
  74. package/dist/cli/help.mjs +3 -3
  75. package/dist/cli/main.d.mts +22 -12
  76. package/dist/config/index.d.mts +6 -5
  77. package/dist/config/project-files.d.mts +6 -3
  78. package/dist/config/project-files.mjs +14 -5
  79. package/dist/config/renamed.d.mts +0 -2
  80. package/dist/config/renamed.mjs +1 -3
  81. package/dist/config/schema.d.mts +0 -5
  82. package/dist/config/schema.mjs +0 -5
  83. package/dist/content/capture.d.mts +2 -2
  84. package/dist/content/capture.mjs +2 -2
  85. package/dist/content/content.d.mts +3 -141
  86. package/dist/content/content.mjs +7 -65
  87. package/dist/content/flow-specs.mjs +1 -1
  88. package/dist/content/prototype-summary.d.mts +3 -39
  89. package/dist/content/prototype-summary.mjs +2 -3
  90. package/dist/content/prototypes.mjs +1 -1
  91. package/dist/content/snapshot-client.mjs +1 -1
  92. package/dist/content/text-replace.d.mts +30 -0
  93. package/dist/content/text-replace.mjs +309 -0
  94. package/dist/content/thread-module.mjs +1 -1
  95. package/dist/content/threads.mjs +1 -1
  96. package/dist/paths.d.mts +0 -2
  97. package/dist/paths.mjs +1 -3
  98. package/dist/server/agent-env.d.mts +5 -1
  99. package/dist/server/agent-env.mjs +7 -2
  100. package/dist/server/agent-session.d.mts +14 -1
  101. package/dist/server/agent-session.mjs +84 -19
  102. package/dist/server/brief.mjs +3 -3
  103. package/dist/server/build-pictures.mjs +1 -1
  104. package/dist/server/channel.d.mts +19 -24
  105. package/dist/server/channel.mjs +70 -37
  106. package/dist/server/claimed-presence.d.mts +18 -0
  107. package/dist/server/claimed-presence.mjs +58 -0
  108. package/dist/server/close-check.mjs +2 -2
  109. package/dist/server/comments/actions.d.mts +153 -0
  110. package/dist/server/comments/actions.mjs +154 -0
  111. package/dist/server/comments/routes.d.mts +25 -0
  112. package/dist/server/comments/routes.mjs +88 -0
  113. package/dist/server/comments/tools.d.mts +6 -0
  114. package/dist/server/comments/tools.mjs +154 -0
  115. package/dist/server/dev-server.mjs +36 -13
  116. package/dist/server/file-errors.d.mts +7 -2
  117. package/dist/server/file-errors.mjs +31 -8
  118. package/dist/server/file-lock.d.mts +2 -2
  119. package/dist/server/file-lock.mjs +130 -36
  120. package/dist/server/mcp.d.mts +0 -2
  121. package/dist/server/mcp.mjs +7 -8
  122. package/dist/server/me.d.mts +1 -1
  123. package/dist/server/open-page.d.mts +22 -0
  124. package/dist/server/open-page.mjs +20 -2
  125. package/dist/server/outcome.d.mts +22 -0
  126. package/dist/server/outcome.mjs +8 -0
  127. package/dist/server/own-copies.mjs +2 -2
  128. package/dist/server/people.d.mts +1 -1
  129. package/dist/server/port.d.mts +12 -0
  130. package/dist/server/port.mjs +66 -14
  131. package/dist/server/presence.d.mts +4 -1
  132. package/dist/server/presence.mjs +2 -2
  133. package/dist/server/requests.d.mts +5 -1
  134. package/dist/server/requests.mjs +32 -47
  135. package/dist/server/studio-for.d.mts +5 -0
  136. package/dist/server/studio-for.mjs +18 -4
  137. package/dist/server/sync-install.d.mts +8 -12
  138. package/dist/server/sync-install.mjs +12 -30
  139. package/dist/server/thread-source.mjs +2 -2
  140. package/dist/server/tools/describe.d.mts +1 -1
  141. package/dist/server/tools/describe.mjs +1 -1
  142. package/dist/server/tools/feedback.d.mts +1 -1
  143. package/dist/server/tools/reading.mjs +13 -4
  144. package/dist/server/tools/show.d.mts +1 -1
  145. package/dist/server/tools/snapshot.d.mts +1 -1
  146. package/dist/server/tools/thread-list.mjs +1 -1
  147. package/dist/server/tools/watch.mjs +5 -3
  148. package/dist/server/vite.mjs +28 -31
  149. package/dist/server/web-app.mjs +7 -10
  150. package/dist/server/work-groups.mjs +1 -1
  151. package/dist/setup/apply.mjs +8 -14
  152. package/dist/setup/create.d.mts +4 -2
  153. package/dist/setup/create.mjs +118 -36
  154. package/dist/setup/design-system-checks.mjs +3 -12
  155. package/dist/setup/desktop-app-script.mjs +4 -3
  156. package/dist/setup/desktop-app-start.d.mts +8 -2
  157. package/dist/setup/desktop-app-start.mjs +64 -29
  158. package/dist/setup/desktop-app.d.mts +8 -0
  159. package/dist/setup/desktop-app.mjs +20 -4
  160. package/dist/setup/detect.d.mts +14 -7
  161. package/dist/setup/detect.mjs +56 -10
  162. package/dist/setup/doctor.mjs +2 -4
  163. package/dist/setup/existing-setup.d.mts +1 -3
  164. package/dist/setup/existing-setup.mjs +10 -11
  165. package/dist/setup/migrate/row-titles.mjs +1 -1
  166. package/dist/setup/own-app.d.mts +1 -2
  167. package/dist/setup/own-app.mjs +4 -5
  168. package/dist/setup/plan.d.mts +8 -6
  169. package/dist/setup/plan.mjs +64 -48
  170. package/dist/setup/project.d.mts +6 -17
  171. package/dist/setup/project.mjs +17 -61
  172. package/dist/setup/prompts.d.mts +5 -5
  173. package/dist/setup/prompts.mjs +28 -61
  174. package/dist/setup/questions.d.mts +12 -4
  175. package/dist/setup/questions.mjs +10 -25
  176. package/dist/setup/starters.d.mts +2 -0
  177. package/dist/setup/starters.mjs +26 -9
  178. package/dist/setup/workspace-setup.d.mts +1 -2
  179. package/dist/setup/workspace-setup.mjs +4 -6
  180. package/dist/setup/write.d.mts +15 -5
  181. package/dist/setup/write.mjs +35 -9
  182. package/dist/shared/annotations-core.mjs +1 -1
  183. package/dist/shared/canvas-core.mjs +1 -1
  184. package/dist/shared/canvas-file.d.mts +201 -0
  185. package/dist/shared/canvas-file.mjs +1 -0
  186. package/dist/shared/comments/routes.d.mts +53 -0
  187. package/dist/shared/comments/routes.mjs +37 -0
  188. package/dist/shared/feedback.d.mts +8 -0
  189. package/dist/shared/feedback.mjs +10 -2
  190. package/dist/shared/page-review.d.mts +2 -11
  191. package/dist/shared/page-review.mjs +4 -13
  192. package/dist/shared/presence-core.d.mts +11 -0
  193. package/dist/shared/presence-core.mjs +11 -2
  194. package/dist/shared/review-file.d.mts +5 -0
  195. package/dist/shared/review-file.mjs +23 -13
  196. package/dist/shared/server-page.mjs +7 -1
  197. package/dist/shared/signup.d.mts +2 -5
  198. package/dist/shared/signup.mjs +2 -35
  199. package/dist/shared/studio-events.d.mts +0 -6
  200. package/dist/shared/studio-events.mjs +1 -5
  201. package/dist/shared/studio-files.d.mts +12 -0
  202. package/dist/shared/studio-files.mjs +6 -1
  203. package/dist/shared/studio-routes.d.mts +16 -62
  204. package/dist/shared/studio-routes.mjs +1 -69
  205. package/dist/shared/threads-core.d.mts +2 -2
  206. package/dist/shared/threads-core.mjs +1 -1
  207. package/extension/dist/feedback.js +148 -138
  208. package/extension/dist/manifest.json +1 -1
  209. package/extension/dist/picker.js +146 -136
  210. package/package.json +3 -20
  211. package/src/cli/banner.ts +45 -11
  212. package/src/cli/commands/app.ts +23 -8
  213. package/src/cli/commands/create.ts +17 -9
  214. package/src/cli/commands/dev.ts +0 -3
  215. package/src/cli/commands/hook.ts +4 -1
  216. package/src/cli/help.ts +3 -3
  217. package/src/config/index.ts +6 -5
  218. package/src/config/project-files.ts +21 -11
  219. package/src/config/renamed.ts +0 -3
  220. package/src/config/schema.ts +0 -1
  221. package/src/content/capture.ts +6 -12
  222. package/src/content/content.ts +7 -244
  223. package/src/content/flow-specs.ts +2 -1
  224. package/src/content/prototype-summary.ts +4 -44
  225. package/src/content/review-pages.ts +2 -1
  226. package/src/content/snapshot-client.ts +1 -1
  227. package/src/content/text-replace.ts +449 -0
  228. package/src/paths.ts +0 -8
  229. package/src/server/agent-env.ts +12 -2
  230. package/src/server/agent-session.ts +124 -34
  231. package/src/server/brief.ts +8 -3
  232. package/src/server/channel.ts +121 -52
  233. package/src/server/claimed-presence.ts +93 -0
  234. package/src/server/comments/actions.ts +352 -0
  235. package/src/server/comments/routes.ts +176 -0
  236. package/src/server/comments/tools.ts +317 -0
  237. package/src/server/dev-server.ts +49 -15
  238. package/src/server/file-errors.ts +47 -13
  239. package/src/server/file-lock.ts +205 -54
  240. package/src/server/mcp.ts +13 -14
  241. package/src/server/me.ts +2 -5
  242. package/src/server/open-page.ts +54 -4
  243. package/src/server/outcome.ts +26 -0
  244. package/src/server/people.ts +2 -1
  245. package/src/server/port.ts +94 -20
  246. package/src/server/presence.ts +11 -3
  247. package/src/server/requests.ts +60 -70
  248. package/src/server/studio-for.ts +27 -3
  249. package/src/server/sync-install.ts +35 -26
  250. package/src/server/thread-place.ts +2 -4
  251. package/src/server/tools/reading.ts +16 -3
  252. package/src/server/tools/watch.ts +7 -7
  253. package/src/server/vite.ts +37 -40
  254. package/src/server/web-app.ts +14 -12
  255. package/src/setup/apply.ts +10 -16
  256. package/src/setup/create.ts +143 -37
  257. package/src/setup/design-system-checks.ts +7 -15
  258. package/src/setup/desktop-app-script.ts +4 -3
  259. package/src/setup/desktop-app-start.ts +94 -26
  260. package/src/setup/desktop-app.ts +24 -3
  261. package/src/setup/detect.ts +56 -14
  262. package/src/setup/doctor.ts +4 -4
  263. package/src/setup/existing-setup.ts +10 -12
  264. package/src/setup/own-app.ts +2 -5
  265. package/src/setup/plan.ts +93 -84
  266. package/src/setup/project.ts +25 -118
  267. package/src/setup/prompts.ts +44 -127
  268. package/src/setup/questions.ts +27 -29
  269. package/src/setup/starters.ts +35 -10
  270. package/src/setup/workspace-setup.ts +8 -18
  271. package/src/setup/write.ts +52 -9
  272. package/src/shared/canvas-file.ts +205 -0
  273. package/src/shared/comments/routes.ts +79 -0
  274. package/src/shared/feedback.ts +14 -4
  275. package/src/shared/page-review.ts +11 -16
  276. package/src/shared/presence-core.ts +16 -2
  277. package/src/shared/review-file.ts +28 -12
  278. package/src/shared/server-page.ts +11 -1
  279. package/src/shared/signup.ts +4 -28
  280. package/src/shared/studio-events.ts +0 -13
  281. package/src/shared/studio-files.ts +14 -0
  282. package/src/shared/studio-routes.ts +21 -64
  283. package/src/shared/threads-core.ts +2 -2
  284. package/templates/methods/review.md +2 -2
  285. package/templates/rules/canvas-frames.md +104 -0
  286. package/templates/rules/canvas.md +8 -142
  287. package/templates/rules/prototypes.md +1 -1
  288. package/templates/rules/snapshots.md +52 -0
  289. package/templates/starters/standalone/README.md +7 -7
  290. package/templates/starters/standalone/components.json +1 -1
  291. package/templates/starters/standalone/package.json +1 -2
  292. package/templates/starters/turborepo/README.md +6 -6
  293. package/templates/starters/turborepo/apps/web/components.json +1 -1
  294. package/templates/starters/turborepo/apps/web/package.json +1 -2
  295. package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
  296. package/templates/starters/turborepo/packages/ui/components.json +1 -1
  297. package/templates/starters/turborepo/packages/ui/package.json +1 -2
  298. package/templates/starters/vite/README.md +7 -6
  299. package/templates/starters/vite/components.json +1 -1
  300. package/templates/starters/vite/package.json +1 -2
  301. package/templates/starters/vite/src/app.tsx +3 -4
  302. package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
  303. package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
  304. package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
  305. package/templates/starters/vite/src/components/ui/button.tsx +17 -12
  306. package/templates/starters/vite/src/components/ui/card.tsx +1 -1
  307. package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
  308. package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
  309. package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
  310. package/templates/starters/vite/src/components/ui/field.tsx +3 -1
  311. package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
  312. package/templates/starters/vite/src/components/ui/input.tsx +1 -1
  313. package/templates/starters/vite/src/components/ui/label.tsx +2 -0
  314. package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
  315. package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
  316. package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
  317. package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
  318. package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
  319. package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
  320. package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
  321. package/templates/starters/vite/src/index.css +533 -111
  322. package/app/icons/sets/hugeicons.tsx +0 -259
  323. package/app/icons/sets/phosphor.tsx +0 -251
  324. package/dist/server/icon-set.d.mts +0 -15
  325. package/dist/server/icon-set.mjs +0 -31
  326. package/dist/server/tools/close-reply.d.mts +0 -6
  327. package/dist/server/tools/close-reply.mjs +0 -138
  328. package/dist/server/tools/comment.d.mts +0 -6
  329. package/dist/server/tools/comment.mjs +0 -49
  330. package/dist/shared/icon-sets.d.mts +0 -9
  331. package/dist/shared/icon-sets.mjs +0 -21
  332. package/src/server/icon-set.ts +0 -56
  333. package/src/server/tools/close-reply.ts +0 -271
  334. package/src/server/tools/comment.ts +0 -96
  335. package/src/shared/icon-sets.ts +0 -23
  336. /package/app/public/{sudio-192.png → dex-192.png} +0 -0
  337. /package/app/public/{sudio-512.png → dex-512.png} +0 -0
  338. /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
  339. /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
  340. /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
  341. /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
@@ -1,19 +1,12 @@
1
1
  import type { ComponentType, SVGAttributes } from "react";
2
- import type { glyphs } from "./sets/lucide";
2
+ import type { glyphs } from "./glyphs";
3
3
 
4
- /**
5
- * Every icon the studio's interface draws, by lucide's name. The config's
6
- * `ui.icons` picks the set that draws them, and only that set is bundled
7
- * (see node/vite.mjs).
8
- */
4
+ /** Every icon the studio's interface draws, by Lucide's name. */
9
5
  export type IconName = keyof typeof glyphs;
10
6
 
11
- /** What every glyph takes, whichever set draws it. */
7
+ /** What every glyph takes. */
12
8
  export type GlyphProps = Omit<SVGAttributes<SVGSVGElement>, "name"> & {
13
9
  size?: number;
14
10
  };
15
11
 
16
12
  export type Glyph = ComponentType<GlyphProps>;
17
-
18
- /** A set: a glyph for every name in the vocabulary. */
19
- export type IconGlyphs = Record<IconName, Glyph>;
package/app/index.html CHANGED
@@ -16,9 +16,9 @@
16
16
  media="(prefers-color-scheme: dark)"
17
17
  >
18
18
  <!-- A browser that reads SVG prefers it to a PNG of a fixed size. -->
19
- <link rel="icon" href="/favicon-32.png" sizes="32x32" type="image/png">
20
- <link rel="icon" href="/favicon.svg" type="image/svg+xml">
21
- <link rel="apple-touch-icon" href="/apple-touch-icon.png">
19
+ <link rel="icon" href="/dex-icon-32.png" sizes="32x32" type="image/png">
20
+ <link rel="icon" href="/dex-icon.svg" type="image/svg+xml">
21
+ <link rel="apple-touch-icon" href="/dex-apple-touch-icon.png">
22
22
  <title>Dex</title>
23
23
  <script>
24
24
  "use strict";
package/app/main.tsx CHANGED
@@ -12,6 +12,7 @@ import { StudioI18n } from "./i18n/provider";
12
12
  import { carryOverStorage } from "./renamed-storage";
13
13
  // Chrome offers Install once, as the page loads: kept for Settings.
14
14
  import "./shell/install-prompt";
15
+ import { refuseStrayFileDrops } from "./ui/file-drop";
15
16
  import { StudioThemeProvider } from "./ui/theme-provider";
16
17
 
17
18
  // A view's address from before views had a page of their own goes there.
@@ -23,6 +24,8 @@ const view = viewAt(
23
24
  const frameAddress = view && framePage(view.slug, view.view, view.search);
24
25
  // What the browser kept under Sudio's keys, under Dex's from now on.
25
26
  carryOverStorage();
27
+ // A file dropped where nothing takes it is never opened in place of Dex.
28
+ refuseStrayFileDrops(window);
26
29
  const root = document.getElementById("root");
27
30
  if (!root) {
28
31
  throw new Error("Dex needs a #root element in index.html.");
@@ -0,0 +1,35 @@
1
+ import { useLingui } from "@lingui/react/macro";
2
+ import {
3
+ type PresenceStyle,
4
+ setPresenceStyle,
5
+ usePresenceStyle,
6
+ } from "../shell/presence-style";
7
+ import { SettingRow, SettingsCard } from "../shell/settings-ui";
8
+ import { Segmented } from "../ui/segmented";
9
+
10
+ // Settings → Canvas: how the canvas looks to you, in this browser.
11
+
12
+ export const CanvasSettings = () => {
13
+ const { t } = useLingui();
14
+ const style = usePresenceStyle();
15
+ const styles: { id: PresenceStyle; label: string }[] = [
16
+ { id: "blocks", label: t`Blocks` },
17
+ { id: "edge", label: t`Edge only` },
18
+ { id: "off", label: t`Off` },
19
+ ];
20
+ return (
21
+ <SettingsCard>
22
+ <SettingRow
23
+ hint={t`How a frame an agent is changing shows it: drawn in blocks while it works, an edge round the frame, or nothing.`}
24
+ label={t`Agents at work`}
25
+ >
26
+ <Segmented
27
+ label={t`Agents at work`}
28
+ onChange={setPresenceStyle}
29
+ segments={styles}
30
+ value={style}
31
+ />
32
+ </SettingRow>
33
+ </SettingsCard>
34
+ );
35
+ };
@@ -59,8 +59,10 @@ import { ActionNotice, TopNotices } from "../canvas/change-notice";
59
59
  import {
60
60
  CommentsPanel,
61
61
  FloatingCommentCard,
62
+ showWhileHidden,
62
63
  useHideCommentsWhile,
63
64
  useIsTeamComment,
65
+ useOpenedWhileHidden,
64
66
  } from "../canvas/comments";
65
67
  import { DrawLayer } from "../canvas/draw-layer";
66
68
  import type { DrawKind } from "../canvas/draw-model";
@@ -68,6 +70,7 @@ import {
68
70
  CanvasViewProvider,
69
71
  useCanvasView,
70
72
  } from "../canvas/engine/canvas-view";
73
+ import { FindBar } from "../canvas/find-bar";
71
74
  import { FlowCanvas } from "../canvas/flow-canvas";
72
75
  import { askName } from "../canvas/flow-naming";
73
76
  import { CommentsOrReviewsBody } from "../canvas/imported-reviews";
@@ -184,6 +187,8 @@ const savedCanvas = (editor: CanvasEditor) =>
184
187
  const CanvasFloatingComment = ({ threads }: { threads: ThreadsApi }) => {
185
188
  const ui = useCanvasUiStore();
186
189
  const floating = useCanvasUi((state) => state.floating);
190
+ const specThread = useCanvasUi((state) => state.specThread);
191
+ useOpenedWhileHidden(floating, specThread);
187
192
  return (
188
193
  <FloatingCommentCard
189
194
  floating={floating}
@@ -285,23 +290,22 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
285
290
  const seeChange = useRef<(thread: Thread) => void>(() => undefined);
286
291
  // The heads-up opens comments with one function for good, so the
287
292
  // canvas rendering never renders it again.
288
- const openThreadNow = useRef<(id: string, at: ScreenPoint) => void>(
289
- () => undefined
290
- );
293
+ const openThreadNow = useRef<(id: string) => void>(() => undefined);
291
294
  const openFromBar = useCallback(
292
- (id: string, at: ScreenPoint) => openThreadNow.current(id, at),
295
+ (id: string) => openThreadNow.current(id),
293
296
  []
294
297
  );
295
298
  // A spec's thread opens beside its spec, where its words are: on the
296
299
  // canvas when the spec is placed there, else with the spec full screen.
297
300
  // A document's, and any other, as a floating card.
298
301
  const openAnyThread = useCallback(
299
- (id: string, at: ScreenPoint) => {
302
+ (id: string, at?: ScreenPoint) => {
300
303
  const thread = threads.threads.find((entry) => entry.id === id);
301
304
  // Reading a completed comment counts its change as seen.
302
305
  if (thread) {
303
306
  seeChange.current(thread);
304
307
  }
308
+ showWhileHidden(id);
305
309
  const spec =
306
310
  thread?.target.kind === "spec" ? thread.target.spec : undefined;
307
311
  if (spec === undefined || spec.startsWith("docs/")) {
@@ -315,9 +319,6 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
315
319
  },
316
320
  [threads.threads, ui, openThread, editor.canvas, fullScreenSpec]
317
321
  );
318
- useLayoutEffect(() => {
319
- openThreadNow.current = openAnyThread;
320
- }, [openAnyThread]);
321
322
  const focusThread = useThreadFocus(
322
323
  threads.threads,
323
324
  editor.canvas,
@@ -432,6 +433,23 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
432
433
  threads: threads.threads,
433
434
  });
434
435
  seeChange.current = agentChanges.see;
436
+ // From the heads-up, the canvas moves to the comment, and its card opens
437
+ // at its pin. One an agent completed outlines where its change landed,
438
+ // and goes there when the comment has no pin (a request for a view, or a
439
+ // comment on the whole file).
440
+ const { outline } = agentChanges;
441
+ useLayoutEffect(() => {
442
+ openThreadNow.current = (id) => {
443
+ const thread = threads.threads.find((entry) => entry.id === id);
444
+ if (!thread) {
445
+ return;
446
+ }
447
+ const atPin = focusThread(thread);
448
+ if (thread.status === "resolved") {
449
+ outline([thread], { move: !atPin });
450
+ }
451
+ };
452
+ }, [threads.threads, focusThread, outline]);
435
453
  const { toggle: togglePanel } = panels;
436
454
  const toggleStickers = useCallback(
437
455
  () => togglePanel("stickers"),
@@ -696,6 +714,7 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
696
714
  GUEST_REVIEW && !focused && panels.right === "comments"
697
715
  }
698
716
  />
717
+ <FindBar writable={studio.local} />
699
718
  <ServerNotice />
700
719
  <TopNotices>
701
720
  <ActionNotice notice={inspect.notice} />
@@ -16,7 +16,13 @@ import {
16
16
  import { Switch } from "@studio/ui/shadcn/switch";
17
17
  import { Textarea } from "@studio/ui/shadcn/textarea";
18
18
  import { cn } from "cn";
19
- import { Fragment, type ReactNode, useId, useState } from "react";
19
+ import {
20
+ type DragEvent,
21
+ Fragment,
22
+ type ReactNode,
23
+ useId,
24
+ useState,
25
+ } from "react";
20
26
  import {
21
27
  type Command,
22
28
  type CommandSwitch,
@@ -254,6 +260,13 @@ const QuickBarPicker = ({
254
260
  }) => {
255
261
  const { t } = useLingui();
256
262
  const [dragging, setDragging] = useState<string>();
263
+ // Only a skill being moved, on dragenter as on dragover (file-drop.ts says
264
+ // why): a file dragged over the quick bar is not one of its skills.
265
+ const takeMove = (event: DragEvent) => {
266
+ if (dragging) {
267
+ event.preventDefault();
268
+ }
269
+ };
257
270
  const choose = useStudioAction(
258
271
  (quick: string[]) =>
259
272
  studioRequest("commands", { method: "PUT", body: { quick } }),
@@ -307,7 +320,8 @@ const QuickBarPicker = ({
307
320
  draggable
308
321
  key={name}
309
322
  onDragEnd={() => setDragging(undefined)}
310
- onDragOver={(event) => event.preventDefault()}
323
+ onDragEnter={takeMove}
324
+ onDragOver={takeMove}
311
325
  onDragStart={() => setDragging(name)}
312
326
  onDrop={() => {
313
327
  if (dragging && dragging !== name) {
@@ -8,7 +8,7 @@ import {
8
8
  DialogTitle,
9
9
  } from "@studio/ui/shadcn/dialog";
10
10
  import { useEffect, useState } from "react";
11
- import { homepage, license, version } from "../../package.json";
11
+ import { license, name, version } from "../../package.json";
12
12
  import { PRODUCT } from "../../src/shared/product.ts";
13
13
  import { versionsLine } from "../../src/shared/update-core.ts";
14
14
  import { CAN_WRITE } from "../live/studio-api";
@@ -25,7 +25,8 @@ import { useCopied } from "./use-copied";
25
25
  // Dexes" (server/roster.ts). Reporting one is Feedback's, at the foot of
26
26
  // the sidebar, so it isn't here too.
27
27
 
28
- const SOURCE_URL = homepage.replace("#readme", "");
28
+ // Dex's page on npm, where its source is too (the Code tab).
29
+ const PACKAGE_URL = `https://www.npmjs.com/package/${name}`;
29
30
 
30
31
  export const AboutDialog = ({
31
32
  onOpenChange,
@@ -103,11 +104,11 @@ export const AboutDialog = ({
103
104
  <div className="flex items-center justify-between gap-2">
104
105
  <a
105
106
  className="studio-small text-muted-foreground hover:text-foreground hover:underline"
106
- href={SOURCE_URL}
107
+ href={PACKAGE_URL}
107
108
  rel="noopener"
108
109
  target="_blank"
109
110
  >
110
- <Trans>Source on GitHub</Trans>
111
+ <Trans>{PRODUCT} on npm</Trans>
111
112
  </a>
112
113
  <Button
113
114
  onClick={() => copy(details)}
@@ -24,7 +24,6 @@ export interface FeedbackContext {
24
24
  environment: IssueEnvironment;
25
25
  /** Unreleased features turned on (only in a copy being worked on). */
26
26
  features: string[];
27
- icons: string | undefined;
28
27
  locale: string | undefined;
29
28
  workspace: string;
30
29
  }
@@ -70,7 +69,6 @@ export const feedbackDetails = (
70
69
  ["Design system", designSystemDetail(context.designSystem)],
71
70
  ["Agents", context.agents.join(", ")],
72
71
  ["Default agent", context.defaultAgent],
73
- ["Icons", context.icons],
74
72
  ["Language", context.locale],
75
73
  ["Features on", context.features.join(", ")],
76
74
  ]),
@@ -105,7 +103,6 @@ export const useFeedbackDetails = (): FeedbackDetailGroup[] => {
105
103
  },
106
104
  agents: [...new Set(agents.map((connected) => agentName(connected.agent)))],
107
105
  defaultAgent: agent && AGENT_NAMES[agent],
108
- icons: ui.icons,
109
106
  locale: ui.locale,
110
107
  features: Object.entries(features)
111
108
  .filter(([, on]) => on)
@@ -1,5 +1,6 @@
1
1
  import { Plural, Trans, useLingui } from "@lingui/react/macro";
2
2
  import { Icon } from "@studio/icons";
3
+ import { useFileDrop } from "@studio/ui/file-drop";
3
4
  import { Segmented } from "@studio/ui/segmented";
4
5
  import {
5
6
  Attachment,
@@ -23,7 +24,6 @@ import { Textarea } from "@studio/ui/shadcn/textarea";
23
24
  import { cn } from "cn";
24
25
  import {
25
26
  type ClipboardEvent,
26
- type DragEvent,
27
27
  type FormEvent,
28
28
  type KeyboardEvent,
29
29
  type ReactNode,
@@ -53,7 +53,9 @@ import { PRODUCT } from "../../src/shared/product.ts";
53
53
  // what was written when it doesn't go. The same form serves Dex's dialog
54
54
  // and the extension's page (extension/feedback.tsx), which starts it with the
55
55
  // page's screenshot attached; Markup ports it, line for line, into its shadow
56
- // root.
56
+ // root. Each puts it on a surface with no padding of its own: the form pads
57
+ // itself, so it fills the surface to the edge and a file dropped anywhere on
58
+ // what looks like the form lands on it, not on the page, which would open it.
57
59
 
58
60
  /**
59
61
  * Dex information, sent when the person keeps "Add Dex information"
@@ -117,7 +119,6 @@ export const FeedbackForm = ({
117
119
  const [files, setFiles] = useState<File[]>(draft.files ?? []);
118
120
  const [withDetails, setWithDetails] = useState(true);
119
121
  const [status, setStatus] = useState<Status>({ step: "writing" });
120
- const [over, setOver] = useState(false);
121
122
 
122
123
  const feedback: Feedback = {
123
124
  kind,
@@ -149,6 +150,9 @@ export const FeedbackForm = ({
149
150
  // Every file, so one it can't take stays to say why, not vanish.
150
151
  setFiles((current) => [...current, ...more]);
151
152
 
153
+ // A file dropped anywhere on the form attaches.
154
+ const { over, zone } = useFileDrop(attach);
155
+
152
156
  if (status.step === "sent") {
153
157
  return <Thanks email={status.email} onClose={onClose} />;
154
158
  }
@@ -164,24 +168,9 @@ export const FeedbackForm = ({
164
168
  // biome-ignore lint/a11y/noNoninteractiveElementInteractions: ⌘Enter sends from any field, and files dropped anywhere on the form attach
165
169
  <form
166
170
  aria-labelledby={`${ids}-title`}
167
- className="flex min-w-0 flex-col gap-4"
171
+ className="flex min-w-0 flex-col gap-4 p-6"
168
172
  noValidate
169
- onDragLeave={(event: DragEvent) => {
170
- if (!event.currentTarget.contains(event.relatedTarget as Node)) {
171
- setOver(false);
172
- }
173
- }}
174
- onDragOver={(event: DragEvent) => {
175
- if (event.dataTransfer.types.includes("Files")) {
176
- event.preventDefault();
177
- setOver(true);
178
- }
179
- }}
180
- onDrop={(event: DragEvent) => {
181
- event.preventDefault();
182
- setOver(false);
183
- attach([...event.dataTransfer.files]);
184
- }}
173
+ {...zone}
185
174
  onKeyDown={(event: KeyboardEvent) => {
186
175
  if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
187
176
  event.preventDefault();
@@ -608,7 +597,7 @@ const Thumbnail = ({ file }: { file: File }) => {
608
597
 
609
598
  /** Sent: thanks, where a reply would go, and a way out. */
610
599
  const Thanks = ({ email, onClose }: { email: string; onClose: () => void }) => (
611
- <div className="flex flex-col items-center gap-3 py-4 text-center">
600
+ <div className="flex flex-col items-center gap-3 px-6 py-10 text-center">
612
601
  <span className="flex size-10 items-center justify-center rounded-xl bg-muted">
613
602
  <Icon className="size-5" name="CircleCheck" />
614
603
  </span>
@@ -32,9 +32,10 @@ export const FeedbackLink = ({ className }: { className: string }) => {
32
32
  </Tip>
33
33
  </TipGroup>
34
34
  <Dialog onOpenChange={setOpen} open={open}>
35
+ {/* No padding: the form pads itself, so a file dropped on its edge lands on it. */}
35
36
  <DialogContent
36
37
  aria-label={t`Send feedback`}
37
- className="max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-md"
38
+ className="max-h-[calc(100dvh-2rem)] overflow-y-auto p-0 sm:max-w-md"
38
39
  showCloseButton={false}
39
40
  >
40
41
  <DexFeedback onClose={() => setOpen(false)} />
@@ -404,7 +404,7 @@ const SlashMenu = ({
404
404
  {/* biome-ignore lint/a11y/useKeyWithClickEvents: the editor's keys choose (arrows, Enter), as focus stays in the text */}
405
405
  <div
406
406
  aria-selected={index === active}
407
- className="studio-small flex min-h-7 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
407
+ className="studio-small flex min-h-7 shrink-0 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
408
408
  id={`${MENU_ID}-${index}`}
409
409
  onClick={() => choose(format)}
410
410
  // Keep the caret in the editor.
@@ -0,0 +1,59 @@
1
+ import { useSyncExternalStore } from "react";
2
+
3
+ // How an agent at work shows on a frame, as each person likes it: drawn in
4
+ // blocks (presence.tsx), only the edge round the frame, or not at all. Kept
5
+ // in this browser, and the same in every tab of it.
6
+
7
+ export const PRESENCE_STYLES = ["blocks", "edge", "off"] as const;
8
+ export type PresenceStyle = (typeof PRESENCE_STYLES)[number];
9
+
10
+ const KEY = "dex.presence.style";
11
+ const DEFAULT: PresenceStyle = "blocks";
12
+
13
+ const listeners = new Set<() => void>();
14
+ /** The choice made where storage is refused (a private window). */
15
+ let unsaved: PresenceStyle | undefined;
16
+
17
+ const read = (): PresenceStyle => {
18
+ if (unsaved) {
19
+ return unsaved;
20
+ }
21
+ try {
22
+ const saved = window.localStorage.getItem(KEY);
23
+ return PRESENCE_STYLES.find((style) => style === saved) ?? DEFAULT;
24
+ } catch {
25
+ return DEFAULT;
26
+ }
27
+ };
28
+
29
+ const subscribe = (listener: () => void) => {
30
+ listeners.add(listener);
31
+ // Another tab chose.
32
+ const onStorage = (event: StorageEvent) => {
33
+ if (event.key === KEY) {
34
+ listener();
35
+ }
36
+ };
37
+ window.addEventListener("storage", onStorage);
38
+ return () => {
39
+ listeners.delete(listener);
40
+ window.removeEventListener("storage", onStorage);
41
+ };
42
+ };
43
+
44
+ /** How this person has agents at work shown. */
45
+ export const usePresenceStyle = (): PresenceStyle =>
46
+ useSyncExternalStore(subscribe, read, () => DEFAULT);
47
+
48
+ /** Show agents at work as `style`, here and in this browser's other tabs. */
49
+ export const setPresenceStyle = (style: PresenceStyle): void => {
50
+ try {
51
+ window.localStorage.setItem(KEY, style);
52
+ } catch {
53
+ // Not remembered, in a private window: it holds until reload.
54
+ unsaved = style;
55
+ }
56
+ for (const listener of listeners) {
57
+ listener();
58
+ }
59
+ };
@@ -6,6 +6,7 @@ import {
6
6
  useState,
7
7
  } from "react";
8
8
  import type { Sketch } from "../types";
9
+ import { usePresenceStyle } from "./presence-style";
9
10
  import {
10
11
  type Bone,
11
12
  changedElements,
@@ -400,7 +401,8 @@ const PresenceBlocks = ({
400
401
  * An agent at work on a view, while `active`. Given the frame's `iframe`,
401
402
  * the view in blocks from its layout; with `blank`, a page still to come,
402
403
  * in blocks as `guess` has it or as a generic page; with neither, only an
403
- * edge round it.
404
+ * edge round it. Each person may have only the edge, or nothing
405
+ * (presence-style.ts).
404
406
  */
405
407
  export const Presence = ({
406
408
  active,
@@ -413,11 +415,12 @@ export const Presence = ({
413
415
  guess?: Guess;
414
416
  iframe?: HTMLIFrameElement | null;
415
417
  }) => {
418
+ const style = usePresenceStyle();
416
419
  const { leaving, shown } = usePresenceExit(active);
417
- if (!shown) {
420
+ if (!shown || style === "off") {
418
421
  return null;
419
422
  }
420
- if (iframe === undefined && !blank) {
423
+ if (style === "edge" || (iframe === undefined && !blank)) {
421
424
  return <PresenceEdge leaving={leaving} />;
422
425
  }
423
426
  return (
@@ -7,8 +7,20 @@ import {
7
7
  useState,
8
8
  } from "react";
9
9
  import { withBase } from "../base";
10
+ import { setPageStyle } from "../canvas/page-style";
10
11
  import { VIEWPORTS } from "../canvas/viewports";
11
12
 
13
+ /**
14
+ * Holds a thumbnail's page still (see the effect in ScaledFrame); Safari
15
+ * before 18.2 knows only the -webkit- way to hide a scrollbar.
16
+ */
17
+ const STILL_ID = "studio-still";
18
+ const STILL_CSS = `
19
+ html, body { overflow: hidden !important; }
20
+ * { scrollbar-width: none !important; }
21
+ ::-webkit-scrollbar { display: none !important; }
22
+ `;
23
+
12
24
  /** How a scaled page sits in its box: its size there, and how far across. */
13
25
  interface Fitted {
14
26
  left: number;
@@ -89,23 +101,23 @@ export const ScaledFrame = ({
89
101
  );
90
102
  // A thumbnail is a still of the page's top: nobody can scroll it, so its
91
103
  // page doesn't scroll, at its root or its body (either can be the
92
- // document's scroller), and no scrollbar shows in it or narrows the page.
104
+ // document's scroller), and no scrollbar shows in it or narrows the page,
105
+ // nor on a scroller in the view (an app's main pane): the still is what
106
+ // the page looks like where scrollbars only show while scrolling.
93
107
  // A page in use scrolls as it would anywhere; back to a still, it shows
94
- // its top again. A scroller inside the view is the design's own, and stays.
108
+ // its top again.
95
109
  useEffect(() => {
96
110
  if (!iframe) {
97
111
  return;
98
112
  }
99
113
  const hold = () => {
100
114
  const page = iframe.contentDocument;
101
- const overflow = interactive ? "" : "hidden";
102
- for (const element of [page?.documentElement, page?.body]) {
103
- element?.style.setProperty("overflow", overflow);
104
- }
105
- if (!interactive && page?.body) {
106
- iframe.contentWindow?.scrollTo(0, 0);
107
- page.body.scrollTop = 0;
115
+ setPageStyle(page, STILL_ID, STILL_CSS, !interactive);
116
+ if (interactive || !page?.body) {
117
+ return;
108
118
  }
119
+ iframe.contentWindow?.scrollTo(0, 0);
120
+ page.body.scrollTop = 0;
109
121
  };
110
122
  hold();
111
123
  iframe.addEventListener("load", hold);
@@ -61,6 +61,18 @@ export const SETTINGS_SECTIONS: SettingsPageRow[] = [
61
61
  () => import("../pages/profile"),
62
62
  "ProfileSettings"
63
63
  ),
64
+ page(
65
+ {
66
+ group: PERSONAL,
67
+ id: "canvas",
68
+ icon: "Eye",
69
+ label: msg`Canvas`,
70
+ lead: msg`How the canvas shows you what agents are doing. Kept in this browser.`,
71
+ running: true,
72
+ },
73
+ () => import("../pages/canvas-settings"),
74
+ "CanvasSettings"
75
+ ),
64
76
  page(
65
77
  {
66
78
  group: WORKSPACE,
@@ -84,5 +84,5 @@ export const SidebarSection = ({
84
84
  /** Dex's own mark, from the app's icon. */
85
85
  export const ProductMark = () => (
86
86
  // biome-ignore lint/performance/noImgElement: the studio runs on Vite, not Next
87
- <img alt="" height={18} src={`${BASE}/favicon.svg`} width={18} />
87
+ <img alt="" height={18} src={`${BASE}/dex-icon.svg`} width={18} />
88
88
  );
@@ -10,8 +10,6 @@ declare module "virtual:studio-ui" {
10
10
  export const ui: {
11
11
  /** `ui.chromeTheme`: the interface's variables mapped to the design system's. */
12
12
  chromeTheme?: ChromeTheme;
13
- /** `ui.icons`: the set the interface draws with, Lucide if unset. */
14
- icons?: "phosphor" | "lucide" | "hugeicons";
15
13
  locale?: string;
16
14
  subtitle?: string;
17
15
  theme?: "studio" | "design-system";
@@ -58,13 +56,6 @@ declare module "virtual:studio-threads" {
58
56
  export const threads: PublicThread[];
59
57
  }
60
58
 
61
- declare module "virtual:studio-icons" {
62
- import type { IconGlyphs } from "./icons/types";
63
-
64
- /** The chosen set's glyphs (`ui.icons`), by name. */
65
- export const glyphs: IconGlyphs;
66
- }
67
-
68
59
  declare module "virtual:studio-design-system" {
69
60
  import type { StudioDesignSystem } from "../src/shared/design-system.ts";
70
61