mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
## Summary - show relevant unread threads and active agents when hovering a channel - keep channel-level unread emphasis separate from thread activity dots - make activity rows navigate to the thread and remove demo-only data ## Test plan - `just ci` (all stages passed except the final duplicate native check, which ran out of disk after its earlier clippy pass) - `cd desktop && pnpm exec playwright test tests/e2e/channel-activity-popover.spec.ts --project=smoke` --------- Signed-off-by: kenny lopez <klopez4212@gmail.com>
31 lines
846 B
JavaScript
31 lines
846 B
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { resolveChannelActivityFeedItemReadAt } from "./useChannelActivityProjection.ts";
|
|
|
|
test("channel activity read state folds the item's own message and channel markers", () => {
|
|
const markers = new Map([
|
|
["msg:reply-general", 100],
|
|
["general", 200],
|
|
["random", 500],
|
|
]);
|
|
|
|
assert.equal(
|
|
resolveChannelActivityFeedItemReadAt(
|
|
{ id: "reply-general", channelId: "general" },
|
|
(contextId) => markers.get(contextId) ?? null,
|
|
),
|
|
200,
|
|
);
|
|
});
|
|
|
|
test("channel activity read state honors a channel marker without a message marker", () => {
|
|
assert.equal(
|
|
resolveChannelActivityFeedItemReadAt(
|
|
{ id: "reply-general", channelId: "general" },
|
|
(contextId) => (contextId === "general" ? 300 : null),
|
|
),
|
|
300,
|
|
);
|
|
});
|