feat(ui-flow): composer focus after notif actions (Phase 444)

Route mark-notification-read through platform.markNotificationRead.
Send composer-focus-channel after mark-all and open-notification.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 19:59:54 -04:00
co-authored by Cursor
parent 236e7ca451
commit 159e584853
2 changed files with 15 additions and 6 deletions
+9 -2
View File
@@ -773,7 +773,7 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
return true
}
if (t === 'mark-notification-read') {
const row = await platform.notifications?.markRead(msg.notificationId)
const row = await platform.markNotificationRead(msg.notificationId)
pushState()
if (row?.channelId) {
let dismissChannelId = row.channelId
@@ -791,7 +791,7 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
}
if (t === 'open-notification') {
if (msg.notificationId) {
await platform.notifications?.markRead(msg.notificationId)
await platform.markNotificationRead(msg.notificationId)
}
const result = await platform.openNotificationTarget({
guildId: msg.guildId,
@@ -799,6 +799,10 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
messageId: msg.messageId
})
pushState()
const focusChannelId = result?.channelId || msg.channelId || platform.activeChannelId
if (focusChannelId) {
send({ type: 'composer-focus-channel', channelId: focusChannelId })
}
send({
type: 'open-notification-opened',
guildId: msg.guildId || platform.guild?.guild?.id || null,
@@ -1485,6 +1489,9 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
await platform.markAllNotificationsRead()
pushState()
send({ type: 'mark-all-notifications-read-cleared' })
if (platform.activeChannelId) {
send({ type: 'composer-focus-channel', channelId: platform.activeChannelId })
}
return true
}
if (t === 'refresh-notifications') {