DataChat conversation presentation

Native tenant-session DataChat view, opened from the DataChat header button. Uses POST /api/ai/datachat/ask with the verified session, CSRF protection and no automatic refresh/replay. No SQL identity is supplied by the browser.

The wide layout shows conversation content, bottom composer and right-hand chat list. Mobile stacks the chat list above the conversation. Search covers only this visit's memory-resident titles; history clears on close/sign-out and is bounded to 20 chats, 100 turns per chat. Existing API does not expose a browser history reader. No provider/model selector, share, voice, upload or feedback endpoint is invented.

Server capacity must be enabled for real model answers. Populated screenshot previews may use explicitly labelled response fixtures; they do not prove model readiness. Session changes clear content and ignore late responses. A changed security fingerprint removes old answer history. Unconfirmed requests are locked without retry, with an explicit new-chat option.

Empty conversation parts: empty-icon, empty-title and empty-help may be arranged independently inside their DataChat workspace. They disappear when that conversation has a turn and return for a new empty chat. The turns block omits separately placed empty-state pieces. No model request is made by these parts.

Saved chat API (authenticated tenant session)
---------------------------------------------
The @buildwithhq/module-sdk/data-chat client also exposes:
  listSessions({ search?, pageSize?, beforeUpdatedUtc?, beforeSessionId? })
    GET /api/ai/datachat/sessions
  readSession(sessionId, beforeTurnOrder?)
    GET /api/ai/datachat/sessions/{sessionId}
  changeSession(sessionId, { action: "rename", title, expectedUpdatedUtc })
  changeSession(sessionId, { action: "delete", expectedUpdatedUtc })
    POST /api/ai/datachat/sessions/{sessionId}/change

Supply the application's verified tenant transport to createDataChatClient.
These are private user-session operations, not app-key impersonation endpoints.
No user, organization, role or database override is accepted by the client.
Chat sessions are saved by ask; use its sessionId for subsequent questions.
Read history without rerunning inference. Render an answer only when answerState
is available. Otherwise explain access_changed, evidence_changed or
legacy_unverified, retaining only the current references returned by the server.
Resolve reference.recordId through the native secured record-link resolver;
never guess a page from module names. Preserve chunkId as an exact integer/string.
For session pagination pass both values from the final listed session; for older
turns pass oldestTurnOrder. Keep updatedUtc unchanged, including all seven
fractional digits, for rename/delete. On conflict refresh and reconsider the
change. On uncertain mutation outcome refresh; the client never retries it.
These routes require the saved-history backend and reviewed database migration.
Including the client in a kit does not activate an undeployed backend.
