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:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Pearcord desktop UI IPC dispatch and automated flow scenarios for Bare smokes. Mirrors `apps/pearcord` pear-pipe message handling.
|
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
|
## 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.
|
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.
|
||||||
|
|||||||
@@ -573,6 +573,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
try {
|
try {
|
||||||
await platform.joinVoiceChannel(msg.channelId)
|
await platform.joinVoiceChannel(msg.channelId)
|
||||||
pushState()
|
pushState()
|
||||||
|
if (platform.activeChannelId && platform.mode === 'guild') {
|
||||||
|
send({
|
||||||
|
type: 'composer-focus-channel',
|
||||||
|
channelId: platform.activeChannelId
|
||||||
|
})
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errMsg = err?.message || String(err)
|
const errMsg = err?.message || String(err)
|
||||||
if (/voice channel is full/i.test(errMsg)) {
|
if (/voice channel is full/i.test(errMsg)) {
|
||||||
@@ -591,6 +597,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
try {
|
try {
|
||||||
await platform.joinVoiceListenOnly(msg.channelId)
|
await platform.joinVoiceListenOnly(msg.channelId)
|
||||||
pushState()
|
pushState()
|
||||||
|
if (platform.activeChannelId && platform.mode === 'guild') {
|
||||||
|
send({
|
||||||
|
type: 'composer-focus-channel',
|
||||||
|
channelId: platform.activeChannelId
|
||||||
|
})
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errMsg = err?.message || String(err)
|
const errMsg = err?.message || String(err)
|
||||||
if (/voice channel is full/i.test(errMsg)) {
|
if (/voice channel is full/i.test(errMsg)) {
|
||||||
@@ -612,6 +624,12 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
if (!payload) {
|
if (!payload) {
|
||||||
log.debug('leave-voice noop', { reason: 'not in voice channel' })
|
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
|
return true
|
||||||
}
|
}
|
||||||
if (t === 'start-screen-share') {
|
if (t === 'start-screen-share') {
|
||||||
|
|||||||
Reference in New Issue
Block a user