(
- relayed !== null
+ titles
? [
+ { ...update(0, false), content: "Ordinary chat message" },
{
- ...update(0, false),
- content: "Ordinary chat message",
+ ...update(1, false),
+ // Thread read state is keyed by event ID.
+ id: "1".repeat(64),
+ authorId: owner.session.viewer,
+ content: `Thread title fixture. ${"A long title needs to fit the line. ".repeat(6)}`,
+ threadTitle: true,
+ replyCount: 4,
+ participants: [agent, owner.session.viewer],
},
{
- ...update(1, false),
+ ...update(2, false),
+ id: "2".repeat(64),
authorId: owner.session.viewer,
- content: `Relayed fixture update. ${"A long preview needs to fit the chat. ".repeat(9)}\n\n${note}`,
- relayedFrom: { agent, channelId: source, verified: true },
+ content: "Second thread title",
+ threadTitle: true,
},
- ...(relayed === "group"
- ? [
- {
- ...update(2, false),
- authorId: owner.session.viewer,
- content: "Second relayed fixture update.",
- relayedFrom: { agent, channelId: source, verified: true },
- },
- ]
- : []),
]
- : Array.from({ length: 16 }, (_, index) => update(index)),
+ : relayed !== null
+ ? [
+ {
+ ...update(0, false),
+ content: "Ordinary chat message",
+ },
+ {
+ ...update(1, false),
+ authorId: owner.session.viewer,
+ content: `Relayed fixture update. ${"A long preview needs to fit the chat. ".repeat(9)}\n\n${note}`,
+ relayedFrom: { agent, channelId: source, verified: true },
+ },
+ ...(relayed === "group"
+ ? [
+ {
+ ...update(2, false),
+ authorId: owner.session.viewer,
+ content: "Second relayed fixture update.",
+ relayedFrom: { agent, channelId: source, verified: true },
+ },
+ ]
+ : []),
+ ]
+ : Array.from({ length: 16 }, (_, index) => update(index)),
);
const [inlineTarget, setTarget] = useState<{
messageId: string;
@@ -114,6 +140,7 @@ function Fixture() {
Prepend history
+ {opened && }
false}
+ {...(titles
+ ? {
+ onOpenThread: (_id: string, rootId: string) =>
+ setOpened(rootId),
+ }
+ : {})}
/>