fix(mobile): Send on Enter placeholder i18n, one-line field on desktop

- input-cjk.js translates its placeholder with CodemanI18n.t(), like the
  prompt composer, since i18n.js skips <textarea> subtrees; the zh-CN
  entries now show.
- The field only grows on touch devices, where it is position: fixed.
  On a desktop it sits under the terminal, so growing would shrink the
  terminal box and resize the PTY on every line; it stays one line and
  scrolls there.
- Input And Voice: a line break needs a hardware keyboard (no Shift+Enter
  on a phone keyboard, and the extended bar's newline key goes to the CLI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kamil KaliszandClaude Opus 5.5 committed 2026-11-17 06:42:37 +01:00
1 parent 57fdb52f7c
commit 3c5b7e2199
3 files changed
+56 -15

No files matched your search

+14 -1
View File
@@ -251,6 +251,15 @@ const CjkInput = (() => {
_textarea.style.height = '';
return;
}
// Only a touch device grows the field: there it is position: fixed above the
// keyboard. On a desktop it sits in the flex column under the terminal, so
// every line it gained would shrink the terminal box, refit and resize the
// session's PTY (a CLI repaint each time). It stays one line there and
// scrolls inside instead.
if (!document.body?.classList?.contains('touch-device')) {
_textarea.style.height = '';
return;
}
const before = _textarea.style.height;
_textarea.style.height = 'auto';
// border-box: scrollHeight leaves the borders out, offsetHeight - clientHeight adds them back.
@@ -689,9 +698,13 @@ const CjkInput = (() => {
_textarea.setAttribute('autocorrect', v);
_textarea.setAttribute('autocapitalize', _hold ? 'sentences' : 'off');
_textarea.setAttribute('spellcheck', _hold ? 'true' : 'false');
_textarea.placeholder = _hold
// i18n.js skips <textarea> subtrees (what is typed there is user content),
// so the placeholder is translated here, like the prompt composer's.
const placeholder = _hold
? 'Type, Enter to send (Shift+Enter: new line, Esc: clear)'
: 'CJK input (Enter = send, Esc = clear)';
const i18n = typeof window !== 'undefined' ? window.CodemanI18n : undefined;
_textarea.placeholder = typeof i18n?.t === 'function' ? i18n.t(placeholder) : placeholder;
if (_hold) {
_cancelDebouncedFlush();
_autoGrow();