feat(voice): composer focus after join and leave voice IPC

Phase 524 restores text channel composer autofocus when voice state changes, matching messaging and reaction handlers.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 11:16:43 -04:00
co-authored by Cursor
parent 8e2cc7e85f
commit 7fdb7e1aff
2 changed files with 20 additions and 0 deletions
+2
View File
@@ -2,6 +2,8 @@
Pearcord desktop UI IPC dispatch and automated flow scenarios for Bare smokes. Mirrors `apps/pearcord` pear-pipe message handling.
**v0.8.487 (Phase 524):** `join-voice`, `join-voice-listen`, and `leave-voice` emit `composer-focus-channel` when `platform.activeChannelId` is set (guild mode), matching messaging/reaction focus behavior. Bundle: `npm run test:phase524-voice` (app repo).
## Mission
Centralize the `msg.type``platform.*` routing table used by the Pear UI sidecar so smoke tests and tooling can drive the full platform surface without duplicating hundreds of if-branches in the app entrypoint.
+18
View File
@@ -573,6 +573,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
try {
await platform.joinVoiceChannel(msg.channelId)
pushState()
if (platform.activeChannelId && platform.mode === 'guild') {
send({
type: 'composer-focus-channel',
channelId: platform.activeChannelId
})
}
} catch (err) {
const errMsg = err?.message || String(err)
if (/voice channel is full/i.test(errMsg)) {
@@ -591,6 +597,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
try {
await platform.joinVoiceListenOnly(msg.channelId)
pushState()
if (platform.activeChannelId && platform.mode === 'guild') {
send({
type: 'composer-focus-channel',
channelId: platform.activeChannelId
})
}
} catch (err) {
const errMsg = err?.message || String(err)
if (/voice channel is full/i.test(errMsg)) {
@@ -612,6 +624,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
if (!payload) {
log.debug('leave-voice noop', { reason: 'not in voice channel' })
}
if (platform.activeChannelId && platform.mode === 'guild') {
send({
type: 'composer-focus-channel',
channelId: platform.activeChannelId
})
}
return true
}
if (t === 'start-screen-share') {