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:
Raven Scott
2026-06-01 21:00:56 -04:00
co-authored by Cursor
parent 83ac611ea6
commit 84d02713f5
+15 -1
View File
@@ -1288,7 +1288,21 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
return true
}
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()
return true
}