LessonPane empty-attempt New Attempt [disabled]=isLoading() is unreachable #1071

Closed
opened 2026-08-13 06:49:46 +00:00 by spikerj · 1 comment
Owner

In lesson-pane.html the empty-attempt arm is the @else of @if (isLoading() && !hasAttempt()) / @else if (hasAttempt()). That means the empty-attempt block (and its New Attempt button) only mounts when !isLoading() && !hasAttempt().

The button still binds [disabled]="isLoading()". That expression is never true while the button is in the DOM — flipping isLoading to true unmounts empty-attempt and paints the loading spinner instead.

Pinned by lesson-pane.html-leftovers.spec.ts ("shows loading while a lesson is selected but no attempt exists"): after New Attempt, setting isLoading true asserts .loading is present and .empty-attempt is gone.

Fix: drop the dead [disabled] (loading already replaces the button), or invert the @if so empty-attempt stays mounted and the button disables during the in-flight request.

In `lesson-pane.html` the empty-attempt arm is the `@else` of `@if (isLoading() && !hasAttempt())` / `@else if (hasAttempt())`. That means the empty-attempt block (and its New Attempt button) only mounts when `!isLoading() && !hasAttempt()`. The button still binds `[disabled]="isLoading()"`. That expression is never true while the button is in the DOM — flipping `isLoading` to true unmounts empty-attempt and paints the loading spinner instead. Pinned by `lesson-pane.html-leftovers.spec.ts` ("shows loading while a lesson is selected but no attempt exists"): after New Attempt, setting `isLoading` true asserts `.loading` is present and `.empty-attempt` is gone. Fix: drop the dead `[disabled]` (loading already replaces the button), or invert the `@if` so empty-attempt stays mounted and the button disables during the in-flight request.
Author
Owner

Resolved in spikersoft-angular PR #818 (merged to master). Dropped the unreachable empty-attempt New Attempt [disabled]=isLoading(); loading still replaces that arm. Closing.

Resolved in spikersoft-angular [PR #818](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/818) (merged to `master`). Dropped the unreachable empty-attempt New Attempt `[disabled]=isLoading()`; loading still replaces that arm. Closing.
Sign in to join this conversation.