feat: add thread functionality to room features

- Enhance RoomInput to support sending messages as replies in threads by adding `threadRootId` prop.
- Update RoomTimeline to manage active thread state and handle opening threads.
- Implement ThreadView component to display thread messages and input.
- Create HomeThreadsCategory to list threads user has participated in.
- Introduce activeThreadIdAtomFamily to manage active thread state across rooms.
This commit is contained in:
2026-03-13 00:44:33 +11:00
parent 37f4297972
commit ced29a6571
9 changed files with 1039 additions and 44 deletions

View File

@@ -0,0 +1,11 @@
import { atom } from 'jotai';
import { atomFamily } from 'jotai/utils';
/** Stores the active thread root event ID for a given room. `undefined` means no thread is open. */
const createActiveThreadAtom = () => atom<string | undefined>(undefined);
export type TActiveThreadAtom = ReturnType<typeof createActiveThreadAtom>;
export const activeThreadIdAtomFamily = atomFamily<string, TActiveThreadAtom>(
createActiveThreadAtom
);