fix(mobile): keep the Send on Enter draft when going Home

goHome() nulled activeSessionId without stashing the field, so picking the
session again cleared the draft. Stash it first.

Docs: src/web/CLAUDE.md lists cjkInputHoldUntilEnter among the per-device
keys the strict schema does not declare, and notes the sendEnterKey()
exception for the visible CJK field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kamil KaliszandClaude Opus 5.5 committed 2026-11-16 20:38:20 +01:00
1 parent 64ee504247
commit 80d719df5f
3 files changed
+12 -2

No files matched your search

+7
View File
@@ -129,6 +129,13 @@ describe('a held draft survives a reload of the same session', () => {
);
});
it('going Home stashes the draft of the session it leaves', () => {
const appJs = read('app.js');
const start = appJs.indexOf(' goHome() {');
const body = appJs.slice(start, appJs.indexOf('this.activeSessionId = null;', start));
expect(body).toContain('CjkInput.stashDraft?.(this.activeSessionId);');
});
it('a removed session drops its stashed draft', () => {
expect(read('app.js')).toMatch(
/discardComposerDraft\?\.\(sessionId\);\n\s*if \(typeof CjkInput !== 'undefined'\) CjkInput\.discardDraft\?\.\(sessionId\);/