{# Chat — the cold open, and a bound session (043 C6). Derived from docs/design/040/web/chat-cold-open.html and chat-read-only.html. ONE template, two states, decided by `is_new`: is_new the hero, four starters, the composer. No model picker, no tool checkboxes, no max-steps slider — they move to Agent › Settings in phase 4, and the session request carries only the task. bound the thread, live, driven by the EXISTING chat modules. They read the session from document.body's data attributes (ui-utils.js::SessionStateManager.init), which is why no inline script is needed here and why those modules are imported rather than copied. The read-only frame comes from shell.html and is stated ONCE there; all this page does is swap the composer for the sentence that says why it is off. The thread itself is a READ and renders on every posture. #} {% extends "shell.html" %} {% block body_attrs %} data-session-id="{{ session_id or 'new' }}" data-is-new="{{ 'true' if is_new else 'false' }}" data-is-owner="{{ 'true' if is_owner else 'false' }}" data-is-authenticated="{{ 'true' if is_authenticated else 'false' }}" data-read-only="{{ 'true' if read_only else 'false' }}"{% endblock %} {% block body %} {%- if is_new %}
{{ t('chat.open.sub') }}
{%- if not read_only %} {# A starter is a SHORTCUT INTO THE COMPOSER, and read-only has no composer — chat-open.js binds them only after it finds the form, so rendering them here shipped four buttons that did nothing. #}{{ t('chat.ownership_unknown') }}
{{ t('chat.ownership_unknown_note') }}
{%- elif read_only %} {# The off state (schema: chat-read-only.html) — a dashed, dimmed composer that cannot be typed into. `style-src 'unsafe-inline'` is already the CSP. #}{{ t('chat.read_only.composer') }}
{{ t('chat.read_only.note') }}
{%- else %}{{ t('chat.composer.hint') }}
{%- endif %}{{ t('chat.sources')|safe }}
{# Loaded on EVERY posture. The thread is a READ, and gating the script on read-only left /c/{id} permanently blank on the one posture prod runs — the composer is already absent above, and `data-read-only` is what keeps the imported session modules in look-only mode. #} {%- if not ownership_unknown %} {%- endif %} {% endblock %}