@dexhq/canvas 0.14.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 (229) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +5 -3
  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 +9 -9
  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/use-activity.ts +0 -8
  33. package/app/canvas/use-agent-changes.tsx +34 -40
  34. package/app/canvas/use-canvas-clipboard.tsx +11 -14
  35. package/app/canvas/xray.ts +3 -12
  36. package/app/frame.tsx +5 -0
  37. package/app/i18n/locales/en/messages.po +88 -8
  38. package/app/i18n/locales/en/messages.ts +1 -1
  39. package/app/i18n/locales/pseudo/messages.po +88 -8
  40. package/app/i18n/locales/pseudo/messages.ts +1 -1
  41. package/app/icons/glyphs.tsx +4 -0
  42. package/app/main.tsx +3 -0
  43. package/app/pages/canvas.tsx +27 -8
  44. package/app/pages/commands-settings.tsx +16 -2
  45. package/app/shell/feedback-form.tsx +10 -21
  46. package/app/shell/feedback-link.tsx +2 -1
  47. package/app/shell/scaled-frame.tsx +21 -9
  48. package/app/types.ts +21 -205
  49. package/app/ui/file-drop.ts +128 -0
  50. package/app/ui/shadcn/input-group.tsx +2 -2
  51. package/dist/cli/banner.d.mts +4 -2
  52. package/dist/cli/banner.mjs +34 -11
  53. package/dist/cli/commands/app.mjs +19 -11
  54. package/dist/cli/commands/hook.mjs +2 -1
  55. package/dist/config/project-files.d.mts +6 -0
  56. package/dist/config/project-files.mjs +14 -2
  57. package/dist/config/renamed.d.mts +0 -2
  58. package/dist/config/renamed.mjs +1 -3
  59. package/dist/content/capture.d.mts +2 -2
  60. package/dist/content/capture.mjs +2 -2
  61. package/dist/content/content.d.mts +3 -141
  62. package/dist/content/content.mjs +7 -62
  63. package/dist/content/flow-specs.mjs +1 -1
  64. package/dist/content/prototype-summary.d.mts +3 -39
  65. package/dist/content/prototype-summary.mjs +2 -3
  66. package/dist/content/prototypes.mjs +1 -1
  67. package/dist/content/text-replace.d.mts +30 -0
  68. package/dist/content/text-replace.mjs +309 -0
  69. package/dist/content/thread-module.mjs +1 -1
  70. package/dist/content/threads.mjs +1 -1
  71. package/dist/paste/paste.mjs +1 -1
  72. package/dist/paths.d.mts +0 -2
  73. package/dist/paths.mjs +1 -3
  74. package/dist/server/agent-env.d.mts +5 -1
  75. package/dist/server/agent-env.mjs +7 -2
  76. package/dist/server/agent-session.d.mts +14 -1
  77. package/dist/server/agent-session.mjs +84 -19
  78. package/dist/server/build-pictures.mjs +1 -1
  79. package/dist/server/channel.d.mts +13 -24
  80. package/dist/server/channel.mjs +55 -37
  81. package/dist/server/claimed-presence.d.mts +3 -2
  82. package/dist/server/claimed-presence.mjs +15 -7
  83. package/dist/server/close-check.mjs +2 -2
  84. package/dist/server/comments/actions.d.mts +153 -0
  85. package/dist/server/comments/actions.mjs +154 -0
  86. package/dist/server/comments/routes.d.mts +25 -0
  87. package/dist/server/comments/routes.mjs +88 -0
  88. package/dist/server/comments/tools.d.mts +6 -0
  89. package/dist/server/comments/tools.mjs +154 -0
  90. package/dist/server/dev-server.mjs +27 -13
  91. package/dist/server/file-lock.d.mts +2 -2
  92. package/dist/server/file-lock.mjs +130 -36
  93. package/dist/server/mcp.d.mts +0 -2
  94. package/dist/server/mcp.mjs +7 -8
  95. package/dist/server/me.d.mts +1 -1
  96. package/dist/server/open-page.d.mts +22 -0
  97. package/dist/server/open-page.mjs +20 -2
  98. package/dist/server/outcome.d.mts +22 -0
  99. package/dist/server/outcome.mjs +8 -0
  100. package/dist/server/own-copies.mjs +2 -2
  101. package/dist/server/people.d.mts +1 -1
  102. package/dist/server/port.d.mts +12 -0
  103. package/dist/server/port.mjs +66 -14
  104. package/dist/server/presence.d.mts +4 -1
  105. package/dist/server/presence.mjs +2 -2
  106. package/dist/server/requests.d.mts +5 -1
  107. package/dist/server/requests.mjs +33 -48
  108. package/dist/server/studio-for.d.mts +5 -0
  109. package/dist/server/studio-for.mjs +17 -3
  110. package/dist/server/sync-install.d.mts +8 -12
  111. package/dist/server/sync-install.mjs +12 -30
  112. package/dist/server/thread-source.mjs +2 -2
  113. package/dist/server/tools/describe.d.mts +1 -1
  114. package/dist/server/tools/describe.mjs +1 -1
  115. package/dist/server/tools/feedback.d.mts +1 -1
  116. package/dist/server/tools/reading.mjs +13 -4
  117. package/dist/server/tools/show.d.mts +1 -1
  118. package/dist/server/tools/snapshot.d.mts +1 -1
  119. package/dist/server/tools/thread-list.mjs +1 -1
  120. package/dist/server/tools/watch.mjs +5 -3
  121. package/dist/server/vite.mjs +2 -2
  122. package/dist/server/web-app.mjs +4 -7
  123. package/dist/server/work-groups.mjs +1 -1
  124. package/dist/setup/create.d.mts +4 -2
  125. package/dist/setup/create.mjs +67 -17
  126. package/dist/setup/design-system-checks.mjs +3 -12
  127. package/dist/setup/desktop-app-script.mjs +4 -3
  128. package/dist/setup/desktop-app-start.d.mts +8 -2
  129. package/dist/setup/desktop-app-start.mjs +64 -29
  130. package/dist/setup/desktop-app.d.mts +8 -0
  131. package/dist/setup/desktop-app.mjs +19 -3
  132. package/dist/setup/detect.d.mts +0 -2
  133. package/dist/setup/detect.mjs +1 -3
  134. package/dist/setup/doctor.mjs +1 -1
  135. package/dist/setup/migrate/row-titles.mjs +1 -1
  136. package/dist/setup/project.d.mts +6 -1
  137. package/dist/setup/project.mjs +9 -9
  138. package/dist/setup/starters.d.mts +2 -0
  139. package/dist/setup/starters.mjs +7 -1
  140. package/dist/shared/annotations-core.mjs +1 -1
  141. package/dist/shared/canvas-core.mjs +1 -1
  142. package/dist/shared/canvas-file.d.mts +201 -0
  143. package/dist/shared/canvas-file.mjs +1 -0
  144. package/dist/shared/comments/routes.d.mts +53 -0
  145. package/dist/shared/comments/routes.mjs +37 -0
  146. package/dist/shared/feedback.d.mts +8 -0
  147. package/dist/shared/feedback.mjs +10 -2
  148. package/dist/shared/page-review.d.mts +2 -11
  149. package/dist/shared/page-review.mjs +4 -13
  150. package/dist/shared/presence-core.d.mts +11 -0
  151. package/dist/shared/presence-core.mjs +11 -2
  152. package/dist/shared/review-file.d.mts +5 -0
  153. package/dist/shared/review-file.mjs +23 -13
  154. package/dist/shared/server-page.mjs +1 -1
  155. package/dist/shared/signup.d.mts +2 -5
  156. package/dist/shared/signup.mjs +2 -35
  157. package/dist/shared/studio-events.d.mts +0 -6
  158. package/dist/shared/studio-events.mjs +1 -5
  159. package/dist/shared/studio-files.d.mts +12 -0
  160. package/dist/shared/studio-files.mjs +6 -1
  161. package/dist/shared/studio-routes.d.mts +16 -62
  162. package/dist/shared/studio-routes.mjs +1 -69
  163. package/dist/shared/threads-core.d.mts +2 -2
  164. package/dist/shared/threads-core.mjs +1 -1
  165. package/extension/dist/feedback.js +148 -138
  166. package/extension/dist/manifest.json +1 -1
  167. package/extension/dist/picker.js +146 -136
  168. package/package.json +2 -2
  169. package/src/cli/banner.ts +45 -11
  170. package/src/cli/commands/app.ts +23 -8
  171. package/src/cli/commands/hook.ts +4 -1
  172. package/src/config/project-files.ts +21 -6
  173. package/src/config/renamed.ts +0 -3
  174. package/src/content/capture.ts +6 -12
  175. package/src/content/content.ts +7 -241
  176. package/src/content/flow-specs.ts +2 -1
  177. package/src/content/prototype-summary.ts +4 -44
  178. package/src/content/review-pages.ts +2 -1
  179. package/src/content/text-replace.ts +449 -0
  180. package/src/paths.ts +0 -8
  181. package/src/server/agent-env.ts +12 -2
  182. package/src/server/agent-session.ts +124 -34
  183. package/src/server/channel.ts +94 -52
  184. package/src/server/claimed-presence.ts +26 -10
  185. package/src/server/comments/actions.ts +352 -0
  186. package/src/server/comments/routes.ts +176 -0
  187. package/src/server/comments/tools.ts +317 -0
  188. package/src/server/dev-server.ts +36 -15
  189. package/src/server/file-lock.ts +205 -54
  190. package/src/server/mcp.ts +13 -14
  191. package/src/server/me.ts +2 -5
  192. package/src/server/open-page.ts +54 -4
  193. package/src/server/outcome.ts +26 -0
  194. package/src/server/people.ts +2 -1
  195. package/src/server/port.ts +94 -20
  196. package/src/server/presence.ts +11 -3
  197. package/src/server/requests.ts +60 -70
  198. package/src/server/studio-for.ts +26 -2
  199. package/src/server/sync-install.ts +35 -26
  200. package/src/server/thread-place.ts +2 -4
  201. package/src/server/tools/reading.ts +16 -3
  202. package/src/server/tools/watch.ts +7 -7
  203. package/src/server/web-app.ts +11 -9
  204. package/src/setup/create.ts +91 -17
  205. package/src/setup/design-system-checks.ts +7 -15
  206. package/src/setup/desktop-app-script.ts +4 -3
  207. package/src/setup/desktop-app-start.ts +94 -26
  208. package/src/setup/desktop-app.ts +23 -2
  209. package/src/setup/detect.ts +0 -4
  210. package/src/setup/project.ts +9 -8
  211. package/src/setup/starters.ts +8 -1
  212. package/src/shared/canvas-file.ts +205 -0
  213. package/src/shared/comments/routes.ts +79 -0
  214. package/src/shared/feedback.ts +14 -4
  215. package/src/shared/page-review.ts +11 -16
  216. package/src/shared/presence-core.ts +16 -2
  217. package/src/shared/review-file.ts +28 -12
  218. package/src/shared/server-page.ts +2 -1
  219. package/src/shared/signup.ts +4 -28
  220. package/src/shared/studio-events.ts +0 -13
  221. package/src/shared/studio-files.ts +14 -0
  222. package/src/shared/studio-routes.ts +21 -64
  223. package/src/shared/threads-core.ts +2 -2
  224. package/dist/server/tools/close-reply.d.mts +0 -6
  225. package/dist/server/tools/close-reply.mjs +0 -138
  226. package/dist/server/tools/comment.d.mts +0 -6
  227. package/dist/server/tools/comment.mjs +0 -49
  228. package/src/server/tools/close-reply.ts +0 -271
  229. package/src/server/tools/comment.ts +0 -96
@@ -96,6 +96,14 @@
96
96
  visibility: hidden;
97
97
  }
98
98
 
99
+ /* Further out, section names would reach into the section above
100
+ (sectionNamesZoom in layout.ts): they hide as well, so a press there
101
+ reaches what shows. A name being typed stays. */
102
+ .studio-canvas[data-section-names="false"]
103
+ .studio-section-handle:not(:has(input)) {
104
+ visibility: hidden;
105
+ }
106
+
99
107
  /* Sections are a name over open canvas, on a surface a shade off the canvas's
100
108
  so each reads as one piece: surfaces, not borders. Their controls show on
101
109
  hover (see .studio-reveal). Square, like the frames in them. */
@@ -135,11 +143,23 @@
135
143
  background: var(--muted);
136
144
  }
137
145
 
146
+ /* What fades or comes in on the canvas does it by --studio-shown, never by
147
+ a transition of opacity or keyframes of opacity or transform: WebKit runs
148
+ those on the compositor, promoting what moves and with it the canvas, and
149
+ leaves the canvas promoted, blurred zoomed in, after they end
150
+ (promoted-layers.test.ts). */
151
+ @property --studio-shown {
152
+ syntax: "<number>";
153
+ inherits: false;
154
+ initial-value: 1;
155
+ }
156
+
138
157
  /* Controls around frames, rows and sections show when you reach for them: on
139
158
  hover, when selected, or with the keyboard. Names and states always show. */
140
159
  .studio-reveal {
141
- opacity: 0;
142
- transition: opacity 120ms ease-out;
160
+ --studio-shown: 0;
161
+ opacity: var(--studio-shown);
162
+ transition: --studio-shown 120ms ease-out;
143
163
  }
144
164
 
145
165
  .studio-canvas-item:hover .studio-frame .studio-reveal,
@@ -148,12 +168,12 @@
148
168
  .studio-reveal-group:hover .studio-reveal,
149
169
  .studio-reveal:focus-within,
150
170
  .studio-reveal:has([data-popup-open]) {
151
- opacity: 1;
171
+ --studio-shown: 1;
152
172
  }
153
173
 
154
174
  @media (hover: none) {
155
175
  .studio-reveal {
156
- opacity: 1;
176
+ --studio-shown: 1;
157
177
  }
158
178
  }
159
179
 
@@ -181,10 +201,11 @@
181
201
  }
182
202
 
183
203
  .studio-canvas-item[data-dragging="true"] .studio-artboard {
204
+ --studio-shown: 0.9;
184
205
  box-shadow:
185
206
  0 0 0 calc(1px / var(--zoom)) var(--studio-accent),
186
207
  0 calc(12px / var(--zoom)) calc(32px / var(--zoom)) rgb(0 0 0 / 0.14);
187
- opacity: 0.9;
208
+ opacity: var(--studio-shown);
188
209
  }
189
210
 
190
211
  /* What a ⌥-drag holds is a copy of the frame, the frame staying in its
@@ -274,6 +295,7 @@
274
295
  left: 0;
275
296
  z-index: 1500;
276
297
  pointer-events: none;
298
+ opacity: var(--studio-shown);
277
299
  animation: studio-insert-in 120ms ease-out;
278
300
  }
279
301
 
@@ -308,9 +330,10 @@
308
330
  }
309
331
 
310
332
  :is(.studio-insert, .studio-add-beside) .studio-add .studio-icon {
333
+ --studio-shown: 0;
311
334
  position: relative;
312
- opacity: 0;
313
- transition: opacity 100ms ease-out;
335
+ opacity: var(--studio-shown);
336
+ transition: --studio-shown 100ms ease-out;
314
337
  }
315
338
 
316
339
  :is(.studio-insert, .studio-add-beside)
@@ -327,7 +350,7 @@
327
350
  :is(.studio-insert, .studio-add-beside)
328
351
  .studio-add:is(:hover, :focus-visible, [data-popup-open])
329
352
  .studio-icon {
330
- opacity: 1;
353
+ --studio-shown: 1;
331
354
  }
332
355
 
333
356
  /* One + at a time: the selected frame's gives way to the pointer's. */
@@ -342,19 +365,20 @@
342
365
  }
343
366
 
344
367
  .studio-add-beside .studio-add .studio-icon {
345
- opacity: 1;
368
+ --studio-shown: 1;
346
369
  }
347
370
  }
348
371
 
349
372
  @keyframes studio-insert-in {
350
373
  from {
351
- opacity: 0;
374
+ --studio-shown: 0;
352
375
  }
353
376
  }
354
377
 
355
378
  /* A row's handle, in the section's margin at its left: there while the pointer
356
379
  is level with the row, or the handle is held or has the keyboard. */
357
380
  .studio-row-handle {
381
+ --studio-shown: 0;
358
382
  display: flex;
359
383
  align-items: center;
360
384
  justify-content: center;
@@ -365,9 +389,9 @@
365
389
  background: var(--background);
366
390
  border-radius: 999px;
367
391
  box-shadow: 0 0 0 1px var(--border);
368
- opacity: 0;
392
+ opacity: var(--studio-shown);
369
393
  transition:
370
- opacity 120ms ease-out,
394
+ --studio-shown 120ms ease-out,
371
395
  color 120ms ease-out,
372
396
  background-color 120ms ease-out,
373
397
  box-shadow 120ms ease-out;
@@ -387,7 +411,7 @@
387
411
  .studio-canvas-item[data-dragging="true"] .studio-row-handle,
388
412
  .studio-row-handle:hover,
389
413
  .studio-row-handle:focus-visible {
390
- opacity: 1;
414
+ --studio-shown: 1;
391
415
  }
392
416
 
393
417
  /* Under the pointer or held, it is the blue of the + in a gap. */
@@ -412,6 +436,7 @@
412
436
  /* A stack's handle: the row's, turned on its side, above the stack's first
413
437
  frame. It shows while the pointer is over the stack, and when held. */
414
438
  .studio-stack-handle {
439
+ --studio-shown: 0;
415
440
  display: flex;
416
441
  align-items: center;
417
442
  justify-content: center;
@@ -422,8 +447,8 @@
422
447
  background: var(--background);
423
448
  border-radius: 999px;
424
449
  box-shadow: 0 0 0 1px var(--border);
425
- opacity: 0;
426
- transition: opacity 120ms ease-out;
450
+ opacity: var(--studio-shown);
451
+ transition: --studio-shown 120ms ease-out;
427
452
  }
428
453
 
429
454
  .studio-stack-dots {
@@ -439,7 +464,7 @@
439
464
  .studio-canvas-item[data-dragging="true"] .studio-stack-handle,
440
465
  .studio-stack-handle:hover,
441
466
  .studio-stack-handle:focus-visible {
442
- opacity: 1;
467
+ --studio-shown: 1;
443
468
  }
444
469
 
445
470
  .studio-stack-handle:hover,
@@ -463,7 +488,7 @@
463
488
  @media (hover: none) {
464
489
  .studio-row-handle,
465
490
  .studio-stack-handle {
466
- opacity: 1;
491
+ --studio-shown: 1;
467
492
  }
468
493
  }
469
494
 
@@ -739,6 +764,7 @@
739
764
  cursor: ns-resize;
740
765
  }
741
766
 
767
+ /* How far it reaches past the frame is layout's RESIZE_REACH. */
742
768
  .studio-resize[data-edge="corner"] {
743
769
  right: calc(-6px / var(--zoom));
744
770
  bottom: calc(-6px / var(--zoom));
@@ -781,37 +807,45 @@
781
807
  and dark, that resizes both ways, shown while the frame is selected. The
782
808
  edges resize too, with only the cursor to say so. */
783
809
  .studio-resize[data-edge="corner"]::after {
810
+ --studio-shown: 0;
784
811
  position: absolute;
785
812
  inset: calc(2px / var(--zoom));
786
813
  content: "";
787
814
  background: white;
788
815
  border: calc(1px / var(--zoom)) solid var(--studio-accent);
789
816
  border-radius: calc(1px / var(--zoom));
790
- opacity: 0;
791
- transition: opacity 120ms ease-out;
817
+ opacity: var(--studio-shown);
818
+ transition: --studio-shown 120ms ease-out;
792
819
  }
793
820
 
794
821
  .studio-frame[data-selected="true"] .studio-resize[data-edge="corner"]::after,
795
822
  .studio-section-region[data-selected="true"]
796
823
  .studio-resize[data-edge="corner"]::after {
797
- opacity: 1;
824
+ --studio-shown: 1;
798
825
  }
799
826
 
800
- /* A selected frame's size, floating under it. */
827
+ /* A selected frame's size, floating under it. Opaque, with no backdrop blur,
828
+ which would promote it (promoted-layers.test.ts). */
801
829
  .studio-size-pill {
802
830
  padding: 0.25rem;
803
- background: color-mix(in oklab, var(--background) 92%, transparent);
831
+ background: var(--background);
804
832
  border-radius: 0.5rem;
805
833
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
806
- backdrop-filter: blur(8px);
807
834
  transform-origin: top center;
808
835
  animation: studio-pill-in 160ms cubic-bezier(0.2, 0, 0, 1);
809
836
  }
810
837
 
838
+ /* In from a little above and a little smaller, by --studio-shown: by
839
+ transform, which a button's press (its scale) stacks with. */
840
+ :is(.studio-size-pill, .studio-size-reset) {
841
+ opacity: var(--studio-shown);
842
+ transform: translateY(calc((var(--studio-shown) - 1) * 4px))
843
+ scale(calc(0.97 + 0.03 * var(--studio-shown)));
844
+ }
845
+
811
846
  @keyframes studio-pill-in {
812
847
  from {
813
- opacity: 0;
814
- transform: translateY(-4px) scale(0.97);
848
+ --studio-shown: 0;
815
849
  }
816
850
  }
817
851
 
@@ -838,8 +872,9 @@
838
872
 
839
873
  /* And comes back down onto the canvas as it gets there. */
840
874
  .studio-canvas[data-settling="true"] .studio-artboard {
875
+ opacity: var(--studio-shown);
841
876
  transition:
842
- opacity 200ms ease-out,
877
+ --studio-shown 200ms ease-out,
843
878
  box-shadow 200ms ease-out;
844
879
  }
845
880
 
@@ -5,6 +5,7 @@ import { cn } from "cn";
5
5
  import type { ReactNode } from "react";
6
6
  import type { Thread } from "../types";
7
7
  import { commentWords } from "./agent-changes";
8
+ import { useIsHiddenThread } from "./comments";
8
9
  import type { Notice } from "./inspect-tools";
9
10
 
10
11
  // The canvas's notices at the top centre (what the person just did, such
@@ -109,7 +110,11 @@ export const ActionNotice = ({ notice }: { notice?: Notice }) => (
109
110
  </>
110
111
  );
111
112
 
112
- /** Where an agent's change landed: a green pin with a tick, opening the comment. */
113
+ /**
114
+ * Where an agent's change landed: a green pin with a tick, opening the
115
+ * comment. It hides with the comment's pin (⇧C), and shows with it again
116
+ * when the comment is opened since.
117
+ */
113
118
  export const AgentPin = ({
114
119
  onOpen,
115
120
  thread,
@@ -118,6 +123,10 @@ export const AgentPin = ({
118
123
  thread: Thread;
119
124
  }) => {
120
125
  const { t } = useLingui();
126
+ const hidden = useIsHiddenThread(thread.id);
127
+ if (hidden) {
128
+ return null;
129
+ }
121
130
  const words = commentWords(thread);
122
131
  return (
123
132
  <button
@@ -8,6 +8,7 @@ import {
8
8
  import type { Frame, ThreadTarget } from "../types";
9
9
  import { elementTarget, frameTarget, type Point } from "./anchoring";
10
10
  import { useCanvas } from "./canvas-context";
11
+ import { takeKeyboardFrom } from "./canvas-input";
11
12
  import { type CommentKey, commentKey } from "./canvas-keys";
12
13
  import { useCanvasUi } from "./canvas-ui";
13
14
  import { useLoadedCommands } from "./command-menu";
@@ -294,7 +295,7 @@ export const CommentLayer = ({
294
295
  }
295
296
  const focused = document.activeElement;
296
297
  if (focused instanceof HTMLIFrameElement) {
297
- focused.blur();
298
+ takeKeyboardFrom(focused);
298
299
  }
299
300
  const onKeyDown = (event: KeyboardEvent) => {
300
301
  const action = isTyping(event.target) ? undefined : commentKey(event);