Commit 1602097
Add Slack DM recipient picker (user-message mount model) (#156)
* Add Slack DM recipient picker (user-message mount model)
Make 1:1 Slack DMs a first-class, selectable Pear source using the canonical
user-recipient model `/slack/users/<U>/messages` (bare Slack user ids). This is
the Pear/UI-mount layer of the comprehensive DM build; it pairs with the
relayfile adapter D→U materialization and Cloud token/options wiring.
- New `SlackDmRecipientPicker` (reuses `GenericScopePicker`): consumes Cloud
`users` options and emits concrete `/slack/users/<U>/messages` mount paths.
- `GenericScopePicker` gains `defaultSelectAll` (default true; preserves channel
behavior). DM picker sets it false so a fresh picker mounts NO one's DMs by
default — readability requires explicitly selecting recipients.
- `ProjectSettings`: separate channel vs DM pending scope state, merged into one
`mountPaths` via `mergeSlackScopeMountPaths` (each half preserved when the
other changes; discovery paths kept). `listenDms` stays watch-only with copy
clarifying it observes events; recipients must be chosen to read/send DMs.
- Demote the vestigial `/slack/dms/*` event watch glob — no adapter resource or
record ever materialized there. Canonical DM watch is
`/slack/users/*/messages/**`; `/slack/channels/D*` stays diagnostic-only.
- Bare `U…`/`W…` ids only; never suffixed `U…__slug` (adapter writeback and
Cloud scope aliasing only bridge channel suffixes today).
Tests: `slack-scope.test.ts` (helpers + mount-path merge) and an
`integration-event-bridge` glob test asserting the user-message watch is canonical
and `/slack/dms/*` is dropped. Source-only; no rebuild of the running instance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Clear pendingDmScopeValue on scope-editor toggle (review fix)
The scope-editor open/close toggle reset pendingScopeValue + pendingSlackListenDms
but not the new pendingDmScopeValue, so an unsaved DM-recipient selection could
survive closing the editor and be applied on a later Save for the same or another
Slack integration. Clear it in the toggle handler alongside the other pending
state (Cancel and save-success paths already cleared it).
Reported by event-path-codex on PR #156.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore: apply pr-reviewer fixes for #156
* chore: apply pr-reviewer fixes for #156
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: agent-relay-code[bot] <agent-relay-code[bot]@users.noreply.github.com>1 parent c660556 commit 1602097
8 files changed
Lines changed: 376 additions & 9 deletions
File tree
- src
- main
- __tests__
- renderer/src/components/settings
- scope-pickers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
309 | 333 | | |
310 | 334 | | |
311 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | | - | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
480 | 486 | | |
481 | 487 | | |
482 | 488 | | |
483 | | - | |
| 489 | + | |
484 | 490 | | |
485 | 491 | | |
486 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
385 | 391 | | |
386 | 392 | | |
387 | 393 | | |
| 394 | + | |
388 | 395 | | |
389 | 396 | | |
390 | 397 | | |
| |||
634 | 641 | | |
635 | 642 | | |
636 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
637 | 661 | | |
638 | 662 | | |
639 | 663 | | |
| |||
642 | 666 | | |
643 | 667 | | |
644 | 668 | | |
| 669 | + | |
645 | 670 | | |
646 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
647 | 681 | | |
648 | 682 | | |
649 | 683 | | |
| |||
652 | 686 | | |
653 | 687 | | |
654 | 688 | | |
655 | | - | |
| 689 | + | |
656 | 690 | | |
657 | 691 | | |
658 | 692 | | |
| |||
661 | 695 | | |
662 | 696 | | |
663 | 697 | | |
| 698 | + | |
664 | 699 | | |
665 | 700 | | |
666 | 701 | | |
667 | 702 | | |
668 | 703 | | |
669 | 704 | | |
670 | | - | |
| 705 | + | |
671 | 706 | | |
672 | 707 | | |
673 | 708 | | |
| |||
729 | 764 | | |
730 | 765 | | |
731 | 766 | | |
| 767 | + | |
732 | 768 | | |
733 | | - | |
| 769 | + | |
734 | 770 | | |
735 | 771 | | |
736 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
737 | 780 | | |
738 | 781 | | |
739 | 782 | | |
| |||
773 | 816 | | |
774 | 817 | | |
775 | 818 | | |
| 819 | + | |
776 | 820 | | |
777 | 821 | | |
778 | 822 | | |
| |||
879 | 923 | | |
880 | 924 | | |
881 | 925 | | |
882 | | - | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
883 | 929 | | |
884 | 930 | | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
885 | 940 | | |
886 | 941 | | |
887 | 942 | | |
888 | 943 | | |
889 | 944 | | |
890 | 945 | | |
891 | 946 | | |
| 947 | + | |
892 | 948 | | |
893 | 949 | | |
894 | 950 | | |
| |||
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| 119 | + | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
129 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| |||
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
156 | | - | |
| 165 | + | |
157 | 166 | | |
158 | 167 | | |
| 168 | + | |
159 | 169 | | |
160 | 170 | | |
161 | 171 | | |
| |||
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| 194 | + | |
| 195 | + | |
184 | 196 | | |
185 | 197 | | |
186 | 198 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
0 commit comments