fix/register-delay #9

Merged
nrupard merged 18 commits from fix/register-delay into main 2026-04-14 16:51:59 +02:00
Owner
No description provided.
The spawn-wrapped oninput handlers raced with the controlled `value:`
binding: clicking submit before the deferred set ran sent empty signals
to the server, producing a spurious "Username must be at least 3
characters" error and clearing the inputs on re-render.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Login and register pages render via SSR and are interactive natively
before WASM hydrates. Keystrokes landed in the DOM but never fired
Dioxus oninput, so the Rust signals stayed empty — clicking Submit
quickly would send empty strings and hit the "Username must be at
least 3 characters" validation. Reading the input values directly
from the DOM at submit time recovers whatever the user typed,
regardless of hydration state. Also drops the controlled `value:`
binding so a post-error re-render doesn't clear the fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows "Loading, please wait…" on a greyed-out button during SSR and
the pre-hydration client render so users can't submit before event
listeners are wired. A cfg-gated use_hook spawns a microtask that
flips the hydrated signal once Rust is in control.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Relying on Tailwind's disabled:* variants left the button looking fully
interactive during SSR because the browser wasn't applying the disabled
pseudo-class. Switched to a plain conditional class so the greyed-out /
not-allowed appearance shows up regardless of how the disabled attribute
is emitted, and short-circuit do_login/do_register when not hydrated so
a stray click during the locked state is a no-op. Reading the signals
at the top of render also makes the reactive subscription explicit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nrupard changed title from WIP: fix/register-delay to fix/register-delay 2026-04-14 16:51:55 +02:00
nrupard deleted branch fix/register-delay 2026-04-14 16:51:59 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!9
No description provided.