Show rating changes on puzzle completion (#146) (#154)

* Show rating changes in flashes and session UI (#146)

- Flash the new rating and delta on every rated completion, with a
  dedicated success flash kind for solved puzzles
- Move flash notifications to the top-left
- Add a colour-coded rating-change pill and show the current rating with
  the session's net change in the train session bar
- Show the user's rating and change beside the puzzle rating after an
  attempt, and show the finishing rating in the last-session summary

* fix header component and start reusing it

* Hide the sign-up link on the prelaunch admin login

The header refactor dropped the @prelaunch guard, so the gated admin login linked to the public registration page again.
This commit is contained in:
2026-11-12 21:13:54 +01:00
committed by GitHub
parent 9e76045862
commit 20b53dae6f
11 changed files with 135 additions and 49 deletions
+14 -12
View File
@@ -7,18 +7,20 @@ defmodule ChesstrainerWeb.UserLive.Login do
<Layouts.app flash={@flash} current_scope={@current_scope}>
<div class="mx-auto max-w-sm space-y-4">
<div class="text-center">
<h1 class="settings-header">Log in</h1>
<%= if @current_scope do %>
You need to reauthenticate to perform sensitive actions on your account.
<% else %>
<p :if={!@prelaunch} class="settings-subtitle my-4">
Don't have an account? <.link
navigate={~p"/users/register"}
class="font-semibold text-primary-text hover:underline"
phx-no-format
>Sign up</.link> for an account now.
</p>
<% end %>
<.header>
Log in
<:subtitle :if={@current_scope || !@prelaunch}>
<%= if @current_scope do %>
You need to reauthenticate to perform sensitive actions on your account.
<% else %>
Don't have an account? <.link
navigate={~p"/users/register"}
class="font-semibold text-primary-text hover:underline"
phx-no-format
>Sign up</.link> for an account now.
<% end %>
</:subtitle>
</.header>
</div>
<.form