# Chat Composer Review Guide

This guide focuses on the rich composer module used by direct and group chats.

## 1. Core modules and responsibilities

- `client_app/lib/chat_screen.dart`
  - owns direct-message composer state, send/record mode switching, inline rich-text editor, and fullscreen handoff
- `client_app/lib/group_chat_screen.dart`
  - mirrors the composer architecture for group messages
- `client_app/lib/widgets/fullscreen_rich_composer.dart`
  - fullscreen compose shell (toolbar + editor + collapse/send actions)
- `client_app/lib/widgets/rich_text_format_toolbar.dart`
  - formatting controls for rich text (inline and fullscreen)
- `client_app/lib/widgets/rich_message_view.dart`
  - read-only rendering of rich-text JSON in message bubbles/previews
- `client_app/lib/utils/rich_message_codec.dart`
  - converts between plain text and normalized rich-text JSON payloads

## 2. Key snippet map for reviewers

- In `chat_screen.dart` and `group_chat_screen.dart`:
  - `_buildComposerSuffixActions(...)`
    - defines composer action buttons (fullscreen + optional screen-link attach)
  - `_buildCompactComposerTheme(...)`
    - zeroes Fleather paragraph/block spacing for inline composer so one-line input stays visually aligned with action buttons
  - `_buildInlineComposerEditor(...)`
    - hosts `FleatherField` with sticker trigger, hint text, and suffix actions
  - `_buildMessageInputField()`
    - wraps composer in media/reply/edit/recording state transitions and trailing send/mic controls
- In `fullscreen_rich_composer.dart`:
  - top bar collapse button returns control to inline composer
  - toolbar and full editor are separated from inline composer to avoid crowding normal chat view

## 3. UX behavior to verify

- inline composer keeps stable baseline height when text is a single line
- fullscreen entry and collapse icons are paired affordances
- rich formatting can be done live (no markdown token typing required)
- direct and group chat composers stay behaviorally consistent

## 4. Data-safety notes for review

- this module handles formatting structure only; encryption/session logic remains in crypto and transport services
- service configuration values in this bundle are placeholders
- message formatting payloads are serializable JSON and can be reviewed independently of transport internals
