add header threads attention menu#1572
Draft
tellaho wants to merge 2 commits into
Draft
Conversation
getTypingScopeId keyed typing entries on the reply parent tag, so an agent working deep in a thread produced a threadHeadId that matched no ingress row (and missed the open-thread composer filter). Typing and completion events already carry a root tag for nested replies — prefer it, falling back to the parent for direct replies where root === parent and no root tag is emitted. Both the registration and post-message suppression paths flow through the same helper, so suppression keys stay consistent. Exported for tests. Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Threads needing attention were hard to chase down inside a busy timeline, so the affordance moves to the channel header: a ReceiptText control left of the Users button, badged with the channel's unread-reply total, opening one combined list of unread and active threads. Selecting a row opens the thread panel scroll-focused on the thread head. - threadAttention.ts: pure derivation — merge unread counts with active threads (active first by start recency, then unread by reply recency), coarse Ns/Nm/Nh uptime formatter, single-line head previews. - useThreadAttention.ts: 'active' comes from thread-scoped bot typing; uptime anchors to a session-local first-seen map keyed on a stable active-set key, and rows are field-wise stabilized so busy-channel timeline churn never re-renders the header memo. - ChannelThreadsAttentionMenu.tsx: trigger + badge + combined list; the uptime tick mounts only while the menu is open. - handleOpenThreadFocused: non-toggle open + thread-head scroll target, so re-selecting an already-open thread refocuses instead of closing it. - Wired through ChannelScreenHeader/ChannelMembersBar in both inline and compact variants; DMs get the control (DMs are channels), forums are gated off since they render no thread panel. Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: new-feature
User Impact: Users can find unread or active threads from the channel header without scanning a busy chat timeline.
Problem: Thread-level attention was too hard to parse when it lived inline with busy message rows. Users need a higher-level, repeatable shortcut for chasing unread or currently active threads across channels.
Solution: Add a
ReceiptTextheader control beside the members action that opens one combined attention list. The badge counts unread replies only, while the dropdown merges unread and active threads and opens the selected thread directly with focus on the thread head.File changes
desktop/src/features/channels/lib/threadAttention.ts
Adds pure derivation for the combined unread/active thread rows, badge total, row equality, preview collapsing, and coarse uptime formatting.
desktop/src/features/channels/lib/threadAttention.test.mjs
Covers row merging, sorting, unread totals, equality stabilization, preview behavior, and
Ns/Nm/Nhuptime formatting.desktop/src/features/channels/ui/ChannelThreadsAttentionMenu.tsx
Adds the header dropdown UI with the
ReceiptTexttrigger, unread badge, combined attention rows, unread pills, and active uptime pills.desktop/src/features/channels/ui/useThreadAttention.ts
Derives attention rows from thread unread counts, loaded timeline summaries, and thread-scoped bot typing while stabilizing row references for busy channels.
desktop/src/features/channels/ui/ChannelMembersBar.tsx
Places the new thread attention control immediately before the members/users affordance in inline headers and before the compact actions menu in compact headers.
desktop/src/features/channels/ui/ChannelScreenHeader.tsx
Passes thread attention data and selection callbacks from the channel screen into the header actions.
desktop/src/features/channels/ui/ChannelScreen.tsx
Wires the attention derivation into the channel header, includes DMs via the existing header path, and gates forums because they do not have the thread panel destination.
desktop/src/features/channels/useChannelPaneHandlers.ts
Adds a non-toggle thread-open path so selecting a dropdown item always opens and refocuses the thread instead of closing an already-open thread.
desktop/src/features/messages/useChannelTyping.ts
Scopes nested thread typing to the thread root rather than the immediate reply parent so active-thread detection aligns with thread heads.
desktop/src/features/messages/useChannelTyping.test.mjs
Adds coverage for channel-scoped typing, direct thread replies, and nested thread replies.
Reproduction Steps
ReceiptTextcontrol appears and its badge reflects unread thread replies only.45s,3m, or2h.Screenshots/Demos
Not captured in this pass; this should get a manual click-through before merge because the navigation path was validated by code path and tests, not live app interaction.
Validation
pnpm test -- src/features/channels/lib/threadAttention.test.mjs src/features/messages/useChannelTyping.test.mjsfromdesktop/— full suite passed: 1944/1944pnpm typecheckfromdesktop/— passedpnpm checkfromdesktop/— passedNotes for reviewers
N replieswithout author/preview, but unread count and navigation still work.