Skip to content

Lead the login form with the code login - #40

Merged
JeroenDeDauw merged 1 commit into
masterfrom
feature/code-login-primary
Sep 3, 2026
Merged

JeroenDeDauw merged 1 commit into
masterfrom
feature/code-login-primary

Conversation

@JeroenDeDauw

@JeroenDeDauw JeroenDeDauw commented Sep 3, 2026

Copy link
Copy Markdown
Member

The login form now leads with the member route on wikis that offer the code route. The address box
and "Continue with email" come first, that button is the form's primary one, focus lands in the
address box, and the password form follows under a divider reading "or log in with a password" in
place of "or". Enter submits whatever was filled in: an address asks for a code, a password logs
in. The account creation form and the code entry screen are untouched.

Done in the form description rather than site CSS, which would move the boxes but leave document
order, tab order, focus on load and what Enter submits where they were.

How:

  • Negative weights on the member fields. Core weights none of its own boxes below zero, so weights
    settle document and tab order at once. MobileFrontend's watermark, which led the mobile form at
    weight zero, is re-weighted to stay above the member section.
  • autofocus on the address box. Core adds its own to the username or password box after every
    handler has run, where nothing can unset it; the first in document order wins.
  • A nameless submit button, first in the form and clipped out of sight, is what Enter submits
    through. Named after neither route, it leaves the choice to the filled box, as
    Ask for a code when Enter is pressed in the address box #39 made possible. Core reads nothing from
    its own button's name.
  • The divider is described only where core described a password box, so a single-sign-on-only wiki
    gets no divider rather than a wrong one.

Verified in Chromium on Vector and Minerva: focus lands in the address box on load, also with core's
autofocus on the password box; Enter in the address box reaches the code screen posting no button
name; Enter in the password box logs in; the hidden field leaves no gap and takes no pointer hits.

Considered, omitted:

  • Hiding the password form: an opt-in setting of its own.
  • A plain "or" divider for wikis without a password form.
  • Demoting single sign-on buttons: which route a wiki with several recommends is not this
    extension's call.
  • formnovalidate on the hidden button: it would loosen the address box's own validation, which
    core's button did not have either.
  • Any JavaScript.

AI-authored — Claude Code, Opus 5 (max), reviewed and revised by Fable 5.1 (max); detailed spec from @JeroenDeDauw, no revisions; diff not yet human-reviewed; PHPUnit, phpcs and phpstan run locally, new tests checked against mutations of the code they cover, both login routes and the keyboard paths driven in Chromium on Vector and Minerva, CI green.

@codecov-commenter

codecov-commenter commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.71%. Comparing base (d4222f4) to head (79a59f2).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #40      +/-   ##
============================================
+ Coverage     87.37%   87.71%   +0.34%     
- Complexity      628      634       +6     
============================================
  Files            71       71              
  Lines          2210     2239      +29     
============================================
+ Hits           1931     1964      +33     
+ Misses          279      275       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The login form now leads with the member route on wikis that offer the code route. The address box
and "Continue with email" come first, that button is the form's primary one, focus lands in the
address box, and the password form follows under a divider reading "or log in with a password" in
place of "or". Enter submits whatever was filled in: an address asks for a code, a password logs
in. The account creation form and the code entry screen are untouched.

Done in the form description rather than site CSS, which would move the boxes but leave document
order, tab order, focus on load and what Enter submits where they were.

How:

* Negative weights on the member fields. Core weights none of its own boxes below zero, so weights
  settle document and tab order at once. MobileFrontend's watermark, which led the mobile form at
  weight zero, is re-weighted to stay above the member section.
* `autofocus` on the address box. Core adds its own to the username or password box after every
  handler has run, where nothing can unset it; the first in document order wins.
* A nameless submit button, first in the form and clipped out of sight, is what Enter submits
  through. Named after neither route, it leaves the choice to the filled box, as
  #39 made possible. Core reads nothing from
  its own button's name.
* The divider is described only where core described a password box, so a single-sign-on-only wiki
  gets no divider rather than a wrong one.

Verified in Chromium on Vector and Minerva: focus lands in the address box on load, also with core's
autofocus on the password box; Enter in the address box reaches the code screen posting no button
name; Enter in the password box logs in; the hidden field leaves no gap and takes no pointer hits.

Considered, omitted:

* Hiding the password form: an opt-in setting of its own.
* A plain "or" divider for wikis without a password form.
* Demoting single sign-on buttons: which route a wiki with several recommends is not this
  extension's call.
* `formnovalidate` on the hidden button: it would loosen the address box's own validation, which
  core's button did not have either.
* Any JavaScript.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@JeroenDeDauw
JeroenDeDauw force-pushed the feature/code-login-primary branch from af364a5 to 79a59f2 Compare September 3, 2026 23:33
@JeroenDeDauw
JeroenDeDauw marked this pull request as ready for review September 3, 2026 23:39
@JeroenDeDauw
JeroenDeDauw merged commit e53204d into master Sep 3, 2026
6 checks passed
@JeroenDeDauw
JeroenDeDauw deleted the feature/code-login-primary branch September 3, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants