feat(ui-flow): emit mark-channel-read-cleared for desktop unread dismiss

Resolves parent channel id for threads before notifying desktop UI.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 09:36:40 -04:00
co-authored by Cursor
parent 85bc63ddbe
commit aaf8776229
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ Returns `false` for unknown types (caller may log).
| Boosts / stickers | `contribute-guild-boost`, `upsert-guild-sticker`, `upsert-sticker-pack` |
| Profile | `update-profile-cosmetics`, `set-profile-banner-image`, step-up PIN types |
| Voice / screen | `join-voice`, `join-voice-listen`, `join-stage`, `voice-capture-chunk`, `display-capture-frame` |
| Notifications | `mark-all-notifications-read` (emits `mark-all-notifications-read-cleared`, v0.8.283), `mark-notification-read` (emits `mark-notification-read-cleared`, v0.8.282), `refresh-notifications` (v0.8.236) |
| Notifications | `mark-all-notifications-read` (emits `mark-all-notifications-read-cleared`, v0.8.283), `mark-notification-read` (emits `mark-notification-read-cleared`, v0.8.282), `mark-channel-read` (emits `mark-channel-read-cleared`, v0.8.284), `refresh-notifications` (v0.8.236) |
| Workers | `export-integration-worker-script`, `run-worker-install-trial`, `announce-worker-release` |
| Moderation / channels | `ban-member`, `upsert-channel-overwrite`, forum/thread types |
| Search | `update-search`, `refresh-search`, `remove-search-recent` (v0.8.140) |
+9
View File
@@ -545,6 +545,15 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
if (guildId && msg.channelId) {
await platform.markChannelRead(msg.channelId, guildId)
pushState()
let dismissChannelId = msg.channelId
const channels = (await platform.guild?.listChannels?.()) || []
const ch = channels.find((c) => c.id === msg.channelId)
if (ch?.type === 'thread' && ch.parentId) dismissChannelId = ch.parentId
send({
type: 'mark-channel-read-cleared',
guildId,
channelId: dismissChannelId
})
}
return true
}