Chat workspace
The chat workspace is a standalone open-source conversation desk at /chat. It helps an agent find a conversation, read its message history, reply or add an internal note, and inspect the related contact. The page uses a fixed workspace frame with navigation on the left, the active conversation in the center, and contact context on the right. It complements the dashboard content and communication views and sits within the wider collaboration workspaces model.
Workspace composition
The workspace is built as one route-level shell around one conversation view. The route supplies the conversation set, while the layout adds the shared chat header and navigation before the page presents the conversation list, thread, and optional profile panel. This keeps the chat experience separate from dashboard views while preserving a clear three-part work area.
References: src/…/layout.tsx• L1-19 src/…/page.tsx• L1-6 src/…/chat.tsx• L21-89
The top bar identifies the workspace as Studio Chat and gives the agent access to conversation search, new-conversation, notification, and settings controls. The left navigation groups work by inbox state, communication channel, and customer view. It also keeps the current agent account actions at the bottom.
References: src/…/chat-header.tsx• L6-31 src/…/chat-sidebar.tsx• L40-153 src/…/data.ts• L40-70
Conversation management
The conversation list is the workspace's selection surface. It groups the supplied conversations by their inbox group and offers tabs for all, open, snoozed, and closed work. Each row gives enough context to triage a thread: contact, subject, latest preview, time, online state, pinned state, and unread count.
References: src/…/chat-conversation-list.tsx• L24-39 src/…/chat-conversation-list.tsx• L65-169
Selecting a row updates the active conversation and opens the thread on small screens. The selected conversation is held in local client state and the workspace falls back to the first available conversation when the selection is not found, so the list and thread stay aligned as the agent moves through the inbox.
References: src/…/use-chat.ts• L5-25 src/…/chat-conversation-list.tsx• L97-112 src/…/chat.tsx• L21-57
Conversation thread
The thread turns the selected conversation into a focused exchange between the current agent and the contact. A contact header shows identity and presence, while quick actions offer calling, tagging, snoozing, profile access, and other contact actions. The message area keeps the latest exchange visible and shows sender direction, time, and optional reactions.
References: src/…/chat-thread.tsx• L50-198
The composer separates an external reply from an internal note. Both modes provide a text area and common message tools such as formatting, emoji, file attachment, links, and AI assistance. This distinction lets an agent draft contact-facing text without mixing private team context into the outward reply.
References: src/…/chat-thread.tsx• L200-261
The main conversation flow moves from triage to selection, then to reading or responding, with contact context available when needed.
flowchart LR
A[Inbox and workspace filters] --> B[Conversation list]
B --> C[Selected conversation]
C --> D[Message thread]
D --> E[Reply]
D --> F[Internal note]
C --> G[Contact profile]
Contact profile
The contact profile gives the agent a compact view of the person behind the thread. It combines contact methods with company, role, lifecycle stage, qualification date, time zone, location, and tags. Details, files, and activity form the profile's context tabs, while quick actions keep common follow-up work near the contact record.
References: src/…/chat-profile-details.tsx• L29-150 src/…/data.ts• L26-38
The profile occupies a third column on large screens and opens as a right-side sheet on smaller screens. On mobile, the conversation list and thread share the same view space, so the agent can move into a thread and return to the list without losing the selected conversation.
References: src/…/chat.tsx• L30-86
Conversation data model
The workspace treats a conversation as the link between inbox triage, the message thread, and the contact profile. Its data includes display and unread state, a contact record, and an ordered message set. The route currently passes a local conversation set into the chat surface, so the page presents a complete conversation-oriented experience without a server data flow in this area.
References: src/…/page.tsx• L1-17 src/…/data.ts• L4-38 src/…/data.ts• L72-1257
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the conversation selection state and the active thread's contact and messages aligned when the conversation shape or selection rules change.
- Keep the desktop profile column and the tablet/mobile profile sheet consistent when profile actions or fields change.
- Keep reply and internal-note modes distinct when changing composer behavior or message submission.
- Keep navigation labels and counts aligned with the conversation grouping and channel data shown in the list.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A selected conversation ID no longer matches the supplied conversation set | The thread falls back to the first conversation and can show unexpected contact context | Preserve valid IDs when changing conversation data or selection rules |
| The supplied conversation set is empty | The workspace has no active contact or message source for the thread and profile | Keep the route contract non-empty or add an explicit empty-state path before reading the active conversation |
| The active conversation is changed without updating its contact and message inputs | The header, messages, and profile can describe different people | Treat the selected conversation as the single source for all three views |
| Mobile view state is changed without updating list and thread transitions | The agent can lose the path back to the inbox or see two panes at once | Keep list selection, thread visibility, and back navigation as one flow |
| Profile behavior is changed in only one responsive mode | Large screens and smaller screens expose different contact actions | Apply profile changes to both the desktop panel and the right-side sheet |
| Composer submission is not connected to message handling | A reply or internal note can look ready to send but does not become part of the conversation | Connect submission to the intended message path before treating the composer as an active communication channel |
Key files
| File | Why to read it |
|---|---|
| src/…/layout.tsx | Shows the route-level shell that joins the header, sidebar, and page content. |
| src/…/page.tsx | Shows the route entry point, page metadata, and the conversation data passed into the workspace. |
| src/…/chat.tsx | Shows how the list, thread, profile, and responsive view states form one workspace. |
| src/…/chat-conversation-list.tsx | Explains inbox grouping, filters, selection, and unread presentation. |
| src/…/chat-thread.tsx | Explains message reading, contact actions, and reply versus internal-note composition. |
| src/…/chat-profile-details.tsx | Explains the contact context shown beside or above the thread. |
| src/…/use-chat.ts | Defines the local selected-conversation state shared by the list and thread. |
| src/…/data.ts | Defines the conversation, message, contact, navigation, and sample workspace data used by the route. |