Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix(login): keep the sign-in form visible on phones (#4645)

Slai.life2e647d44caed
diff --git a/frontend/src/views/auth/Login.mobile.test.mjs b/frontend/src/views/auth/Login.mobile.test.mjs
new file mode 100644
index 000000000..9612f041a
--- /dev/null
+++ b/frontend/src/views/auth/Login.mobile.test.mjs
@@ -0,0 +1,19 @@
+import assert from 'node:assert/strict'
+import { readFileSync } from 'node:fs'
+import test from 'node:test'
+
+const source = readFileSync(new URL('./Login.vue', import.meta.url), 'utf8')
+const tabletStyles = source.slice(
+ source.indexOf('@media (max-width: 768px)'),
+ source.indexOf('@media (max-width: 480px)'),
+)
+const phoneStyles = source.slice(source.indexOf('@media (max-width: 480px)'))
+
+test('phone login puts the form before the showcase and reserves room for the header', () => {
+ assert.match(tabletStyles, /\.login-layout\s*\{[\s\S]*?flex-direction:\s*column;[\s\S]*?padding-top:\s*64px;/)
+ assert.match(tabletStyles, /\.form-section\s*\{[\s\S]*?order:\s*-1;/)
+})
+
+test('narrow login headers use icon-only links to avoid overlapping the logo', () => {
+ assert.match(phoneStyles, /\.header-links\s*\{[\s\S]*?\.link-text\s*\{\s*display:\s*none;/)
+})
\ No newline at end of file
diff --git a/frontend/src/views/auth/Login.vue b/frontend/src/views/auth/Login.vue
index 12324a892..51236b3de 100755
--- a/frontend/src/views/auth/Login.vue
+++ b/frontend/src/views/auth/Login.vue
@@ -1670,6 +1670,8 @@ onMounted(async () => {
@media (max-width: 768px) {
.login-layout {
flex-direction: column;
+ padding-top: 64px;
+ box-sizing: border-box;
}
.knowledge-node:nth-of-type(n + 9) {
@@ -1713,6 +1715,7 @@ onMounted(async () => {
}
.form-section {
+ order: -1;
flex: 0 0 auto;
padding: 24px;
}
@@ -1778,6 +1781,10 @@ onMounted(async () => {
gap: 6px;
flex-wrap: wrap;
+ .link-text {
+ display: none;
+ }
+
.header-link {
padding: 7px 10px;
font-size: var(--app-text-xs);