From 6a7fe5f16d9621103cdd96ba11bf021f303f7787 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Wed, 18 Nov 2026 11:32:51 -0700 Subject: [PATCH] Sign-in: wait for the sign-in mode before showing the fields On an install that signs in on the mail server's page, /mail/a showed the username and password fields until /api/config answered, then swapped the password field for the note about the server's page. The fields are now laid out but hidden until the mode is known, so the card keeps its size, and they remount then so autofocus still lands. The two hints under "This is my own device" go through t() now, with translations in all ten catalogs. Fixes #102 --- web/src/locales/de.ts | 2 ++ web/src/locales/es.ts | 2 ++ web/src/locales/fr.ts | 2 ++ web/src/locales/ja.ts | 2 ++ web/src/locales/nl.ts | 2 ++ web/src/locales/pt-BR.ts | 2 ++ web/src/locales/ru.ts | 2 ++ web/src/locales/tr.ts | 2 ++ web/src/locales/uk.ts | 2 ++ web/src/locales/zh-Hans.ts | 2 ++ web/src/views/Login.tsx | 14 ++++++++++++-- 11 files changed, 32 insertions(+), 2 deletions(-) diff --git a/web/src/locales/de.ts b/web/src/locales/de.ts index 50b2cd3..1aeb292 100644 --- a/web/src/locales/de.ts +++ b/web/src/locales/de.ts @@ -946,6 +946,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Alle anderen Sitzungen abmelden", "Signed in as": "Angemeldet als", "This is my own device": "Das ist mein eigenes Gerät", + "Stay signed in, and keep settings and recent addresses on this computer.": "Angemeldet bleiben und Einstellungen sowie zuletzt verwendete Adressen auf diesem Computer speichern.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "Nach 5 Minuten Inaktivität abgemeldet, und auf diesem Computer wird nichts gespeichert. Lassen Sie das Häkchen auf einem gemeinsam genutzten oder öffentlichen Computer weg.", "this device": "dieses Gerät", "Device": "Gerät", "IP": "IP", diff --git a/web/src/locales/es.ts b/web/src/locales/es.ts index 18053c3..1aec874 100644 --- a/web/src/locales/es.ts +++ b/web/src/locales/es.ts @@ -952,6 +952,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Cerrar todas las demás sesiones", "Signed in as": "Sesión iniciada como", "This is my own device": "Este es mi propio dispositivo", + "Stay signed in, and keep settings and recent addresses on this computer.": "Mantener la sesión iniciada y guardar la configuración y las direcciones recientes en este equipo.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "La sesión se cierra tras 5 minutos de inactividad y no se guarda nada en este equipo. Deje esta casilla sin marcar en un equipo compartido o público.", "this device": "este dispositivo", "Device": "Dispositivo", "IP": "IP", diff --git a/web/src/locales/fr.ts b/web/src/locales/fr.ts index ab0b22e..c2c22d9 100644 --- a/web/src/locales/fr.ts +++ b/web/src/locales/fr.ts @@ -958,6 +958,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Déconnecter toutes les autres sessions", "Signed in as": "Connecté en tant que", "This is my own device": "Cet appareil est le mien", + "Stay signed in, and keep settings and recent addresses on this computer.": "Rester connecté et conserver les paramètres et les adresses récentes sur cet ordinateur.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "Déconnexion après 5 minutes d'inactivité, et rien n'est conservé sur cet ordinateur. Laissez cette case décochée sur un ordinateur partagé ou public.", "this device": "cet appareil", "Device": "Appareil", "IP": "IP", diff --git a/web/src/locales/ja.ts b/web/src/locales/ja.ts index 25481b6..faf8187 100644 --- a/web/src/locales/ja.ts +++ b/web/src/locales/ja.ts @@ -952,6 +952,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "他のすべてのセッションをサインアウト", "Signed in as": "サインイン中のアカウント", "This is my own device": "これは自分のデバイスです", + "Stay signed in, and keep settings and recent addresses on this computer.": "サインインしたままにし、設定と最近使ったアドレスをこのコンピューターに保存します。", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "5分間操作がないとサインアウトし、このコンピューターには何も保存しません。共用や公共のコンピューターではチェックを入れないでください。", "this device": "このデバイス", "Device": "デバイス", "IP": "IP", diff --git a/web/src/locales/nl.ts b/web/src/locales/nl.ts index fc710c8..fabf922 100644 --- a/web/src/locales/nl.ts +++ b/web/src/locales/nl.ts @@ -953,6 +953,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Alle andere sessies uitloggen", "Signed in as": "Ingelogd als", "This is my own device": "Dit is mijn eigen apparaat", + "Stay signed in, and keep settings and recent addresses on this computer.": "Ingelogd blijven en instellingen en recente adressen op deze computer bewaren.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "Na 5 minuten inactiviteit uitgelogd, en er wordt niets op deze computer bewaard. Laat dit uitgevinkt op een gedeelde of openbare computer.", "this device": "dit apparaat", "Device": "Apparaat", "IP": "IP", diff --git a/web/src/locales/pt-BR.ts b/web/src/locales/pt-BR.ts index 02be997..3eb1207 100644 --- a/web/src/locales/pt-BR.ts +++ b/web/src/locales/pt-BR.ts @@ -955,6 +955,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Encerrar todas as outras sessões", "Signed in as": "Conectado como", "This is my own device": "Este dispositivo é meu", + "Stay signed in, and keep settings and recent addresses on this computer.": "Manter a sessão iniciada e guardar as configurações e os endereços recentes neste computador.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "A sessão é encerrada após 5 minutos de inatividade, e nada fica salvo neste computador. Deixe esta opção desmarcada em um computador compartilhado ou público.", "this device": "este dispositivo", "Device": "Dispositivo", "IP": "IP", diff --git a/web/src/locales/ru.ts b/web/src/locales/ru.ts index 666e1bc..389a3e9 100644 --- a/web/src/locales/ru.ts +++ b/web/src/locales/ru.ts @@ -955,6 +955,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Завершить все остальные сеансы", "Signed in as": "Вход выполнен как", "This is my own device": "Это моё личное устройство", + "Stay signed in, and keep settings and recent addresses on this computer.": "Оставаться в системе и сохранять настройки и недавние адреса на этом компьютере.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "Выход после 5 минут бездействия, на этом компьютере ничего не сохраняется. Не отмечайте этот пункт на общем или публичном компьютере.", "this device": "это устройство", "Device": "Устройство", "IP": "IP", diff --git a/web/src/locales/tr.ts b/web/src/locales/tr.ts index 71afa6a..8f39a0e 100644 --- a/web/src/locales/tr.ts +++ b/web/src/locales/tr.ts @@ -1307,6 +1307,8 @@ export const catalog: Catalog = { "This group has more members than can be taken out at once.": "Bu grubun bir kerede çıkarılabileceğinden daha fazla üyesi var.", "This group no longer exists. Someone may have deleted it.": "Bu grup artık mevcut değil. Biri silmiş olabilir.", "This is my own device": "Bu benim kendi cihazım", + "Stay signed in, and keep settings and recent addresses on this computer.": "Oturum açık kalsın; ayarlar ve son kullanılan adresler bu bilgisayarda saklansın.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "5 dakika işlem yapılmazsa oturum kapanır ve bu bilgisayarda hiçbir şey saklanmaz. Paylaşılan veya herkese açık bir bilgisayarda bu kutuyu işaretlemeyin.", "This is separate from {setting} in General, which decides how dates, times and numbers are written. You can read an English interface with German dates, or the other way round.": "Bu, Genel bölümünde tarihlerin, saatlerin ve sayıların nasıl yazılacağını belirleyen {setting} ayarından ayrıdır. İngilizce bir arayüzü Almanca tarihlerle veya tam tersi şekilde kullanabilirsiniz.", "This is what a new-mail notification looks like.": "Yeni posta bildirimi bu şekilde görünür.", "This link does not go where it says": "Bu bağlantı belirttiği adrese gitmiyor", diff --git a/web/src/locales/uk.ts b/web/src/locales/uk.ts index 5376c45..106b85b 100644 --- a/web/src/locales/uk.ts +++ b/web/src/locales/uk.ts @@ -949,6 +949,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "Завершити всі інші сеанси", "Signed in as": "Вхід виконано як", "This is my own device": "Це мій власний пристрій", + "Stay signed in, and keep settings and recent addresses on this computer.": "Залишатися в системі та зберігати налаштування й нещодавні адреси на цьому комп’ютері.", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "Вихід після 5 хвилин бездіяльності, на цьому комп’ютері нічого не зберігається. Не позначайте цей пункт на спільному чи публічному комп’ютері.", "this device": "цей пристрій", "Device": "Пристрій", "IP": "IP", diff --git a/web/src/locales/zh-Hans.ts b/web/src/locales/zh-Hans.ts index 359d837..cdac21e 100644 --- a/web/src/locales/zh-Hans.ts +++ b/web/src/locales/zh-Hans.ts @@ -951,6 +951,8 @@ export const catalog: Catalog = { "Sign out all other sessions": "退出所有其他会话", "Signed in as": "已登录为", "This is my own device": "这是我自己的设备", + "Stay signed in, and keep settings and recent addresses on this computer.": "保持登录,并在这台电脑上保存设置和最近使用的地址。", + "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.": "闲置 5 分钟后自动退出,且不会在这台电脑上保存任何内容。在共用或公共电脑上请不要勾选此项。", "this device": "当前设备", "Device": "设备", "IP": "IP", diff --git a/web/src/views/Login.tsx b/web/src/views/Login.tsx index d07fe54..ebd9ec8 100644 --- a/web/src/views/Login.tsx +++ b/web/src/views/Login.tsx @@ -107,6 +107,15 @@ export function LoginPage() { {error} )} + {/* + Until /api/config says how this installation signs people in, the + fields are laid out but hidden. Showing the password form first and + then swapping it for the server's sign-in read as a glitch (#102). + Hidden, not left out, so the card keeps its size while it waits. The + key remounts the fields once the mode is known, so autoFocus lands + then: a hidden input can't take focus. + */} +
{!direct && (
@@ -130,14 +139,15 @@ export function LoginPage() {
)} +

{trustDevice - ? "Stay signed in, and keep settings and recent addresses on this computer." - : "Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one."} + ? t("Stay signed in, and keep settings and recent addresses on this computer.") + : t("Signed out after 5 minutes of inactivity, and nothing is kept on this computer. Leave this unticked on a shared or public one.")}