feat(chat): add Send button to agent composers (mobile fix)

Soft keyboards have no reliable Enter-to-send, so chat was unsendable on
mobile browsers. Add an optional themed Send button wired through
wireAgentChat (Enter-to-send kept for desktop), applied to the Companion
rail, Yerin, and Little Blue composers. Blackflame-styled, flex-row layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-05 08:25:05 +10:00
parent 3c028fed5a
commit c2569cad76
5 changed files with 31 additions and 11 deletions

View File

@@ -22,12 +22,13 @@ export async function renderRightrail(root) {
const log = el('div', { class: 'rail-log' });
const input = el('textarea', { class: 'rail-input', rows: 1, placeholder: 'Ask the companion…' });
const sendBtn = el('button', { class: 'rail-send', type: 'button', title: 'Send', 'aria-label': 'Send' }, '➤');
const header = el('div', { class: 'rail-hd' },
el('span', { class: 'who' }, '◆ Companion'),
el('span', { class: 'chev', onclick: toggle, title: 'Collapse' }, '⟩'));
mount(root, el('div', { class: 'rail-toggle', onclick: toggle, title: 'Companion' }, 'CRADLE'),
el('div', { class: 'rail-chat' }, header, log, el('div', { class: 'rail-inputwrap' }, input)));
el('div', { class: 'rail-chat' }, header, log, el('div', { class: 'rail-inputwrap' }, input, sendBtn)));
// (Re)wire the chat whenever the active Space changes.
async function initChat(spaceId) {
@@ -36,7 +37,7 @@ export async function renderRightrail(root) {
return;
}
const chat = wireAgentChat({
logEl: log, inputEl: input,
logEl: log, inputEl: input, sendBtnEl: sendBtn,
historyUrl: `/api/spaces/${spaceId}/companion`,
turnUrl: `/api/spaces/${spaceId}/companion/turn`,
agentName: 'Companion', showDrafts: true, toolLabels: COMPANION_LABELS,