ThreadPage
ThreadPage — one conversation on the web: messages oldest first, a composer at the bottom, attachments, a read receipt, earlier pages, going to a message, the first unread, events between messages, and send states. The web twin of ui-native's `ThreadPage`, with the same props and slots, on the shared conversation contract (`@marktiderman/genesis-core/conversation`): the same `ThreadMessage[]` and `ThreadComposer` render on both. Built from the web atoms `ThreadList` and `ComposerBar`, so an app can take this whole or build its own thread from the same parts. It fills its container (a flex column of full height): put it in a page, a pane of `InboxLayout`, or the chat dock. Mine are on the trailing side in `primary`, theirs on the leading side on `muted`; an internal note (`tone: "internal"`) is edged in `warning` and says so to a screen reader. Data: rows arrive as props and the page never fetches. A row's send state is data (`sending`, `pending`, `paused`, `failed`, `conflict`) with `onRetry` / `onDiscard`. Read-only: `composer={null}`, with an optional `closedNotice`. Slots: `message`, `event`, `attachment`, `readReceipt`, `unreadDivider`, `composer`, `composerAccessory`, `headerRegion` (pinned above the list), `header` (scrolls above the first message), `earlier` and `empty`. Tailwind has to see this package's classes: import `@marktiderman/genesis-ui/styles.css`, or add `@source "../node_modules/@marktiderman/genesis-ui/dist";` to your CSS.
packages/ui/src/components/patterns/messaging/thread-page.tsx
@marktiderman/genesis-ui/patternsimport { ThreadPage } from "@marktiderman/genesis-ui/patterns";react-docgen-typescript.ThreadPage
| Prop | Type | Default | Description |
|---|---|---|---|
| composer* | ThreadComposer | null | — | `null`: read-only, no composer. |
| messages* | ThreadMessage[] | — | Oldest first. |
| className | string | — | |
| closedNotice | string | — | Shown instead of the composer when it is `null` ("This conversation is closed"). |
| conversationId | string | null | — | Which conversation this is. When it changes (another row picked in an inbox), the thread opens afresh: at the first unread, or the newest. |
| earlierLabel | string | Load earlier messages | |
| emptyBody | string | — | |
| emptyTitle | string | — | |
| error | boolean | false | The read failed and there are no messages: the empty slot shows `errorTitle` / `errorBody` instead. |
| errorBody | string | Check your connection and try again. | |
| errorTitle | string | Couldn't load this conversation | |
| firstUnreadId | string | null | — | The first message the reader hasn't seen: a "New messages" divider above it. |
| formatTime | ((date: Date) => string) | — | |
| hasEarlier | boolean | false | There are older messages: they load near the top, and a "load earlier" button shows. |
| header | ReactNode | — | Above the first message, scrolling with them. Prefer `slots.header` for a component. |
| jumpTo | string | null | — | Go to this message, loading with `onLoadUntil` until it's here. |
| labels | Partial<ThreadLabels> | — | The words the defaults say, for translating. |
| loading | boolean | false | The first page is loading: a skeleton instead of the empty state, and a jump waits for it. |
| loadingEarlier | boolean | false | |
| onJumpFailed | ((id: string) => void) | — | A `jumpTo` message couldn't be found (the reader stays where they are). Default: a screen reader hears `labels.messageGone`. |
| onLoadEarlier | (() => void) | — | |
| onLoadUntil | ((id: string) => Promise<boolean>) | — | |
| onRetry | (() => void) | — | A "Try again" button with `error`. |
| readAt | string | Date | null | — | When the other side last read the thread: my newest message sent before it shows the read receipt. |
| readLabel | string | Read | |
| retryLabel | string | Try again | |
| sendOn | enum | — | Which key sends. Default `enter` (Shift+Enter for a new line). Native ignores it. |
| slotProps | SlotPropsFor<ThreadPageSlotMap> | {} | |
| slots | Slots<ThreadPageSlotMap> | {} | |
| testID | string | thread-page | testID on the root. Default `"thread-page"`. |
| updating | boolean | false | Fresher rows are on their way (the cache showed first): a quiet "Updating…" line. |