From 8ffb2b0644249d43776b70f7e0fa0361617f9e39 Mon Sep 17 00:00:00 2001 From: "Claude (Codeman maintainer)" Date: Sun, 14 Jun 2026 22:30:09 +0200 Subject: [PATCH] test(cjk): update the mobile server-override test for the welcome-screen gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR gates CJK textarea visibility on an active session (`showCjk = cjkUserEnabled && !!activeSessionId`) so the fixed-position textarea no longer floats over the welcome overlay. That intentionally changes the behavior the existing `shows the CJK textarea on mobile only for server override` test asserted — it set `_serverCjkOverride = true` on a fresh page (no active session) and expected the textarea visible, which now (correctly) resolves to hidden. The test lives in test/mobile/** (excluded from CI), so it wasn't caught by the PR's green CI. Update the test to verify the new, intended behavior: with the server override on it stays hidden on the welcome screen (no active session) and is revealed once a session is active. This is a co-authored review fix; the original change is TeigenZhang's. Verified: tsc, check:frontend-syntax, check:public-assets, prettier all clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/mobile/keyboard.test.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/mobile/keyboard.test.ts b/test/mobile/keyboard.test.ts index 044c9a59..5032f653 100644 --- a/test/mobile/keyboard.test.ts +++ b/test/mobile/keyboard.test.ts @@ -528,15 +528,24 @@ describe('Virtual Keyboard', () => { expect(afterEnter.sentInputs).toEqual(['hello', '\r']); }); - it('shows the CJK textarea on mobile only for server override', async () => { + it('shows the CJK textarea on mobile for server override only inside an active session', async () => { const state = await page.evaluate(() => { - app._serverCjkOverride = true; - app._updateCjkInputState(); - const input = document.getElementById('cjkInput'); if (!(input instanceof HTMLElement)) return null; + + // Welcome screen (no active session): even with the server override on, the + // fixed-position textarea must stay hidden so it doesn't float over the overlay. + app.activeSessionId = null; + app._serverCjkOverride = true; + app._updateCjkInputState(); + const onWelcomeDisplay = getComputedStyle(input).display; + + // Entering a session reveals it. + app.activeSessionId = 'cjk-server-override-test'; + app._updateCjkInputState(); const cs = getComputedStyle(input); return { + onWelcomeDisplay, display: cs.display, position: cs.position, bottom: cs.bottom, @@ -546,6 +555,7 @@ describe('Virtual Keyboard', () => { }); expect(state).not.toBeNull(); + expect(state?.onWelcomeDisplay).toBe('none'); expect(state?.display).not.toBe('none'); expect(state?.position).toBe('fixed'); expect(Number(state?.zIndex)).toBeGreaterThan(50);