Skip to content

refactor: login page (@miodec)#7595

Open
Miodec wants to merge 27 commits intomasterfrom
solid-login
Open

refactor: login page (@miodec)#7595
Miodec wants to merge 27 commits intomasterfrom
solid-login

Conversation

@Miodec
Copy link
Member

@Miodec Miodec commented Mar 8, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 8, 2026 20:03
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Mar 8, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 8, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the legacy login/register page from imperative DOM handlers + static HTML/SCSS into SolidJS components, centralizing page UI state (loader/disabled inputs) in a small store.

Changes:

  • Replace pages/login.ts + html/pages/login.html + styles/login.scss with SolidJS LoginPage/Login/Register components mounted via <mount>.
  • Add stores/login.ts to manage login page loader + input enabled state; wire into page lifecycle + google sign-up modal.
  • Simplify ready.ts server configuration sync behavior; adjust firebase/auth error messaging flow.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
frontend/src/ts/stores/login.ts New shared state for login page loader + input enable/disable + reset hook.
frontend/src/ts/ready.ts Removes login-page-specific DOM toggling; keeps config sync.
frontend/src/ts/pages/login.ts Removes legacy imperative login page implementation.
frontend/src/ts/modals/google-sign-up.ts Switches from page module helpers to store-based UI reset.
frontend/src/ts/index.ts Drops legacy login event-handler import.
frontend/src/ts/event-handlers/login.ts Removes legacy “forgot password” click handler.
frontend/src/ts/controllers/page-controller.ts Converts login route to solidPage("login") and resets login state before show.
frontend/src/ts/components/ui/ValidatedInput.tsx Extends input props (type/autocomplete/name/focus/disabled) for new login UI.
frontend/src/ts/components/pages/login/LoginPage.tsx New Solid login page with loader + server-config gating.
frontend/src/ts/components/pages/login/Login.tsx New Solid login form (providers + email/password).
frontend/src/ts/components/pages/login/Register.tsx New Solid registration form with validations + disposable-email check.
frontend/src/ts/components/mount.tsx Registers loginpage mount component.
frontend/src/ts/components/common/Separator.tsx Adds optional text variant for separator (used in login).
frontend/src/ts/firebase.ts Updates translated firebase auth error messages and adds fallback.
frontend/src/styles/login.scss Removes legacy login page SCSS.
frontend/src/styles/index.scss Stops importing removed login.scss.
frontend/src/index.html Replaces <load src="html/pages/login.html" /> with mount-based login page container.
frontend/src/html/pages/login.html Removes legacy static login page HTML.
frontend/src/ts/auth.tsx Removes internal error toast emission from provider sign-in helper.

Comment on lines +15 to +26
<div
class={cn(
"flex place-items-center gap-4",
props.vertical ? "flex-col" : "flex-row",
props.class,
)}
>
<div
class={cn(
props.vertical ? "h-full w-1" : "h-1 w-full",
`rounded bg-sub-alt`,
)}
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

place-items-center only applies to CSS grid, not flex, so it won’t center items here. Also, using w-full for both line segments in a flex row is prone to overflow/shrinking quirks; use flex growth (e.g. flex-1) + fixed thickness instead so the separator reliably fills remaining space around the text.

Copilot uses AI. Check for mistakes.
Co-authored-by: Miodec <jack@monkeytype.com>
@socket-security
Copy link

socket-security bot commented Mar 12, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​leonabcd123/​modern-caps-lock@​2.2.2 ⏵ 3.0.470 +110098 +1195 +270
Added@​tanstack/​solid-form@​1.28.4881008399100

View full report

@Miodec Miodec requested a review from Copilot March 12, 2026 14:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 40 changed files in this pull request and generated 12 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

frontend/src/ts/modals/google-sign-up.ts:75

  • When a provider sign-in creates a new user, firebase.signInWithPopup keeps ignoreAuthCallback=true and shows this modal, but there’s no longer any coupling to the login UI state. Result: the login page can re-enable inputs while the sign-up modal is still active. Consider toggling the shared login-page “inputs enabled” signal here (disable on show, re-enable in hide/apply finally), or otherwise exposing a completion hook so the login page waits for this flow to finish.
async function hide(): Promise<void> {
  void modal.hide({
    afterAnimation: async () => {
      resetIgnoreAuthCallback();
      if (signedInUser !== undefined) {
        showNoticeNotification("Sign up process cancelled", {
          durationMs: 5000,
        });
        if (getAdditionalUserInfo(signedInUser)?.isNewUser) {
          await Ape.users.delete();
          await signedInUser?.user.delete().catch(() => {
            //user might be deleted already by the server
          });
        }
        AccountController.signOut();
        signedInUser = undefined;
      }
    },
  });
}

You can also share your feedback on Copilot code review. Take the survey.

type="checkbox"
checked={checked()}
disabled={props.disabled}
class="hidden"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying checkbox <input> is display:none (class="hidden"), which removes it from tab order and screen readers in many browsers, making the control keyboard-inaccessible. Prefer a visually-hidden pattern (e.g., sr-only / offscreen / opacity-0 + absolute) so the real input remains focusable/accessible.

Suggested change
class="hidden"
class="sr-only"

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +55
onSubmit: async ({ value }) =>
doLogin(async () =>
signIn(value.email, value.password, value.rememberMe),
),
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message formatting adds an extra space before the colon ("with Google : ..."). Consider formatting as "with Google: ..." to avoid awkward notifications.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 41 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants