From 4f554b6385065b698db819498a6f359b17a45459 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Wed, 26 Aug 2026 12:59:14 -0700 Subject: [PATCH] feat(sidebar): prioritize unread DMs in overflow navigation (#6842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Category:** improvement **User Impact:** Users can see which unread direct messages are waiting offscreen and jump to the most relevant one first. **Problem:** The sidebar overflow control treated every offscreen unread conversation alike, so an unread DM could be hidden behind channel activity with no visible clue about who was waiting. **Solution:** Prioritize the first offscreen unread DM, preview up to three senders with avatars, and keep the arrow, avatars, separator, and message count intact while only the trailing phrase truncates in narrow sidebars.
File changes **desktop/src/features/sidebar/lib/useUnreadOverflow.ts** Adds ordered DM preview data to unread-overflow calculations while preserving the sidebar's existing visibility and direction rules. **desktop/src/features/sidebar/lib/useUnreadOverflow.test.mjs** Covers DM prioritization, ordering, offscreen filtering, and channel-only fallback behavior. **desktop/src/features/sidebar/ui/AppSidebar.tsx** Passes unread DM previews into the lower overflow control and navigates to the preferred DM before the next unread channel. **desktop/src/features/sidebar/ui/MoreUnreadButton.tsx** Renders the frontmost-first avatar stack, accessible DM target label, middot separator, and message-count treatment. **desktop/src/features/sidebar/ui/MoreUnreadButton.test.mjs** Locks the three-avatar cap, stacking order, preferred target, fallback, accessible copy, and truncation structure. **desktop/src/shared/ui/UnreadPill.tsx** Contains the primary pill and allows only its trailing label to ellipsize under width pressure. **desktop/src/shared/ui/UserAvatar.tsx** Allows the sidebar preview stack to identify each rendered avatar in regression coverage.
## Reproduction steps 1. Open enough sidebar conversations that unread items fall below the visible area. 2. Leave one or more offscreen DMs unread, along with unread channels. 3. Confirm the bottom overflow pill shows up to three overlapping DM avatars followed by a middot and the total new-message count. 4. Select the pill and confirm it navigates to the first offscreen unread DM rather than the nearest unread channel. 5. Resize the sidebar from 420px through 300px to 220px and confirm the arrow, avatars, middot, and full numeric count remain visible; only `new messages` may ellipsize. 6. Repeat with channel-only unread overflow and confirm the control keeps its channel fallback behavior without avatars. ## Screenshots Built-UI matrix with 100px of visible space beyond the sidebar edge. All images are hosted through `pr-screenshots`. | State | 220px min | 300px default | 420px max | Result | | --- | --- | --- | --- | --- | | Channel-only · 13 | ![Channel-only · 13 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/01.png) | ![Channel-only · 13 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/02.png) | ![Channel-only · 13 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/03.png) | Full label throughout. | | Channel-only · 999 | ![Channel-only · 999 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/04.png) | ![Channel-only · 999 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/05.png) | ![Channel-only · 999 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/06.png) | Full label throughout. | | One DM only · 1 | ![One DM only · 1 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/07.png) | ![One DM only · 1 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/08.png) | ![One DM only · 1 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/09.png) | Full label throughout. | | One DM + channels · 99 | ![One DM + channels · 99 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/10.png) | ![One DM + channels · 99 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/11.png) | ![One DM + channels · 99 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/12.png) | Full label throughout. | | Two DMs only · 2 | ![Two DMs only · 2 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/13.png) | ![Two DMs only · 2 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/14.png) | ![Two DMs only · 2 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/15.png) | Full label throughout. | | Two DMs + channels · 47 | ![Two DMs + channels · 47 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/16.png) | ![Two DMs + channels · 47 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/17.png) | ![Two DMs + channels · 47 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/18.png) | Full label throughout. | | Three DMs + channels · 128 | ![Three DMs + channels · 128 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/19.png) | ![Three DMs + channels · 128 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/20.png) | ![Three DMs + channels · 128 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/21.png) | 220px: `128 new messa…`; full at 300/420. | | Three DMs + channels · 999 | ![Three DMs + channels · 999 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/22.png) | ![Three DMs + channels · 999 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/23.png) | ![Three DMs + channels · 999 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/24.png) | 220px: `999 new mess…`; full at 300/420. | | Three DMs + channels · 9,999 | ![Three DMs + channels · 9,999 at 220px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/25.png) | ![Three DMs + channels · 9,999 at 300px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/26.png) | ![Three DMs + channels · 9,999 at 420px](https://d24qwcpro867f5.cloudfront.net/repos/buzz/prs/6842/27.png) | 220px: `9,999 new mes…`; full at 300/420. | **Matrix result:** 27/27 states remain contained. Exactly 3/27 states ellipsize—all are three-avatar cases at 220px. The arrow, all avatars, middot, and complete numeric value remain visible; only the trailing `new messages` phrase yields. ## Validation - Desktop unit suite: 5,517 passed - TypeScript: passed - Biome on all seven changed files: passed - Pre-push desktop checks, typecheck, tests, file-size, and branch-skew gates: passed - 27-state built-UI matrix capture: 27/27 contained; only the three 220px three-avatar states truncate, and only the trailing phrase - `git diff --check`: passed --------- Signed-off-by: Taylor Ho Co-authored-by: Carl Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> --- .../useOffscreenActivityChannelIds.test.mjs | 14 ++ .../sidebar/lib/useSidebarActivityOverflow.ts | 2 + .../sidebar/lib/useUnreadOverflow.test.mjs | 66 ++++++++ .../features/sidebar/lib/useUnreadOverflow.ts | 82 +++++++-- .../src/features/sidebar/ui/AppSidebar.tsx | 63 ++++++- .../sidebar/ui/MoreUnreadButton.test.mjs | 158 ++++++++++++++++++ .../features/sidebar/ui/MoreUnreadButton.tsx | 99 ++++++++++- desktop/src/shared/ui/UnreadPill.tsx | 14 +- desktop/src/shared/ui/UserAvatar.tsx | 1 + 9 files changed, 473 insertions(+), 26 deletions(-) create mode 100644 desktop/src/features/sidebar/lib/useUnreadOverflow.test.mjs create mode 100644 desktop/src/features/sidebar/ui/MoreUnreadButton.test.mjs diff --git a/desktop/src/features/sidebar/lib/useOffscreenActivityChannelIds.test.mjs b/desktop/src/features/sidebar/lib/useOffscreenActivityChannelIds.test.mjs index d548b7e502..34f696aa51 100644 --- a/desktop/src/features/sidebar/lib/useOffscreenActivityChannelIds.test.mjs +++ b/desktop/src/features/sidebar/lib/useOffscreenActivityChannelIds.test.mjs @@ -26,6 +26,20 @@ test("keeps every unread channel navigable while adding working activity", () => ]); }); +test("keeps working-only channels out of message overflow prioritization", () => { + const activity = getOffscreenActivityChannelIds({ + activeWorkingByChannelId: new Map([["read-working-dm", {}]]), + previewActivityChannelIds: new Set(), + unreadChannelIds: new Set(["unread-channel"]), + }); + + assert.deepEqual([...activity.messageChannelIds], ["unread-channel"]); + assert.deepEqual( + [...activity.channelIds], + ["unread-channel", "read-working-dm"], + ); +}); + test("uses an activity-neutral overflow label when work contributes", () => { assert.equal( getSidebarActivityOverflowLabel({ activityCount: 2, messageCount: 1 }), diff --git a/desktop/src/features/sidebar/lib/useSidebarActivityOverflow.ts b/desktop/src/features/sidebar/lib/useSidebarActivityOverflow.ts index c194ed9cff..2dac012bca 100644 --- a/desktop/src/features/sidebar/lib/useSidebarActivityOverflow.ts +++ b/desktop/src/features/sidebar/lib/useSidebarActivityOverflow.ts @@ -33,6 +33,8 @@ export function useSidebarActivityOverflow({ return { ...activityOverflow, + unreadMessageAboveChannelIds: messageOverflow.unreadAboveChannelIds, + unreadMessageBelowChannelIds: messageOverflow.unreadBelowChannelIds, unreadAboveLabel: getSidebarActivityOverflowLabel({ activityCount: activityOverflow.unreadAboveCount, messageCount: messageOverflow.unreadAboveCount, diff --git a/desktop/src/features/sidebar/lib/useUnreadOverflow.test.mjs b/desktop/src/features/sidebar/lib/useUnreadOverflow.test.mjs new file mode 100644 index 0000000000..2d1c1d53ad --- /dev/null +++ b/desktop/src/features/sidebar/lib/useUnreadOverflow.test.mjs @@ -0,0 +1,66 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; + +import { deriveUnreadOverflow } from "./useUnreadOverflow.ts"; + +const root = { + getBoundingClientRect: () => ({ height: 100, top: 50 }), +}; + +function entry(channelId, top, isIntersecting = false) { + return { + element: { + getAttribute: (name) => (name === "data-channel-id" ? channelId : null), + getBoundingClientRect: () => ({ top }), + }, + isIntersecting, + }; +} + +describe("deriveUnreadOverflow", () => { + it("orders offscreen channels by position", () => { + const result = deriveUnreadOverflow( + [ + entry("below-2", 180), + entry("above-2", 0), + entry("below-1", 160), + entry("above-1", 20), + ], + root, + ); + + assert.deepEqual(result.unreadAboveChannelIds, ["above-1", "above-2"]); + assert.deepEqual(result.unreadBelowChannelIds, ["below-1", "below-2"]); + assert.equal(result.unreadAboveCount, 2); + assert.equal(result.unreadBelowCount, 2); + }); + + it("deduplicates repeated sidebar rows for the same channel", () => { + const result = deriveUnreadOverflow( + [entry("starred", 170), entry("starred", 240)], + root, + ); + + assert.deepEqual(result.unreadBelowChannelIds, ["starred"]); + assert.equal(result.unreadBelowCount, 1); + }); + + it("does not count a duplicate row when the same channel is visible", () => { + const result = deriveUnreadOverflow( + [entry("starred", 80, true), entry("starred", 240)], + root, + ); + + assert.deepEqual(result.unreadBelowChannelIds, []); + assert.equal(result.unreadBelowCount, 0); + }); + + it("ignores visible rows", () => { + const result = deriveUnreadOverflow( + [entry("visible", 80, true), entry("below", 180)], + root, + ); + + assert.deepEqual(result.unreadBelowChannelIds, ["below"]); + }); +}); diff --git a/desktop/src/features/sidebar/lib/useUnreadOverflow.ts b/desktop/src/features/sidebar/lib/useUnreadOverflow.ts index 93baa34531..18f5a992ec 100644 --- a/desktop/src/features/sidebar/lib/useUnreadOverflow.ts +++ b/desktop/src/features/sidebar/lib/useUnreadOverflow.ts @@ -10,11 +10,15 @@ type UnreadDirection = "above" | "below"; type UnreadOverflowCounts = { unreadAboveCount: number; unreadBelowCount: number; + unreadAboveChannelIds: string[]; + unreadBelowChannelIds: string[]; }; const EMPTY_COUNTS: UnreadOverflowCounts = { unreadAboveCount: 0, unreadBelowCount: 0, + unreadAboveChannelIds: [], + unreadBelowChannelIds: [], }; function getChannelId(element: Element): string | null { @@ -71,34 +75,65 @@ function findNextUnreadElement({ return nextElement; } -function deriveCounts( - visibilityById: Map, +export function deriveUnreadOverflow( + entries: Iterable, root: HTMLDivElement, ): UnreadOverflowCounts { - let unreadAboveCount = 0; - let unreadBelowCount = 0; - + const unreadAbove = new Map(); + const unreadBelow = new Map(); + const visibleChannelIds = new Set(); const rootHeight = root.getBoundingClientRect().height; - for (const entry of visibilityById.values()) { + for (const entry of entries) { + const channelId = getChannelId(entry.element); + if (!channelId) continue; + if (entry.isIntersecting) { + visibleChannelIds.add(channelId); + continue; + } + const top = getRelativeTop(entry.element, root); - if (entry.isIntersecting) continue; - if (top < 0) { - unreadAboveCount += 1; + unreadAbove.set( + channelId, + Math.max(unreadAbove.get(channelId) ?? -Infinity, top), + ); } else if (top > rootHeight) { - unreadBelowCount += 1; + unreadBelow.set( + channelId, + Math.min(unreadBelow.get(channelId) ?? Infinity, top), + ); } } - return { unreadAboveCount, unreadBelowCount }; + for (const channelId of visibleChannelIds) { + unreadAbove.delete(channelId); + unreadBelow.delete(channelId); + } + + const byPosition = (left: [string, number], right: [string, number]) => + left[1] - right[1]; + const unreadAboveChannelIds = [...unreadAbove.entries()] + .sort((left, right) => byPosition(right, left)) + .map(([channelId]) => channelId); + const unreadBelowChannelIds = [...unreadBelow.entries()] + .sort(byPosition) + .map(([channelId]) => channelId); + + return { + unreadAboveCount: unreadAboveChannelIds.length, + unreadBelowCount: unreadBelowChannelIds.length, + unreadAboveChannelIds, + unreadBelowChannelIds, + }; } export function useUnreadOverflow(args: { scrollRef: React.RefObject; unreadChannelIds: ReadonlySet; }): UnreadOverflowCounts & { + scrollToChannel: (channelId: string) => void; scrollToNextAbove: () => void; scrollToNextBelow: () => void; } { @@ -117,15 +152,15 @@ export function useUnreadOverflow(args: { } let intersectionObserver: IntersectionObserver | null = null; - const visibilityById = new Map(); + const visibilityByElement = new Map(); const updateCounts = () => { - setCounts(deriveCounts(visibilityById, root)); + setCounts(deriveUnreadOverflow(visibilityByElement.values(), root)); }; const bindUnreadRows = () => { intersectionObserver?.disconnect(); - visibilityById.clear(); + visibilityByElement.clear(); intersectionObserver = new IntersectionObserver( (entries) => { @@ -135,8 +170,9 @@ export function useUnreadOverflow(args: { continue; } - visibilityById.set(channelId, { - element: entry.target as HTMLElement, + const element = entry.target as HTMLElement; + visibilityByElement.set(element, { + element, isIntersecting: entry.isIntersecting, }); } @@ -150,7 +186,7 @@ export function useUnreadOverflow(args: { const channelId = getChannelId(element); if (!channelId) continue; - visibilityById.set(channelId, { + visibilityByElement.set(element, { element, isIntersecting: false, }); @@ -192,8 +228,20 @@ export function useUnreadOverflow(args: { })?.scrollIntoView({ behavior: "smooth", block: "center" }); }, [scrollRef]); + const scrollToChannel = React.useCallback( + (channelId: string) => { + const root = scrollRef.current; + if (!root) return; + getUnreadElements(root, unreadChannelIdsRef.current) + .find((element) => getChannelId(element) === channelId) + ?.scrollIntoView({ behavior: "smooth", block: "center" }); + }, + [scrollRef], + ); + return { ...counts, + scrollToChannel, scrollToNextAbove, scrollToNextBelow, }; diff --git a/desktop/src/features/sidebar/ui/AppSidebar.tsx b/desktop/src/features/sidebar/ui/AppSidebar.tsx index 6ca36bdc84..50c9a80f6b 100644 --- a/desktop/src/features/sidebar/ui/AppSidebar.tsx +++ b/desktop/src/features/sidebar/ui/AppSidebar.tsx @@ -33,7 +33,12 @@ import { AppSidebarPinnedHeader, AppSidebarPrimaryMenu, } from "@/features/sidebar/ui/AppSidebarPinnedHeader"; -import { MoreUnreadButton } from "@/features/sidebar/ui/MoreUnreadButton"; +import { + canPreviewUnreadDm, + MoreUnreadButton, + preferredUnreadTarget, +} from "@/features/sidebar/ui/MoreUnreadButton"; +import { unreadCountLabel } from "@/shared/ui/UnreadPill"; import { SidebarSection } from "@/features/sidebar/ui/SidebarSection"; import { ChannelGroupSection, @@ -148,7 +153,7 @@ export function AppSidebar({ const scrollRef = React.useRef(null); useSidebarScrollLock(scrollRef); // biome-ignore format: keep compact to stay within file size limit - const { scrollToNextAbove, scrollToNextBelow, unreadAboveCount, unreadBelowCount, unreadAboveLabel, unreadBelowLabel } = useSidebarActivityOverflow({ activeWorkingByChannelId, previewActivityChannelIds, scrollRef, unreadChannelIds }); + const { scrollToChannel, scrollToNextAbove, scrollToNextBelow, unreadAboveCount, unreadBelowCount, unreadMessageBelowChannelIds, unreadAboveLabel, unreadBelowLabel } = useSidebarActivityOverflow({ activeWorkingByChannelId, previewActivityChannelIds, scrollRef, unreadChannelIds }); React.useEffect(() => { const scrollElement = scrollRef.current; @@ -390,6 +395,48 @@ export function AppSidebar({ ), [directMessages, dmChannelLabels, sortModeFor], ); + const unreadDmPreviewsBelow = React.useMemo( + () => + unreadMessageBelowChannelIds.flatMap((channelId) => { + const channel = directMessages.find( + (candidate) => candidate.id === channelId, + ); + const participants = dmParticipantsByChannelId[channelId]; + const participant = participants?.[0]; + if ( + !channel || + !participant || + !canPreviewUnreadDm( + channel.participantPubkeys.length, + participants?.length ?? 0, + ) + ) { + return []; + } + return [ + { + accessibleLabel: participant.label, + avatarUrl: participant.avatarUrl, + channelId, + label: dmChannelLabels[channelId] ?? participant.label, + }, + ]; + }), + [ + directMessages, + dmChannelLabels, + dmParticipantsByChannelId, + unreadMessageBelowChannelIds, + ], + ); + const unreadDmChannelIds = React.useMemo( + () => new Set(directMessages.map(({ id }) => id)), + [directMessages], + ); + const nextUnreadDmBelowId = preferredUnreadTarget( + unreadMessageBelowChannelIds, + unreadDmChannelIds, + ); const sidebarLoadingShape = useSidebarLoadingShape({ activeCommunityId: activeCommunity?.id, currentPubkey, @@ -487,7 +534,7 @@ export function AppSidebar({ {unreadAboveCount > 0 ? ( + nextUnreadDmBelowId + ? scrollToChannel(nextUnreadDmBelowId) + : scrollToNextBelow() + } position="bottom" + targetChannelId={nextUnreadDmBelowId} testId="sidebar-more-unread-below" /> ) : null} diff --git a/desktop/src/features/sidebar/ui/MoreUnreadButton.test.mjs b/desktop/src/features/sidebar/ui/MoreUnreadButton.test.mjs new file mode 100644 index 0000000000..45b14c31ff --- /dev/null +++ b/desktop/src/features/sidebar/ui/MoreUnreadButton.test.mjs @@ -0,0 +1,158 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; + +import { renderToStaticMarkup } from "react-dom/server"; + +import { + canPreviewUnreadDm, + MoreUnreadButton, + preferredUnreadTarget, + unreadDmAccessibleLabel, + visibleUnreadDmPreviews, +} from "./MoreUnreadButton.tsx"; + +function preview(channelId, label = channelId, avatarUrl = null) { + return { + accessibleLabel: label, + avatarUrl, + channelId, + label, + }; +} + +describe("MoreUnreadButton model", () => { + it("previews only honest one-to-one DM identities", () => { + assert.equal(canPreviewUnreadDm(2, 1), true); + assert.equal(canPreviewUnreadDm(3, 2), false); + assert.equal(canPreviewUnreadDm(2, 0), false); + }); + + it("caps the stack at three avatars without a numeric overflow chip", () => { + assert.deepEqual( + visibleUnreadDmPreviews([preview("a"), preview("b"), preview("c")]).map( + ({ channelId }) => channelId, + ), + ["a", "b", "c"], + ); + assert.deepEqual( + visibleUnreadDmPreviews([ + preview("a"), + preview("b"), + preview("c"), + preview("d"), + ]).map(({ channelId }) => channelId), + ["a", "b", "c"], + ); + }); + + it("selects the first ordered DM independently from avatar eligibility", () => { + const dmChannelIds = new Set(["near-group", "far-previewable"]); + + assert.equal( + preferredUnreadTarget( + ["near-group", "far-previewable", "channel"], + dmChannelIds, + ), + "near-group", + ); + assert.equal( + preferredUnreadTarget( + ["near-channel", "near-group", "far-previewable"], + dmChannelIds, + ), + "near-group", + ); + assert.equal( + preferredUnreadTarget(["near-channel", "far-channel"], dmChannelIds), + "near-channel", + ); + assert.equal(preferredUnreadTarget([], dmChannelIds), undefined); + }); + + it("announces a DM identity only when it matches the navigation target", () => { + assert.equal( + unreadDmAccessibleLabel({ + count: 2, + dmPreviews: [preview("dm", "Alice")], + position: "bottom", + targetChannelId: "dm", + }), + "Go to unread direct message from Alice. 2 new messages below.", + ); + assert.equal( + unreadDmAccessibleLabel({ + count: 2, + dmPreviews: [preview("dm", "Alice")], + label: "2 new activity", + position: "bottom", + targetChannelId: "dm", + }), + "Go to unread direct message from Alice. 2 new activity below.", + ); + assert.equal( + unreadDmAccessibleLabel({ + count: 2, + dmPreviews: [preview("far-previewable", "Alice")], + position: "bottom", + targetChannelId: "near-group", + }), + "2 new messages below", + ); + assert.equal( + unreadDmAccessibleLabel({ + count: 1, + dmPreviews: [], + position: "top", + }), + "1 new message above", + ); + }); + + it("renders a decorative right-to-left stack with immediate fallback", () => { + const markup = renderToStaticMarkup( + MoreUnreadButton({ + count: 5, + dmPreviews: [ + preview("dm-one", "Alice", "https://example.com/alice.png"), + preview("dm-two", "Alice"), + preview("dm-three", "Group DM"), + preview("dm-four", "Dana"), + ], + onClick() {}, + position: "bottom", + targetChannelId: "dm-one", + testId: "more-unread", + }), + ); + + assert.match(markup, /class="[^"]*overflow-hidden[^"]*"/); + assert.match( + markup, + /5 new messages<\/span>/, + ); + assert.match( + markup, + /aria-label="Go to unread direct message from Alice\. 5 new messages below\."/, + ); + assert.doesNotMatch(markup, />Next<\/span>/); + assert.match(markup, />·<\/span>/); + assert.match(markup, /