Procházet zdrojové kódy

fix: show the header login link on narrow screens

Since picocrank 1.38.0 the header hides the user button's text below
768px and keeps only its icon. The login link has no icon, so on phones
it was rendered as an empty, invisible button and there was no way to
reach the login page from the header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6U1CRbWasL1BAqbi7Rmsb
Claude před 5 hodinami
rodič
revize
a1def3ba8e

+ 9 - 0
frontend/style.css

@@ -48,3 +48,12 @@ section.small {
 .sm-transparent-footer footer span {
 	background-color: transparent;
 }
+
+/*
+ * Picocrank hides the header user button's text on narrow screens and keeps only
+ * its icon. The login link has no icon, so it would be left as an empty, invisible
+ * button, leaving users on phones with no way to log in.
+ */
+header .header-actions .login-link span {
+	display: inline;
+}

+ 17 - 0
integration-tests/tests/localAuth/localAuth.mjs

@@ -8,11 +8,15 @@ import {
 describe('config: localAuth', function () {
   this.timeout(30000) // Increase timeout to 30 seconds
 
+  let originalWindowRect
+
   before(async function () {
+    originalWindowRect = await webdriver.manage().window().getRect()
     await runner.start('localAuth')
   })
 
   after(async () => {
+    await webdriver.manage().window().setRect(originalWindowRect)
     await runner.stop()
   })
 
@@ -99,4 +103,17 @@ describe('config: localAuth', function () {
       console.log('Login form not found - skipping login test')
     }
   })
+
+  it('Header login link shows its text on narrow screens', async function () {
+    await webdriver.manage().window().setRect({ width: 400, height: 800 })
+    await webdriver.get(runner.baseUrl())
+
+    const loginLink = await webdriver.wait(until.elementLocated(By.css('header .login-link')), 10000)
+    await webdriver.wait(until.elementIsVisible(loginLink), 5000)
+
+    expect((await loginLink.getText()).trim()).to.equal('Login')
+
+    const linkSize = await loginLink.getRect()
+    expect(linkSize.width).to.be.greaterThan(30)
+  })
 })