Commit abfa9f5
authored
feat(dotcom): rework the manage workspace dialog (tldraw#9168)
In order to give workspace owners a clearer place to manage their
workspace, this PR reworks the "Workspace settings" dialog into a tabbed
"Manage workspace" dialog and adds an enable/disable toggle for the
invite link. Follow-up to tldraw#9106; closes tldraw#9131.
The dialog now has a shared header (name + invite link) above two tabs:
- **Members** — each member shows a role dropdown; owners can change
roles or remove members. Your own row's action is **Leave**; it (and
removing the last owner) is disabled with a tooltip when it would leave
the workspace without an owner.
- **Settings** (owners only) — enable/disable the invite link,
regenerate it, leave, or delete the workspace.
Other changes:
- **Capabilities** — the per-action capabilities (`manageInvites`,
`editMembers`, `editWorkspace`, `deleteWorkspace`) are consolidated into
a single owner-only `manageWorkspace`. Members can no longer manage the
invite link, roles, name, or deletion.
- **Invite link toggle** — like file sharing, turning the link off
*keeps* it (so it can be turned back on) rather than clearing it. Backed
by a `group.inviteLinkEnabled` column (migration 035), a mutator, and
gating on the invite-accept path; the user durable-object state version
is bumped so clients refetch.
- **SDK dialog fix** — `TldrawUiDialog` now closes on a backdrop click
only when the press both starts and ends on the overlay, and no longer
auto-dismisses when a portaled popover opened inside it (e.g. a Select)
is used. Without this, opening/dismissing the role dropdown tore down
the whole dialog.
https://github.com/user-attachments/assets/a9571f8d-546f-42b6-add7-eee1cfdca956
### Change type
- [x] `feature`
### Test plan
1. As an **owner**, open Manage workspace → **Members**: every member
has a role dropdown; your own row's dropdown has "Leave" (disabled with
a tooltip if you're the only owner), other members have "Remove".
2. **Settings** tab: toggle "Enable invite link" off → the copy button
becomes a disabled "Invites are disabled"; toggle on → the same link
returns. Regenerate / Leave / Delete each open a confirm dialog
(descriptive title, short action button).
3. As a **member**: roles are read-only, your own row offers "Leave",
and there's no settings management.
4. Open a role dropdown, then click elsewhere in the dialog or on the
backdrop: the dropdown closes; the dialog only closes on a deliberate
backdrop click (and Escape).
- [x] Unit tests
- [ ] End to end tests
### Release notes
- Fix a dialog unexpectedly closing when a popover (e.g. a select)
opened inside it is dismissed.
### Code changes
| Section | LOC change |
| --------------- | ----------- |
| Core code | +64 / -39 |
| Tests | +90 / -15 |
| Automated files | +102 / -75 |
| Apps | +373 / -302 |1 parent 81ec91f commit abfa9f5
19 files changed
Lines changed: 620 additions & 457 deletions
File tree
- apps/dotcom
- client
- e2e
- fixtures
- tests
- public/tla
- locales-compiled
- locales
- src/tla/components
- dialogs
- sync-worker/src
- utils/tla
- zero-cache/migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
487 | 488 | | |
488 | | - | |
489 | | - | |
| 489 | + | |
| 490 | + | |
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
495 | | - | |
496 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
497 | 499 | | |
498 | | - | |
499 | | - | |
500 | | - | |
| 500 | + | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
504 | | - | |
| 503 | + | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
| 563 | + | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
257 | 255 | | |
258 | | - | |
259 | | - | |
260 | | - | |
| 256 | + | |
| 257 | + | |
261 | 258 | | |
| 259 | + | |
262 | 260 | | |
263 | | - | |
264 | | - | |
265 | | - | |
| 261 | + | |
| 262 | + | |
266 | 263 | | |
267 | | - | |
268 | | - | |
| 264 | + | |
269 | 265 | | |
270 | | - | |
271 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
275 | 280 | | |
276 | | - | |
| 281 | + | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
284 | | - | |
| 292 | + | |
285 | 293 | | |
286 | | - | |
| 294 | + | |
287 | 295 | | |
288 | 296 | | |
289 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| |||
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
180 | 192 | | |
181 | 193 | | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
186 | 204 | | |
187 | 205 | | |
188 | 206 | | |
| |||
261 | 279 | | |
262 | 280 | | |
263 | 281 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 282 | | |
271 | 283 | | |
272 | 284 | | |
| |||
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | 348 | | |
343 | 349 | | |
344 | 350 | | |
| |||
409 | 415 | | |
410 | 416 | | |
411 | 417 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
598 | 604 | | |
599 | 605 | | |
600 | 606 | | |
| |||
775 | 781 | | |
776 | 782 | | |
777 | 783 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
906 | 912 | | |
907 | 913 | | |
908 | 914 | | |
| |||
973 | 979 | | |
974 | 980 | | |
975 | 981 | | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
976 | 988 | | |
977 | 989 | | |
978 | 990 | | |
| |||
1003 | 1015 | | |
1004 | 1016 | | |
1005 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1006 | 1032 | | |
1007 | 1033 | | |
1008 | 1034 | | |
1009 | 1035 | | |
1010 | 1036 | | |
1011 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1012 | 1044 | | |
1013 | 1045 | | |
1014 | 1046 | | |
| |||
1061 | 1093 | | |
1062 | 1094 | | |
1063 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1064 | 1102 | | |
1065 | 1103 | | |
1066 | 1104 | | |
| |||
1129 | 1167 | | |
1130 | 1168 | | |
1131 | 1169 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | 1170 | | |
1139 | 1171 | | |
1140 | 1172 | | |
| |||
1259 | 1291 | | |
1260 | 1292 | | |
1261 | 1293 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | 1294 | | |
1269 | 1295 | | |
1270 | 1296 | | |
| |||
1301 | 1327 | | |
1302 | 1328 | | |
1303 | 1329 | | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | 1330 | | |
1311 | 1331 | | |
1312 | 1332 | | |
| |||
1369 | 1389 | | |
1370 | 1390 | | |
1371 | 1391 | | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | 1392 | | |
1379 | 1393 | | |
1380 | 1394 | | |
| |||
0 commit comments