feat(ui-flow): wire archive-thread IPC with composer focus
Emit thread-archive-result after archive/unarchive so the UI can toast and refocus the composer on the parent channel. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1288,7 +1288,21 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (t === 'archive-thread') {
|
if (t === 'archive-thread') {
|
||||||
await platform.archiveThread(msg.threadId, msg.archived !== false)
|
const archived = msg.archived !== false
|
||||||
|
const merged = await platform.archiveThread(msg.threadId, archived)
|
||||||
|
if (platform.mode === 'guild' && platform.activeChannelId) {
|
||||||
|
send({
|
||||||
|
type: 'composer-focus-channel',
|
||||||
|
channelId: platform.activeChannelId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
send({
|
||||||
|
type: 'thread-archive-result',
|
||||||
|
threadId: msg.threadId,
|
||||||
|
archived,
|
||||||
|
channelName: merged?.name || null,
|
||||||
|
compacted: archived
|
||||||
|
})
|
||||||
pushState()
|
pushState()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user