@tldraw/commenting 5.7.0-canary.249bc7370784 → 5.7.0-canary.25339b7b3076

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 (88) hide show
  1. package/commenting.css +262 -278
  2. package/dist-cjs/canvas/canvas-events.js +25 -1
  3. package/dist-cjs/canvas/canvas-events.js.map +2 -2
  4. package/dist-cjs/canvas/comment-tool.js +29 -28
  5. package/dist-cjs/canvas/comment-tool.js.map +2 -2
  6. package/dist-cjs/canvas/comments-filter-menu.js +55 -38
  7. package/dist-cjs/canvas/comments-filter-menu.js.map +2 -2
  8. package/dist-cjs/canvas/comments-overflow-menu.js +6 -24
  9. package/dist-cjs/canvas/comments-overflow-menu.js.map +2 -2
  10. package/dist-cjs/canvas/comments-overlay.js +1 -0
  11. package/dist-cjs/canvas/comments-overlay.js.map +2 -2
  12. package/dist-cjs/canvas/comments-sidebar.js +3 -1
  13. package/dist-cjs/canvas/comments-sidebar.js.map +2 -2
  14. package/dist-cjs/canvas/comments-visibility-toggle.js +1 -1
  15. package/dist-cjs/canvas/comments-visibility-toggle.js.map +1 -1
  16. package/dist-cjs/canvas/pending-composer.js +130 -7
  17. package/dist-cjs/canvas/pending-composer.js.map +2 -2
  18. package/dist-cjs/canvas/region-box.js +150 -35
  19. package/dist-cjs/canvas/region-box.js.map +3 -3
  20. package/dist-cjs/canvas/thread-pin.js +18 -3
  21. package/dist-cjs/canvas/thread-pin.js.map +2 -2
  22. package/dist-cjs/canvas/thread-view.js +93 -53
  23. package/dist-cjs/canvas/thread-view.js.map +2 -2
  24. package/dist-cjs/index.d.ts +7 -7
  25. package/dist-cjs/index.js +1 -1
  26. package/dist-cjs/ui/comment-extensions.js +4 -1
  27. package/dist-cjs/ui/comment-extensions.js.map +2 -2
  28. package/dist-cjs/ui/comments-list.js +5 -7
  29. package/dist-cjs/ui/comments-list.js.map +2 -2
  30. package/dist-cjs/ui/icons.js +4 -4
  31. package/dist-cjs/ui/icons.js.map +2 -2
  32. package/dist-cjs/ui/reaction-picker.js +2 -2
  33. package/dist-cjs/ui/reaction-picker.js.map +1 -1
  34. package/dist-cjs/ui/send-button.js.map +1 -1
  35. package/dist-esm/canvas/canvas-events.mjs +25 -1
  36. package/dist-esm/canvas/canvas-events.mjs.map +2 -2
  37. package/dist-esm/canvas/comment-tool.mjs +30 -29
  38. package/dist-esm/canvas/comment-tool.mjs.map +2 -2
  39. package/dist-esm/canvas/comments-filter-menu.mjs +57 -39
  40. package/dist-esm/canvas/comments-filter-menu.mjs.map +2 -2
  41. package/dist-esm/canvas/comments-overflow-menu.mjs +8 -24
  42. package/dist-esm/canvas/comments-overflow-menu.mjs.map +2 -2
  43. package/dist-esm/canvas/comments-overlay.mjs +1 -0
  44. package/dist-esm/canvas/comments-overlay.mjs.map +2 -2
  45. package/dist-esm/canvas/comments-sidebar.mjs +4 -2
  46. package/dist-esm/canvas/comments-sidebar.mjs.map +2 -2
  47. package/dist-esm/canvas/comments-visibility-toggle.mjs +1 -1
  48. package/dist-esm/canvas/comments-visibility-toggle.mjs.map +1 -1
  49. package/dist-esm/canvas/pending-composer.mjs +140 -8
  50. package/dist-esm/canvas/pending-composer.mjs.map +2 -2
  51. package/dist-esm/canvas/region-box.mjs +161 -38
  52. package/dist-esm/canvas/region-box.mjs.map +3 -3
  53. package/dist-esm/canvas/thread-pin.mjs +19 -4
  54. package/dist-esm/canvas/thread-pin.mjs.map +2 -2
  55. package/dist-esm/canvas/thread-view.mjs +103 -54
  56. package/dist-esm/canvas/thread-view.mjs.map +2 -2
  57. package/dist-esm/index.d.mts +7 -7
  58. package/dist-esm/index.mjs +1 -1
  59. package/dist-esm/ui/comment-extensions.mjs +11 -2
  60. package/dist-esm/ui/comment-extensions.mjs.map +2 -2
  61. package/dist-esm/ui/comments-list.mjs +5 -7
  62. package/dist-esm/ui/comments-list.mjs.map +2 -2
  63. package/dist-esm/ui/icons.mjs +4 -4
  64. package/dist-esm/ui/icons.mjs.map +2 -2
  65. package/dist-esm/ui/reaction-picker.mjs +2 -2
  66. package/dist-esm/ui/reaction-picker.mjs.map +1 -1
  67. package/dist-esm/ui/send-button.mjs.map +1 -1
  68. package/package.json +5 -5
  69. package/src/canvas/canvas-events.ts +39 -2
  70. package/src/canvas/canvas.css +73 -38
  71. package/src/canvas/comment-render.test.ts +8 -1
  72. package/src/canvas/comment-tool.test.ts +34 -44
  73. package/src/canvas/comment-tool.tsx +51 -55
  74. package/src/canvas/comments-filter-menu.tsx +19 -6
  75. package/src/canvas/comments-overflow-menu.tsx +12 -18
  76. package/src/canvas/comments-overlay.tsx +5 -2
  77. package/src/canvas/comments-sidebar.tsx +5 -2
  78. package/src/canvas/comments-visibility-toggle.tsx +1 -1
  79. package/src/canvas/pending-composer.tsx +179 -18
  80. package/src/canvas/region-box.tsx +192 -42
  81. package/src/canvas/thread-pin.tsx +23 -4
  82. package/src/canvas/thread-view.tsx +136 -66
  83. package/src/ui/comment-extensions.ts +18 -5
  84. package/src/ui/comments-list.tsx +20 -17
  85. package/src/ui/comments.css +160 -204
  86. package/src/ui/icons.tsx +5 -5
  87. package/src/ui/reaction-picker.tsx +2 -2
  88. package/src/ui/send-button.tsx +2 -2
package/commenting.css CHANGED
@@ -28,56 +28,48 @@
28
28
  border-radius: 4px;
29
29
  }
30
30
 
31
- /* mention picker */
32
- .tlui-cmt-mention-list {
31
+ /* mention picker — row size, highlight, panel and shadow come from .tlui-menu and
32
+ .tlui-button__menu; these rules only lay out the row's contents. */
33
+ .tlui-menu.tlui-cmt-mention-list {
33
34
  display: flex;
34
35
  flex-direction: column;
35
- gap: 4px;
36
- padding: 4px;
37
36
  width: 100%;
38
- box-sizing: border-box;
39
- max-height: 260px;
40
- overflow-y: auto;
41
- color: var(--tl-color-text-1, #1d1d1d);
42
- background: var(--tl-color-panel, #fff);
43
- border-radius: 10px;
44
- /* shadow-3 (like the context menu) already carries a 1px inset edge — a separate `border`
45
- on top of it double-outlines the popup. */
46
- box-shadow: var(--tl-shadow-3, 0 2px 12px rgba(0, 0, 0, 0.14));
37
+ /* Fits MAX_SUGGESTIONS (8) menu rows: .tlui-menu hides its scrollbar and the active row
38
+ isn't scrolled into view, so a cut-off last row would be unreachable. */
39
+ max-height: 296px;
40
+ color: var(--tl-color-text-1);
47
41
  }
48
42
 
49
- .tlui-cmt-mention-list__item {
50
- display: flex;
51
- align-items: center;
52
- gap: 8px;
53
- padding: 6px 8px;
54
- border: none;
55
- background: transparent;
56
- border-radius: 6px;
57
- cursor: pointer;
58
- text-align: left;
59
- color: var(--tl-color-text-1);
60
- font: inherit;
43
+ .tlui-cmt-mention-list .tlui-cmt-mention-list__item {
44
+ /* min-height rather than the menu row's fixed 40px, so a taller renderMember row can grow. */
45
+ height: auto;
46
+ min-height: 40px;
47
+ flex-shrink: 0;
48
+ justify-content: flex-start;
49
+ text-align: start;
61
50
  }
62
51
 
63
- .tlui-cmt-mention-list__item--active,
64
- .tlui-cmt-mention-list__item:hover {
65
- background: var(--tl-color-muted-2, rgba(0, 0, 0, 0.06));
52
+ .tlui-cmt-mention-list__item .tlui-cmt-avatar {
53
+ width: 20px;
54
+ height: 20px;
55
+ font-size: 10px;
66
56
  }
67
57
 
58
+ /* Name and secondary share one line so a row never outgrows the menu-row height. */
68
59
  .tlui-cmt-mention-list__text {
69
60
  display: flex;
70
- flex-direction: column;
61
+ align-items: baseline;
62
+ gap: 6px;
71
63
  min-width: 0;
72
- line-height: 1.3;
73
64
  }
74
65
 
75
66
  .tlui-cmt-mention-list__name {
76
67
  font-size: 12px;
77
- font-weight: 500;
78
68
  white-space: nowrap;
79
69
  overflow: hidden;
80
70
  text-overflow: ellipsis;
71
+ flex-shrink: 0;
72
+ max-width: 100%;
81
73
  }
82
74
 
83
75
  .tlui-cmt-mention-list__you {
@@ -94,12 +86,13 @@
94
86
  text-overflow: ellipsis;
95
87
  }
96
88
 
97
- .tlui-cmt-mention-list--empty {
98
- padding: 8px 10px;
99
- width: 100%;
100
- box-sizing: border-box;
89
+ .tlui-menu.tlui-cmt-mention-list--empty {
90
+ flex-direction: row;
91
+ align-items: center;
92
+ height: 40px;
93
+ padding: 0 12px;
101
94
  color: var(--tl-color-text-3);
102
- font-size: 13px;
95
+ font-size: 12px;
103
96
  }
104
97
 
105
98
  /* the @-picker popup — anchored under the editor field, positioned by the suggestion plugin */
@@ -108,8 +101,6 @@
108
101
  z-index: var(--tl-layer-menus);
109
102
  }
110
103
 
111
- /* Real comment UI components. Co-located so styles travel to any view (studio,
112
- canvas), and themed via tldraw's --tl-color tokens so they follow light/dark. */
113
104
  .tlui-cmt-card {
114
105
  position: relative;
115
106
  display: flex;
@@ -128,7 +119,6 @@
128
119
  padding-left: calc(28px + 6px);
129
120
  }
130
121
 
131
- /* hover-revealed controls (edit, react…) stacked at the card's top-right */
132
122
  .tlui-cmt-card__actions {
133
123
  position: absolute;
134
124
  top: 6px;
@@ -164,12 +154,13 @@
164
154
  display: flex;
165
155
  align-items: center;
166
156
  gap: 6px;
157
+ margin-bottom: -4px;
167
158
  }
168
159
 
169
160
  .tlui-cmt-author {
170
161
  font-weight: 500;
171
162
  font-size: 12px;
172
- color: var(--tl-color-text-1);
163
+ color: var(--tl-color-text);
173
164
  /* a long name ellipsizes rather than pushing the time out or running under the actions */
174
165
  min-width: 0;
175
166
  overflow: hidden;
@@ -184,8 +175,6 @@
184
175
  white-space: nowrap;
185
176
  }
186
177
 
187
- /* In the hover preview a long comment truncates with an ellipsis rather than growing the card —
188
- ~7 lines (≈120px at this line height). Preview only. */
189
178
  .tlui-cmt-canvas-preview--thread .tlui-cmt-text {
190
179
  display: -webkit-box;
191
180
  -webkit-box-orient: vertical;
@@ -212,13 +201,53 @@
212
201
  -webkit-user-select: text;
213
202
  user-select: text;
214
203
  }
204
+ /* In an opened thread the byline, the resolved banner and a host's own `CommentBody` (which may not
205
+ use .tlui-cmt-text) are selectable too, so a quote can be copied with its author and time. Rows
206
+ in the list stay unselectable: they're click targets, and a drag there would select instead. */
207
+ .tlui-cmt-thread :is(.tlui-cmt-author, .tlui-cmt-time, .tlui-cmt-body, .tlui-cmt-thread__resolved),
208
+ .tlui-cmt-thread
209
+ :is(.tlui-cmt-author, .tlui-cmt-time, .tlui-cmt-body, .tlui-cmt-thread__resolved)
210
+ * {
211
+ -webkit-user-select: text;
212
+ user-select: text;
213
+ }
214
+ /* …but not the controls inside them (reaction pills, See more), whose labels aren't content. */
215
+ .tlui-cmt-thread .tlui-cmt-body :is(button, button *) {
216
+ -webkit-user-select: none;
217
+ user-select: none;
218
+ }
219
+
220
+ /* A long comment in the thread view, clamped to 10 lines until expanded. A line clamp, not a max
221
+ height, so it always ends on a whole line: paragraph gaps would leave a height cut mid-line. */
222
+ .tlui-cmt-collapsible--collapsed {
223
+ display: -webkit-box;
224
+ -webkit-box-orient: vertical;
225
+ -webkit-line-clamp: 10;
226
+ line-clamp: 10;
227
+ overflow: hidden;
228
+ }
229
+ /* Styled as the byline's time ("now"), so it reads as metadata rather than a button. */
230
+ .tlui-cmt-see-more {
231
+ display: block;
232
+ /* The clamped body's own bottom margin is clipped with its overflow. */
233
+ margin: 4px 0 6px;
234
+ padding: 0;
235
+ border: none;
236
+ background: none;
237
+ font: inherit;
238
+ font-size: 12px;
239
+ font-weight: normal;
240
+ color: var(--tl-color-text-3);
241
+ cursor: pointer;
242
+ }
243
+ .tlui-cmt-see-more:hover {
244
+ color: var(--tl-color-text-1);
245
+ }
215
246
 
216
247
  .tlui-cmt-edited {
217
248
  font-style: italic;
218
249
  }
219
250
 
220
- /* rendered rich text inside a comment body — bare tags emitted by the comment renderer
221
- (paragraphs, lists, code, highlight, links), matching the limited comment extension set. */
222
251
  .tlui-cmt-text p {
223
252
  margin: 0;
224
253
  }
@@ -258,9 +287,7 @@
258
287
 
259
288
  /* Avatar and mention styles live in @tldraw/mentions and are imported by commenting.css. */
260
289
 
261
- /* composer — an avatar beside a rounded-rect field holding the rich-text input and the send button.
262
- Formatting is applied via markdown and keyboard shortcuts (no toolbar). The avatar aligns to the
263
- top so it stays put as the field grows to multiple lines. */
290
+ /* The avatar aligns to the top so it stays put as the field grows to multiple lines. */
264
291
  .tlui-cmt-composer {
265
292
  display: flex;
266
293
  align-items: flex-start;
@@ -292,7 +319,6 @@
292
319
  the full width and the send button drops to its own row, right-aligned. */
293
320
  .tlui-cmt-composer__field--expanded {
294
321
  flex-wrap: wrap;
295
- /* No vertical gap between the input and the send-button row it wraps onto. */
296
322
  row-gap: 0;
297
323
  }
298
324
  .tlui-cmt-composer__field--expanded .tlui-cmt-composer__input-wrap {
@@ -305,7 +331,6 @@
305
331
  margin-left: auto;
306
332
  }
307
333
 
308
- /* the editable area, with the placeholder overlaid while it's empty */
309
334
  .tlui-cmt-composer__input-wrap {
310
335
  position: relative;
311
336
  flex: 1;
@@ -375,8 +400,6 @@
375
400
  }
376
401
  }
377
402
 
378
- /* A bare up-arrow icon button (matching the placement composer): no fill by default, a grey square
379
- on hover, grey while there's nothing to send and dark once there is. */
380
403
  .tlui-cmt-send {
381
404
  flex-shrink: 0;
382
405
  display: inline-flex;
@@ -418,8 +441,9 @@
418
441
  }
419
442
 
420
443
  /* The shared marker treatment. To the pointer a comment pin and a count badge are the same
421
- object — a token sitting on the canvas — so they rest and lift identically; everything shared
422
- lives here so the two can't drift apart. */
444
+ object — a token sitting on the canvas — so their resting and hover shadows live here, where the
445
+ two can't drift apart. Each opts out of the hover scale below; a canvas pin gets it back from
446
+ canvas.css, keyed off its hit layer. */
423
447
  .tlui-cmt-marker {
424
448
  box-shadow: var(--tlui-cmt-marker-shadow);
425
449
  cursor: pointer;
@@ -432,52 +456,45 @@
432
456
  transform: scale(var(--tlui-cmt-marker-hover-scale));
433
457
  }
434
458
 
435
- /* The hover shadow is for closed markers only — an open one keeps its selection ring, which this
436
- box-shadow would otherwise override (the hover selector outranks the --open rule). */
437
459
  .tlui-cmt-marker:not(.tlui-cmt-marker--open):hover {
438
460
  box-shadow: var(--tlui-cmt-marker-shadow-hover);
439
461
  }
440
462
 
441
- /* Count badges don't react to hover — no scale, no shadow lift. Only pins do. */
442
463
  .tlui-cmt-count-badge:hover {
443
464
  transform: none;
444
- box-shadow: var(--tlui-cmt-marker-shadow);
465
+ box-shadow: var(--tlui-cmt-marker-shadow-hover);
445
466
  }
446
467
 
447
- /* Pins don't scale on hover — only the shadow lifts. */
468
+ /* A pin's own :hover doesn't scale it; on the canvas, canvas.css scales it from the hit layer. */
448
469
  .tlui-cmt-pin:hover {
449
470
  transform: none;
450
471
  }
451
472
 
452
- /* open: the thread (or a stack's list) is showing — the active marker just keeps its lift shadow,
453
- no selection ring. */
454
473
  .tlui-cmt-marker--open {
455
- box-shadow: var(--tlui-cmt-marker-shadow);
474
+ box-shadow: var(--tlui-cmt-marker-shadow-hover);
456
475
  }
457
476
 
458
- /* pin — a canvas marker: a white teardrop holding the author's avatar circle, so a thread is
459
- identifiable at a glance. */
460
477
  .tlui-cmt-pin {
461
478
  --tlui-cmt-marker-size: var(--tlui-cmt-pin-size);
462
479
  width: var(--tlui-cmt-marker-size);
463
480
  height: var(--tlui-cmt-marker-size);
464
481
  border-radius: 50% 50% 50% 0;
465
482
  background: var(--tl-color-panel);
466
- color: #fff;
483
+ color: var(--tl-color-panel-contrast);
467
484
  display: flex;
468
485
  align-items: center;
469
486
  justify-content: center;
470
487
  font-size: 14px;
471
488
  font-weight: 600;
472
489
  }
473
- /* The pin holds the author's 22px avatar circle, centred in its 28px face. */
474
490
  .tlui-cmt-pin .tlui-cmt-avatar {
475
491
  width: 22px;
476
492
  height: 22px;
493
+ box-shadow: inset 0px 0px 0px 1px var(--tl-color-hint);
477
494
  }
478
495
 
479
- /* resolved: a solid, muted grey (the default --tl-color-muted-1 is 10% black, so it goes
480
- translucent over the canvas). Dark mode gets its own grey — the token's dark value is near-black. */
496
+ /* resolved: a solid, muted grey per theme. The muted tokens are translucent (10% black, or 10% white
497
+ in dark mode), so the canvas would show through a pin filled with one. */
481
498
  .tlui-cmt-pin--resolved {
482
499
  background: #dfe0e1;
483
500
  color: hsl(214, 8%, 42%);
@@ -487,7 +504,6 @@
487
504
  color: hsl(0, 0%, 72%);
488
505
  }
489
506
 
490
- /* count badge — the same marker as a pin. */
491
507
  .tlui-cmt-count-badge {
492
508
  width: var(--tlui-cmt-marker-size);
493
509
  height: var(--tlui-cmt-marker-size);
@@ -502,12 +518,13 @@
502
518
  user-select: none;
503
519
  }
504
520
 
505
- /* reactions */
506
521
  .tlui-cmt-reactions {
507
522
  display: flex;
508
523
  flex-wrap: wrap;
509
524
  gap: 4px;
510
- margin-top: 6px;
525
+ margin-top: 4px;
526
+ /* Pull the row left by the pill's inline padding so the first emoji lines up with the text above. */
527
+ margin-left: -6px;
511
528
  }
512
529
 
513
530
  .tlui-cmt-reaction {
@@ -517,7 +534,7 @@
517
534
  padding: 2px 6px;
518
535
  border: none;
519
536
  border-radius: var(--tl-radius-1);
520
- background: var(--tl-color-muted-2);
537
+ background: none;
521
538
  font: inherit;
522
539
  font-size: 10px;
523
540
  font-weight: 400;
@@ -530,20 +547,8 @@ button.tlui-cmt-reaction {
530
547
  cursor: pointer;
531
548
  }
532
549
 
533
- /* Hover deepens the grey — no border to tint now. Mixing toward the text colour is theme-aware:
534
- it darkens the fill in light mode and lightens it in dark, tracking the pill's own contrast. */
535
550
  button.tlui-cmt-reaction:hover {
536
- background: var(--tl-color-muted-1);
537
- }
538
-
539
- /* a reaction you're part of fills with the selection colour, so "I reacted with this" stands out
540
- from the grey pills of reactions you haven't joined. */
541
- .tlui-cmt-reaction--active {
542
- background: color-mix(in srgb, var(--tl-color-selected) 28%, var(--tl-color-panel));
543
- }
544
-
545
- button.tlui-cmt-reaction--active:hover {
546
- background: color-mix(in srgb, var(--tl-color-selected) 38%, var(--tl-color-panel));
551
+ background: var(--tl-color-muted-2);
547
552
  }
548
553
 
549
554
  /* The emoji renders larger than the 10px count, but its pinned line-height keeps the pill the
@@ -560,14 +565,16 @@ button.tlui-cmt-reaction--active:hover {
560
565
 
561
566
  .tlui-cmt-reaction--active .tlui-cmt-reaction__count {
562
567
  color: var(--tl-color-text-1);
568
+ font-weight: 700;
563
569
  }
564
570
 
565
- /* emoji picker */
571
+ /* Laid out like tldraw's .tlui-grid (the actions menu): 40px hit areas overlapping 2px on every
572
+ side, so the 32px hover squares sit 4px apart and 4px in from the panel edge. */
566
573
  .tlui-cmt-emoji-picker {
567
574
  display: grid;
568
- grid-template-columns: repeat(5, 40px);
575
+ grid-template-columns: repeat(5, 36px);
569
576
  gap: 0;
570
- padding: 4px;
577
+ padding: 2px;
571
578
  }
572
579
 
573
580
  .tlui-cmt-emoji-picker__item {
@@ -577,6 +584,7 @@ button.tlui-cmt-reaction--active:hover {
577
584
  justify-content: center;
578
585
  width: 40px;
579
586
  height: 40px;
587
+ margin: -2px;
580
588
  padding: 0;
581
589
  border: none;
582
590
  background: none;
@@ -586,12 +594,11 @@ button.tlui-cmt-reaction--active:hover {
586
594
  cursor: pointer;
587
595
  }
588
596
 
589
- /* Inset wash behind the glyph — the 40px hit cells tile edge-to-edge, the squares sit 4px apart,
590
- like the thread action buttons. Sits under the emoji so an opaque selected fill can't hide it. */
597
+ /* Sits under the emoji so an opaque selected fill can't hide it. */
591
598
  .tlui-cmt-emoji-picker__item::after {
592
599
  content: '';
593
600
  position: absolute;
594
- inset: 2px;
601
+ inset: 4px;
595
602
  z-index: -1;
596
603
  border-radius: var(--tl-radius-2);
597
604
  }
@@ -606,7 +613,6 @@ button.tlui-cmt-reaction--active:hover {
606
613
  background: color-mix(in srgb, var(--tl-color-selected) 28%, var(--tl-color-panel));
607
614
  }
608
615
 
609
- /* empty state */
610
616
  .tlui-cmt-empty {
611
617
  display: flex;
612
618
  flex-direction: column;
@@ -628,8 +634,6 @@ button.tlui-cmt-reaction--active:hover {
628
634
  line-height: 1.4;
629
635
  }
630
636
 
631
- /* a comment thread: an elevated panel holding a header, an optional resolved banner, the
632
- comments, and a reply composer */
633
637
  /* The thread panel's layout metrics live on the container because two separate portals need them:
634
638
  the panel itself, and the canvas hover preview, which has to land its first comment on exactly
635
639
  the pixel the panel would. Deriving the preview's offset from these means the two can't drift —
@@ -644,16 +648,20 @@ button.tlui-cmt-reaction--active:hover {
644
648
  stops at the marker's edge instead of covering it. Mirrored by `MARKER_SIZE` in
645
649
  thread-view.tsx. */
646
650
  --tlui-cmt-marker-size: var(--tlui-cmt-pin-size);
647
- /* How a marker sits, lifts, and rings. Shared so a pin and a badge respond identically.
648
- shadow-3's depth without its `inset 1px panel-contrast` edge — that inset reads as a white
649
- border on a coloured pin (it's invisible on the panel-white menus shadow-3 is meant for). */
650
- --tlui-cmt-marker-shadow: 0px 1px 2px hsl(0, 0%, 0%, 28%), 0px 2px 6px hsl(0, 0%, 0%, 14%);
651
- --tlui-cmt-marker-shadow-hover: var(--tlui-cmt-marker-shadow);
651
+ /* How a marker rests and lifts. Shared so a pin and a badge respond identically. shadow-3's
652
+ depth without its `inset 1px panel-contrast` edge, which would ring the text-coloured count
653
+ badge in the panel's contrast colour. */
654
+ --tlui-cmt-marker-shadow:
655
+ 0px 1px 2px hsl(0, 0%, 0%, 28%), 0px 2px 6px hsl(0, 0%, 0%, 14%),
656
+ inset 0px 0px 0px 1px var(--tl-color-panel-contrast);
657
+ --tlui-cmt-marker-shadow-hover:
658
+ 0px 1px 2px hsl(0, 0%, 0%, 32%), 0px 2px 6px hsl(0, 0%, 0%, 14%),
659
+ inset 0px 0px 0px 1px var(--tl-color-panel-contrast);
652
660
  --tlui-cmt-marker-hover-scale: 1.08;
653
661
  --tlui-cmt-marker-transition: 0.08s ease;
654
662
  --tlui-cmt-thread-padding: 12px;
655
663
  --tlui-cmt-thread-gap: 0px;
656
- /* Hit-area width of one .tlui-cmt-thread__action button (drawn as a 32px square inset 4px). */
664
+ /* Hit-area width of one .tlui-cmt-icon-btn button (drawn as a 32px square inset 4px). */
657
665
  --tlui-cmt-thread-action-size: 40px;
658
666
  /* A floating pill's edge — its hairline ring is the only thing separating it from the panel it
659
667
  overlaps, so the ring is a theme token rather than a literal black: a near-black hairline
@@ -671,7 +679,6 @@ button.tlui-cmt-reaction--active:hover {
671
679
  border-radius: var(--tl-radius-4);
672
680
  box-shadow: var(--tl-shadow-3);
673
681
  }
674
- /* A pill of its own, floating above the panel's top-right corner and overlapping its top edge. */
675
682
  .tlui-cmt-thread__header {
676
683
  position: absolute;
677
684
  right: 10px;
@@ -684,17 +691,17 @@ button.tlui-cmt-reaction--active:hover {
684
691
  box-shadow: var(--tlui-cmt-pill-shadow);
685
692
  transition: opacity 0.1s ease;
686
693
  }
687
- /* The first comment's hover actions surface right where the header pill sits, so hide the pill
688
- while that comment is hovered — one pill in the corner, never two stacked. */
694
+ /* The first comment's hover actions surface right under the header pill, so hide the pill while
695
+ that comment is hovered — one set of actions in the corner, never two stacked. */
689
696
  .tlui-cmt-thread:has(.tlui-cmt-thread__list > :first-child:hover)
690
697
  .tlui-cmt-thread__header:not(:has(.tlui-cmt-thread__title)) {
691
698
  opacity: 0;
692
699
  pointer-events: none;
693
700
  }
694
- /* A title puts the header back in the panel, in flow. The pill above is tuned for the actions-only
695
- case tldraw itself uses: right-anchored and only as wide as its buttons, so a title inside it
696
- would grow leftwards off the panel's edge and float over whatever sits above. `header` is public
697
- API (see `CommentThreadProps`), so it has to keep laying out sensibly for anyone passing one. */
701
+ /* A title puts the header back in the panel, in flow — the case tldraw's own thread view uses
702
+ ("Comment"). The pill above suits an actions-only header: right-anchored and only as wide as its
703
+ buttons, so a title inside it would grow leftwards off the panel's edge. `header` is public API
704
+ (see `CommentThreadProps`), so both layouts have to hold up. */
698
705
  .tlui-cmt-thread__header:has(.tlui-cmt-thread__title) {
699
706
  position: static;
700
707
  align-items: center;
@@ -705,24 +712,22 @@ button.tlui-cmt-reaction--active:hover {
705
712
  }
706
713
  .tlui-cmt-thread__title {
707
714
  padding: 10px 12px;
708
- font-size: 12px;
709
- line-height: 20px;
710
- font-weight: 500;
711
- color: var(--tl-color-text-1);
715
+ color: var(--tl-color-text);
712
716
  }
713
717
  .tlui-cmt-thread__actions {
714
718
  display: flex;
715
719
  gap: 0;
716
- /* Right-align the actions whether or not the header has a title (it currently has none, so
717
- space-between alone would leave them at the left). */
720
+ /* Right-align the actions whether or not the header has a title (with none, space-between alone
721
+ would leave them at the left). */
718
722
  margin-left: auto;
719
723
  }
720
- /* These are TldrawUiButtons (type="icon"), so the 40px box, the 32px ::after square carrying the
721
- hover wash, and the hover z-index flip all come from .tlui-button — the hit area (not the
722
- ::after) is what's clickable, and it never reaches past its row. Only the bits that differ from
723
- a toolbar button are set here, at .tlui-button's specificity + 1 so stylesheet order can't
724
- decide the winner. */
725
- .tlui-button.tlui-cmt-thread__action {
724
+ /* Every icon button in the comment UI: thread and sidebar headers, and a comment's own actions.
725
+ These are TldrawUiButtons (type="icon"), so the 40px box, the 32px ::after square carrying the
726
+ hover wash, and the hover z-index flip all come from .tlui-button. Only the bits that differ
727
+ from a toolbar button are set here, at .tlui-button's specificity + 1 so stylesheet order can't
728
+ decide the winner. `.tlui-cmt-thread__action` and `.tlui-cmt-header-btn` are the class's former
729
+ names, kept so a host's own buttons still pick the styles up. */
730
+ .tlui-button:is(.tlui-cmt-icon-btn, .tlui-cmt-thread__action, .tlui-cmt-header-btn) {
726
731
  width: 40px;
727
732
  padding: 0;
728
733
  border-radius: 6px;
@@ -731,19 +736,29 @@ button.tlui-cmt-reaction--active:hover {
731
736
  line-height: 1;
732
737
  }
733
738
  /* Overlap each button 4px into the previous so the 32px visual squares sit 4px apart, not 8px.
734
- Left-only, so the last button's hit area still stops at its row's right edge. */
735
- .tlui-cmt-thread__action + .tlui-cmt-thread__action {
736
- margin-left: -4px;
737
- }
738
- .tlui-button.tlui-cmt-thread__action:hover {
739
- color: var(--tl-color-text-1);
739
+ On the leading side only, so the last button's hit area still stops at its row's edge. */
740
+ :is(.tlui-cmt-icon-btn, .tlui-cmt-thread__action, .tlui-cmt-header-btn)
741
+ + :is(.tlui-cmt-icon-btn, .tlui-cmt-thread__action, .tlui-cmt-header-btn) {
742
+ margin-inline-start: -4px;
743
+ }
744
+ @media (hover: hover) {
745
+ .tlui-button:is(.tlui-cmt-icon-btn, .tlui-cmt-thread__action, .tlui-cmt-header-btn):hover {
746
+ color: var(--tl-color-text-1);
747
+ }
740
748
  }
741
- /* An open menu's trigger, shaded the way the editor's own menu triggers are. */
742
- .tlui-button.tlui-cmt-thread__action[data-state='open'] {
749
+ .tlui-button:is(
750
+ .tlui-cmt-icon-btn,
751
+ .tlui-cmt-thread__action,
752
+ .tlui-cmt-header-btn
753
+ )[data-state='open'] {
743
754
  color: var(--tl-color-text-1);
744
755
  }
745
- .tlui-button.tlui-cmt-thread__action[data-state='open']::after {
746
- background: linear-gradient(180deg, rgba(144, 144, 144, 0) 0%, var(--tl-color-muted-2) 100%);
756
+ .tlui-button:is(
757
+ .tlui-cmt-icon-btn,
758
+ .tlui-cmt-thread__action,
759
+ .tlui-cmt-header-btn
760
+ )[data-state='open']::after {
761
+ background: var(--tl-muted-gradient-to-bottom);
747
762
  opacity: 1;
748
763
  }
749
764
  .tlui-cmt-thread__resolved {
@@ -776,48 +791,31 @@ button.tlui-cmt-reaction--active:hover {
776
791
  .tlui-cmt-thread .tlui-cmt-avatar,
777
792
  .tlui-cmt-canvas-preview--thread .tlui-cmt-avatar,
778
793
  .tlui-cmt-canvas-preview--list .tlui-cmt-avatar,
779
- .tlui-cmt-stack-list .tlui-cmt-avatar {
794
+ .tlui-cmt-stack-list .tlui-cmt-avatar,
795
+ .tlui-cmt-list .tlui-cmt-avatar {
780
796
  width: 12px;
781
797
  height: 12px;
782
798
  font-size: 0;
783
799
  }
784
800
 
785
801
  .tlui-cmt-thread .tlui-cmt-composer {
786
- padding: 12px;
802
+ padding: 4px;
787
803
  }
788
804
  .tlui-cmt-thread .tlui-cmt-composer .tlui-cmt-avatar {
789
805
  display: none;
790
806
  }
791
807
 
792
- /* The sidebar's rows use the same small colour dot as the thread view. */
793
- .tlui-cmt-list .tlui-cmt-avatar {
794
- width: 14px;
795
- height: 14px;
796
- font-size: 0;
797
- margin-top: 2px;
798
- }
799
- /* The sidebar row already leads with its own avatar (the flex row's first column); the byline's
800
- avatar — added for the canvas thread views — would double it, so hide the byline's inside a row. */
801
- .tlui-cmt-list .tlui-cmt-head .tlui-cmt-avatar {
802
- display: none;
803
- }
804
-
805
- /* The dot treatment is for colour-only identity — an image avatar stays full size. */
806
808
  .tlui-cmt-thread .tlui-cmt-avatar--image,
807
809
  .tlui-cmt-canvas-preview--thread .tlui-cmt-avatar--image,
808
810
  .tlui-cmt-canvas-preview--list .tlui-cmt-avatar--image,
809
- .tlui-cmt-stack-list .tlui-cmt-avatar--image {
811
+ .tlui-cmt-stack-list .tlui-cmt-avatar--image,
812
+ .tlui-cmt-list .tlui-cmt-avatar--image {
810
813
  /* Match the 12px colour dot's width so the body's calc(12px + 6px) indent still lines up under
811
814
  the byline name when the author has an image rather than a dot. */
812
815
  width: 12px;
813
816
  height: 12px;
814
817
  margin-top: 0;
815
818
  }
816
- .tlui-cmt-list .tlui-cmt-avatar--image {
817
- width: 24px;
818
- height: 24px;
819
- margin-top: 0;
820
- }
821
819
 
822
820
  /* inside the panel, comments are plain content — no surrounding box; the composer's field carries
823
821
  its own surface. The hover preview is the same panel without a header, so its comment is laid
@@ -834,31 +832,30 @@ button.tlui-cmt-reaction--active:hover {
834
832
  .tlui-cmt-thread .tlui-cmt-body,
835
833
  .tlui-cmt-canvas-preview--thread .tlui-cmt-body,
836
834
  .tlui-cmt-canvas-preview--list .tlui-cmt-body,
837
- .tlui-cmt-stack-list .tlui-cmt-body {
835
+ .tlui-cmt-stack-list .tlui-cmt-body,
836
+ .tlui-cmt-list .tlui-cmt-body {
838
837
  padding-left: calc(12px + 6px);
839
838
  }
840
- /* Inside a panel the actions float as their own pill — the same pill the thread header is, in the
841
- same corner (which is why the header hides while the first comment is hovered). It sits just
842
- above the card's top edge rather than on the byline. */
843
839
  /* Line the card actions up with the header actions: flush to the full-width card's right edge (the
844
- panel edge, matching the header ✕) and flush on the 40px byline row, so the 40px buttons fill it. */
840
+ panel edge, under the header's ⋯) and flush on the 40px byline row, so the 40px buttons fill it. */
845
841
  .tlui-cmt-thread .tlui-cmt-card .tlui-cmt-card__actions {
846
842
  top: 0;
847
843
  right: 0;
848
844
  }
849
- /* The byline row is 40px: on the opened thread it fits the action pills (react/edit/delete) that
850
- float in its corner without the text running underneath; previews and collapsed cards carry the
851
- same height so every comment row reads identically, solo or in a stack. */
845
+ /* The byline row is 40px: on the opened thread it fits the action buttons (⋯ menu, react) in its
846
+ corner without the text running underneath; previews and stack lists carry the same height so
847
+ every comment row reads identically, solo or in a stack. */
852
848
  .tlui-cmt-thread .tlui-cmt-card .tlui-cmt-head,
853
849
  .tlui-cmt-canvas-preview--thread .tlui-cmt-card .tlui-cmt-head,
854
850
  .tlui-cmt-canvas-preview--list .tlui-cmt-card .tlui-cmt-head,
855
- .tlui-cmt-stack-list .tlui-cmt-card .tlui-cmt-head {
851
+ .tlui-cmt-stack-list .tlui-cmt-card .tlui-cmt-head,
852
+ .tlui-cmt-list__item .tlui-cmt-head {
856
853
  min-height: 40px;
857
854
  }
858
- /* Reserve head room only for pills that actually rendered (one child / two children) — pill count
859
- is a permissions question (canModifyComment), not ownership, and empty slots (read-only viewers)
860
- keep the full row. Sized from the 40px hit areas (4px overlap), minus the card padding the
861
- right:0 pills sit over; text stops 4px shy of the visible square. */
855
+ /* Reserve head room only for buttons that actually rendered (one child / two children) — the count
856
+ is a permissions question (see canModifyComment), not ownership, and empty slots (read-only
857
+ viewers) keep the full row. Sized from the 40px hit areas (4px overlap), minus the card padding
858
+ the right:0 buttons sit over; text stops 4px shy of the visible square. */
862
859
  .tlui-cmt-thread .tlui-cmt-card:has(.tlui-cmt-card__actions > *) .tlui-cmt-head {
863
860
  padding-right: calc(var(--tlui-cmt-thread-action-size) - var(--tlui-cmt-thread-padding));
864
861
  }
@@ -868,7 +865,6 @@ button.tlui-cmt-reaction--active:hover {
868
865
  );
869
866
  }
870
867
 
871
- /* comments list — thread summaries, one per row (used by the canvas sidebar) */
872
868
  .tlui-cmt-list {
873
869
  display: flex;
874
870
  flex-direction: column;
@@ -881,99 +877,45 @@ button.tlui-cmt-reaction--active:hover {
881
877
  align-items: center;
882
878
  justify-content: space-between;
883
879
  gap: 8px;
884
- padding: 2px 2px 2px 14px;
880
+ /* Flush top and right, like the thread popover's header: the 40px buttons' 32px hover squares
881
+ then sit 4px in from the panel edge, and the title shares the popover's 12px inset. */
882
+ height: 40px;
883
+ padding: 0 0 0 12px;
885
884
  border-bottom: 1px solid var(--tl-color-divider);
886
885
  }
887
886
  .tlui-cmt-list__header-title {
888
887
  font-size: 12px;
889
- font-weight: 500;
890
- color: var(--tl-color-text-1);
888
+ color: var(--tl-color-text);
891
889
  }
892
890
 
893
- /* An icon button in the sidebar header (filter funnel, overflow …). Sized like the thread actions:
894
- a TldrawUiButton (type="icon") left at its native 40px box, with .tlui-button's 32px ::after
895
- square carrying the hover wash. Only the bits that differ are set here, at .tlui-button's
896
- specificity + 1 so stylesheet order can't decide the winner. */
897
- .tlui-button.tlui-cmt-header-btn {
898
- width: 40px;
899
- padding: 0;
900
- border-radius: 6px;
901
- color: var(--tl-color-text-2);
902
- }
903
- /* Overlap each button 4px into the previous so the 32px visual squares sit 4px apart, not 8px —
904
- the same tiling the thread actions use. */
905
- .tlui-cmt-header-btn + .tlui-cmt-header-btn {
906
- margin-left: -4px;
907
- }
908
- .tlui-button.tlui-cmt-header-btn:hover,
909
- .tlui-button.tlui-cmt-header-btn[data-state='open'] {
910
- color: var(--tl-color-text-1);
911
- }
912
891
  .tlui-cmt-list__header-actions {
913
892
  display: flex;
914
893
  align-items: center;
915
894
  }
916
895
 
917
- /* The commenting dropdowns' surface — a little air between the items and the menu edge. */
918
- .tlui-cmt-menu {
919
- min-width: 100px;
920
- padding: 4px;
921
- }
922
-
923
- /* a menu row with a label and a right-aligned shortcut hint (overflow menu) */
924
- .tlui-cmt-menu-item {
925
- position: relative;
926
- display: flex;
927
- align-items: center;
928
- justify-content: space-between;
929
- gap: 24px;
930
- width: 100%;
931
- min-height: 40px;
932
- padding: 0 10px;
933
- border: none;
934
- background: transparent;
935
- font: inherit;
936
- font-size: 12px;
937
- color: var(--tl-color-text-1);
938
- cursor: pointer;
939
- }
940
- /* 36px visual inset within the 40px row — the hover wash the action and emoji buttons use. */
941
- .tlui-cmt-menu-item::after {
942
- content: '';
943
- position: absolute;
944
- inset: 2px;
945
- border-radius: var(--tl-radius-2);
946
- }
947
- .tlui-cmt-menu-item:hover::after {
948
- background: var(--tl-color-muted-2);
949
- }
950
- /* Destructive menu entries (delete) — the same danger colour as tldraw's danger buttons. */
951
- .tlui-cmt-menu-item--danger {
952
- color: var(--tl-color-danger);
953
- }
954
-
955
- .tlui-cmt-menu-item__shortcut {
956
- color: var(--tl-color-text-3);
957
- font-size: 12px;
958
- }
959
896
  .tlui-cmt-list__items {
960
897
  flex: 1;
961
898
  min-height: 0;
962
899
  overflow-y: auto;
900
+ /* A row's hover wash has no bottom inset, so rows tile; this is the last row's 4px. */
901
+ padding-bottom: 4px;
963
902
  }
964
903
  .tlui-cmt-list__empty {
965
- padding: 20px 14px;
966
- color: var(--tl-color-text-3);
904
+ /* extra 2px at the bottom of the list */
905
+ padding: 12px 12px 14px 12px;
906
+ font-weight: 400;
967
907
  font-size: 12px;
908
+ min-height: 40px;
968
909
  }
969
910
  .tlui-cmt-list__item {
970
911
  position: relative;
971
912
  display: flex;
972
913
  gap: 10px;
973
914
  width: 100%;
974
- padding: 12px 14px;
915
+ /* No top padding: the 40px byline row supplies the space above the name, as on a thread card.
916
+ The 6px bottom matches the thread card text's trailing margin, so a row is as tall as a card. */
917
+ padding: 0 12px 6px;
975
918
  border: none;
976
- border-bottom: 1px solid var(--tl-color-divider);
977
919
  background: transparent;
978
920
  font: inherit;
979
921
  text-align: left;
@@ -987,7 +929,7 @@ button.tlui-cmt-reaction--active:hover {
987
929
  .tlui-cmt-list__item::after {
988
930
  content: '';
989
931
  position: absolute;
990
- inset: 4px;
932
+ inset: 4px 4px 0px 4px;
991
933
  border-radius: var(--tl-radius-2);
992
934
  pointer-events: none;
993
935
  }
@@ -1015,8 +957,8 @@ button.tlui-cmt-reaction--active:hover {
1015
957
  min-width: 0;
1016
958
  }
1017
959
  .tlui-cmt-list__item-preview {
1018
- margin-top: 2px;
1019
960
  font-size: 12px;
961
+ line-height: 1.4;
1020
962
  color: var(--tl-color-text-1);
1021
963
  overflow: hidden;
1022
964
  text-overflow: ellipsis;
@@ -1027,7 +969,6 @@ button.tlui-cmt-reaction--active:hover {
1027
969
  mid-string — same treatment as the card body. */
1028
970
  overflow-wrap: anywhere;
1029
971
  }
1030
- /* meta line under the preview: page label and/or a resolved marker */
1031
972
  .tlui-cmt-list__item-meta {
1032
973
  display: flex;
1033
974
  align-items: center;
@@ -1038,22 +979,30 @@ button.tlui-cmt-reaction--active:hover {
1038
979
  }
1039
980
  .tlui-cmt-list__item-resolved {
1040
981
  display: inline-flex;
982
+ flex-shrink: 0;
1041
983
  align-items: center;
1042
984
  gap: 3px;
1043
- font-weight: 600;
1044
985
  }
986
+ /* Block, not flex: an ellipsis only applies to text in a block container, not to a flex item's
987
+ anonymous text. */
1045
988
  .tlui-cmt-list__item-page {
1046
- display: inline-flex;
1047
- align-items: center;
989
+ display: block;
990
+ min-width: 0;
991
+ overflow: hidden;
992
+ text-overflow: ellipsis;
993
+ white-space: nowrap;
1048
994
  padding: 1px 6px;
1049
995
  border-radius: 4px;
1050
- background: var(--tl-color-muted-2);
996
+ }
997
+ /* Same alignment as the reactions row; only when it leads, since "Resolved" has no padding. */
998
+ .tlui-cmt-list__item-page:first-child {
999
+ margin-left: -6px;
1051
1000
  }
1052
1001
  .tlui-cmt-list__item-replies {
1053
1002
  display: inline-flex;
1003
+ flex-shrink: 0;
1054
1004
  align-items: center;
1055
1005
  }
1056
- /* reply count under a preview card's opening comment — the thread continues past what's shown */
1057
1006
  .tlui-cmt-card__replies {
1058
1007
  display: block;
1059
1008
  margin-top: 6px;
@@ -1124,10 +1073,6 @@ button.tlui-cmt-reaction--active:hover {
1124
1073
  outline: 2px solid var(--tl-color-selected);
1125
1074
  outline-offset: 2px;
1126
1075
  }
1127
- /* Focus should read like hover, so the pin lifts the same way when tabbed to. */
1128
- .tlui-cmt-canvas-pin__marker:focus-visible .tlui-cmt-marker {
1129
- transform: scale(var(--tlui-cmt-marker-hover-scale));
1130
- }
1131
1076
 
1132
1077
  .tlui-cmt-cluster-fade {
1133
1078
  opacity: 1;
@@ -1162,6 +1107,10 @@ button.tlui-cmt-reaction--active:hover {
1162
1107
  .tlui-cmt-canvas-pin--open {
1163
1108
  z-index: 1;
1164
1109
  }
1110
+ /* A pin being dragged rides over everything it passes, the open thread's pin included. */
1111
+ .tlui-cmt-canvas-pin--dragging {
1112
+ z-index: 2;
1113
+ }
1165
1114
 
1166
1115
  /* The count badge standing in for a stack of coincident pins — same face as a cluster badge,
1167
1116
  but clicking opens the stack's thread list rather than zooming (no zoom can separate them).
@@ -1182,7 +1131,6 @@ button.tlui-cmt-reaction--active:hover {
1182
1131
  .tlui-cmt-canvas-stack-badge:focus-visible .tlui-cmt-marker {
1183
1132
  outline: 2px solid var(--tl-color-selected);
1184
1133
  outline-offset: 2px;
1185
- transform: scale(var(--tlui-cmt-marker-hover-scale));
1186
1134
  }
1187
1135
 
1188
1136
  /* The stack's popover content: one card per thread, the expanded thread inline among them. */
@@ -1336,31 +1284,39 @@ button.tlui-cmt-reaction--active:hover {
1336
1284
  cursor: pointer;
1337
1285
  }
1338
1286
 
1339
- /* Every card surface that tints on hover — a collapsed thread in a stack list, a preview card, and
1340
- the single-comment preview panel. One rule, because they're the same object to the eye.
1341
-
1342
- The opaque low-surface token, not a translucent muted one: these float directly over the canvas,
1343
- where a translucent fill would let shapes show through.
1344
-
1345
- The second line is why this isn't a one-liner. `--tl-shadow-3` ends with a 1px *inset* ring in
1346
- `--tl-color-panel-contrast` — pure white in light mode — and an inset shadow paints over the
1347
- background. At rest that's invisible (the panel is 99% white under a 100% white ring), but tint
1348
- the background to grey and the ring stays white, hugging the edge as a pale outline. Re-tinting
1349
- `--tl-color-panel-contrast` here wouldn't reach it: `--tl-shadow-3` is declared on the container,
1350
- so its var() was already substituted there and the white is baked into what we inherit. Instead
1351
- lay a ring of the new surface over the old one — first shadow in the list paints on top. */
1287
+ /* Every card surface that highlights on hover — a collapsed thread in a stack list, a preview
1288
+ card, and the single-comment preview panel. One rule, because they're the same object to the eye.
1289
+ The highlight is an inset, rounded wash like a menu item's, not a tint of the whole surface: the
1290
+ card stays panel-white and a wash sits 4px inside its edge, its corners following the card's.
1291
+ It paints behind the content (`isolation` keeps the -1 z-index above the card's own fill). */
1292
+ .tlui-cmt-stack-list__card,
1293
+ .tlui-cmt-preview-card--selectable,
1294
+ .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable {
1295
+ position: relative;
1296
+ isolation: isolate;
1297
+ }
1298
+ .tlui-cmt-stack-list__card::after,
1299
+ .tlui-cmt-preview-card--selectable::after,
1300
+ .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable::after {
1301
+ content: '';
1302
+ position: absolute;
1303
+ inset: 4px;
1304
+ z-index: -1;
1305
+ /* The cards' 12px radius, less the inset. */
1306
+ border-radius: 8px;
1307
+ pointer-events: none;
1308
+ }
1309
+ .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable::after {
1310
+ border-radius: calc(var(--tl-radius-4) - 4px);
1311
+ }
1312
+ .tlui-cmt-stack-list__card:hover::after,
1313
+ .tlui-cmt-preview-card--selectable:hover::after,
1314
+ .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable:hover::after {
1315
+ background: var(--tl-color-muted-2);
1316
+ }
1352
1317
  .tlui-cmt-stack-list__card:hover,
1353
1318
  .tlui-cmt-preview-card--selectable:hover,
1354
1319
  .tlui-cmt-canvas-preview__panel--thread.tlui-cmt-canvas-preview__panel--selectable:hover {
1355
- --tlui-cmt-preview-hover-surface: color-mix(
1356
- in srgb,
1357
- var(--tl-color-low) 50%,
1358
- var(--tl-color-panel)
1359
- );
1360
- background: var(--tlui-cmt-preview-hover-surface);
1361
- box-shadow:
1362
- inset 0 0 0 1px var(--tlui-cmt-preview-hover-surface),
1363
- var(--tl-shadow-3);
1364
1320
  cursor: pointer;
1365
1321
  }
1366
1322
 
@@ -1404,23 +1360,45 @@ button.tlui-cmt-reaction--active:hover {
1404
1360
  .tlui-cmt-canvas-region {
1405
1361
  position: absolute;
1406
1362
  pointer-events: none;
1407
- border: 2px dashed var(--tl-color-selected);
1408
- border-radius: 6px;
1409
1363
  background: color-mix(in srgb, var(--tl-color-selected) 10%, transparent);
1410
1364
  }
1365
+ .tlui-cmt-canvas-region__outline {
1366
+ position: absolute;
1367
+ inset: 0;
1368
+ overflow: visible;
1369
+ fill: none;
1370
+ stroke: var(--tl-color-selection-stroke);
1371
+ stroke-width: 1.5px;
1372
+ stroke-linecap: round;
1373
+ }
1374
+
1375
+ .tlui-cmt-canvas-region-handles {
1376
+ display: contents;
1377
+ }
1411
1378
 
1412
- /* Corner resize handles on a region box (three corners; the pin corner is the move handle). */
1379
+ /* Corner resize handles on a region box (three corners; the pin corner is the move handle). The
1380
+ element is the hit square, sized from the selection's corner hit area (see
1381
+ `selectionCornerSizing`); the visible square is drawn like a selection corner: an 8px fill with a
1382
+ 1.5px stroke centred on its edge. */
1413
1383
  .tlui-cmt-canvas-region-handle {
1414
1384
  position: absolute;
1415
- width: 9px;
1416
- height: 9px;
1417
1385
  transform: translate(-50%, -50%);
1418
- background: var(--tl-color-panel);
1419
- border: 1.5px solid var(--tl-color-selected);
1420
- border-radius: 2px;
1421
1386
  pointer-events: auto;
1422
1387
  touch-action: none;
1423
1388
  }
1389
+ .tlui-cmt-canvas-region-handle::before {
1390
+ content: '';
1391
+ position: absolute;
1392
+ left: 50%;
1393
+ top: 50%;
1394
+ /* Not covered by the container's `*` border-box rule, which doesn't match pseudo-elements. */
1395
+ box-sizing: border-box;
1396
+ width: 9.5px;
1397
+ height: 9.5px;
1398
+ transform: translate(-50%, -50%);
1399
+ background: var(--tl-color-background);
1400
+ border: 1.5px solid var(--tl-color-selection-stroke);
1401
+ }
1424
1402
 
1425
1403
  /* Anchor the pin by its bottom-left corner, so the marker's one sharp corner (the pin shape's
1426
1404
  3px bottom-left) points at the exact anchor point. */
@@ -1552,14 +1530,20 @@ button.tlui-cmt-reaction--active:hover {
1552
1530
  .tlui-cmt-canvas-composer .tlui-cmt-input__placeholder {
1553
1531
  left: 12px;
1554
1532
  }
1555
- /* The draft avatar previews the pin it becomes — a white 28px pin holding the author's 22px avatar
1556
- circle — sharing the composer's lift. Not interactive: it drops the pin's pointer cursor and
1557
- hover affordances (scale + shadow bump), but keeps a 40×40 hit area (the ::after below). */
1533
+ /* The draft avatar previews the pin it becomes and is the draft's drag handle. It keeps a 40×40 hit
1534
+ area (the ::after below). */
1558
1535
  .tlui-cmt-canvas-composer .tlui-cmt-pin {
1559
1536
  position: relative;
1560
1537
  box-shadow: var(--tl-shadow-2);
1561
1538
  cursor: default;
1562
1539
  }
1540
+ .tlui-cmt-canvas-composer__handle {
1541
+ touch-action: none;
1542
+ }
1543
+ .tlui-cmt-canvas-composer--dragging .tlui-cmt-canvas-composer__handle,
1544
+ .tlui-cmt-canvas-composer--dragging .tlui-cmt-pin {
1545
+ cursor: var(--tl-cursor-move);
1546
+ }
1563
1547
  .tlui-cmt-canvas-composer .tlui-cmt-pin::after {
1564
1548
  content: '';
1565
1549
  position: absolute;