* Send a mode change message to a single teammate * Also updates config.json directly so the UI reflects the change immediately
(teammateName: string, teamName: string, targetMode: PermissionMode)
| 643 | * Also updates config.json directly so the UI reflects the change immediately |
| 644 | */ |
| 645 | function sendModeChangeToTeammate(teammateName: string, teamName: string, targetMode: PermissionMode): void { |
| 646 | // Update config.json directly so UI shows the change immediately |
| 647 | setMemberMode(teamName, teammateName, targetMode); |
| 648 | |
| 649 | // Also send message so teammate updates their local permission context |
| 650 | const message = createModeSetRequestMessage({ |
| 651 | mode: targetMode, |
| 652 | from: 'team-lead' |
| 653 | }); |
| 654 | void writeToMailbox(teammateName, { |
| 655 | from: 'team-lead', |
| 656 | text: jsonStringify(message), |
| 657 | timestamp: new Date().toISOString() |
| 658 | }, teamName); |
| 659 | logForDebugging(`[TeamsDialog] Sent mode change to ${teammateName}: ${targetMode}`); |
| 660 | } |
| 661 | |
| 662 | /** |
| 663 | * Cycle a single teammate's mode |
no test coverage detected