> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversation

> View and reply to a secure messaging thread with reply-to support, paginated message history, and sender profile resolution.

The Conversation screen displays a secure messaging thread and allows users to compose and send replies at route `/pm/messaging/:conversationId`.

## Overview

The page loads messages for the `conversationId` route parameter via the platform `useMessages` hook, then resolves sender display names by querying `pf_profiles` for unique `sender_id` values in the message set. The header shows a "Secure" badge. Message history is rendered by `MessageThread` with load-more pagination via `hasMore` / `loadMore`. A `MessageComposer` at the bottom of the page handles new message input and supports a reply-to context (showing the quoted message author and a 100-character preview). Clicking a reply arrow on any message sets the reply context, which can be cleared with Cancel Reply.

## Who it's for

Requires permission `PM_PERMISSIONS.MESSAGES_VIEW` (enforced via `RequirePermission` in the route definition).

## Before you start

* You need `pm.messages.view` to access messaging.
* Navigate here from the Messaging inbox (`/pm/messaging`) by selecting a conversation.

## Steps

<Steps>
  <Step title="Open a conversation">
    From the Messaging inbox (`/pm/messaging`), click a conversation row to open the thread.
  </Step>

  <Step title="Read the message history">
    Scroll through messages. Click **Load more** if older messages are available.
  </Step>

  <Step title="Reply to a specific message (optional)">
    Click the reply icon on a message to set it as the reply context. The composer shows the quoted author and preview.
  </Step>

  <Step title="Compose and send a reply">
    Type a message in the composer and submit. The `useSendMessage` hook posts the message to the conversation.
  </Step>
</Steps>

## Key concepts

| Term             | Meaning in code                                                                    |
| ---------------- | ---------------------------------------------------------------------------------- |
| `conversationId` | Route parameter; identifies the messaging thread                                   |
| `sender_id`      | UUID of the message sender, resolved to a display name via `pf_profiles.full_name` |
| `hasMore`        | Whether older messages can be paginated in                                         |
| `replyTo`        | State holding the quoted message context: `messageId`, `authorName`, `preview`     |
| `isSending`      | Disables the composer while a send is in flight                                    |

## Related

<Columns cols={2}>
  <Card title="Practice Management" icon="briefcase" href="/pm/overview">
    Practice Management core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/pm.tsx
  * src/cores/pm/pages/MessagingThreadPage.tsx
</Accordion>
