From e5f4dbdd70c32183840179fa64120ac1d1338be5 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Thu, 10 Sep 2026 15:36:14 +0700 Subject: [PATCH] fix(web): stop the off-turn word field looking like it wants a word MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It keeps focus through the handover so a phone's keyboard survives it, which left a caret blinking in a field that takes no text and an I-beam over it inviting one. The caret is transparent and the pointer is a plain arrow while the turn is somebody else's. Its placeholder was a sentence — "Đến lượt Minh…", "Mất kết nối, đang thử lại…" — in a box that shares its row with the send button, so the end of it was cut off against the edge. The board's turn line above says who is thinking and the badge says the connection is down; the field only has to say that it is not yours yet, so it says that, and anything that still does not fit ends in an ellipsis. --- web/e2e/reconnect.spec.js | 7 +++---- web/src/lib/components/WordInput.svelte | 23 +++++++++++++++-------- web/src/lib/i18n/vi.js | 4 ++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/web/e2e/reconnect.spec.js b/web/e2e/reconnect.spec.js index 4ebb41d..acff056 100644 --- a/web/e2e/reconnect.spec.js +++ b/web/e2e/reconnect.spec.js @@ -139,10 +139,9 @@ test.describe('losing the connection', () => { // a word it cannot carry. await expect(board(page).submit).toBeDisabled(); await expect(board(page).input).toHaveAttribute('aria-disabled', 'true'); - await expect(board(page).input).toHaveAttribute( - 'placeholder', - 'Mất kết nối, đang thử lại…' - ); + // Its own short version of the badge's line: the field shares a row + // with the send button, and a sentence in there is cut off by it. + await expect(board(page).input).toHaveAttribute('placeholder', 'Mất kết nối…'); // And it comes back on its own once the connection does. socket.restore(); diff --git a/web/src/lib/components/WordInput.svelte b/web/src/lib/components/WordInput.svelte index e158304..e3a4c92 100644 --- a/web/src/lib/components/WordInput.svelte +++ b/web/src/lib/components/WordInput.svelte @@ -1,5 +1,5 @@