fix: no proper loading feedback on forms

This commit is contained in:
juancwu 2026-02-14 23:12:43 +00:00
commit d224f5a10a
27 changed files with 192 additions and 57 deletions

View file

@ -79,7 +79,7 @@ templ Dashboard(spaces []*model.Space) {
Cancel
}
}
@button.Button(button.Props{Type: button.TypeSubmit}) {
@button.Submit() {
Create
}
}

View file

@ -89,9 +89,7 @@ templ AppSettings(hasPassword bool, errorMsg string) {
}
}
}
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
if hasPassword {
Change Password
} else {

View file

@ -261,7 +261,7 @@ templ AddBudgetForm(spaceID string, tags []*model.Tag) {
})
</div>
<div class="flex justify-end">
@button.Button(button.Props{Type: button.TypeSubmit}) {
@button.Submit() {
Save
}
</div>
@ -374,7 +374,7 @@ templ EditBudgetForm(spaceID string, b *model.BudgetWithSpent, tags []*model.Tag
}
</div>
<div class="flex justify-end">
@button.Button(button.Props{Type: button.TypeSubmit}) {
@button.Submit() {
Save
}
</div>

View file

@ -63,9 +63,7 @@ templ SpaceListDetailPage(space *model.Space, list *model.ShoppingList, items []
"autocomplete": "off",
},
})
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
Add Item
}
</form>

View file

@ -27,9 +27,7 @@ templ SpaceListsPage(space *model.Space, cards []model.ListCardData) {
Name: "name",
Placeholder: "New list name...",
})
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
Create
}
</form>

View file

@ -46,9 +46,7 @@ templ SpaceSettingsPage(space *model.Space, members []*model.SpaceMemberWithProf
"required": true,
},
})
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
Save
}
</form>
@ -110,9 +108,7 @@ templ SpaceSettingsPage(space *model.Space, members []*model.SpaceMemberWithProf
"required": true,
},
})
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
@icon.UserPlus(icon.Props{Class: "size-4"})
Invite
}

View file

@ -30,9 +30,7 @@ templ SpaceTagsPage(space *model.Space, tags []*model.Tag) {
"autocomplete": "off",
},
})
@button.Button(button.Props{
Type: button.TypeSubmit,
}) {
@button.Submit() {
Create
}
</form>

View file

@ -57,8 +57,7 @@ templ Auth(errorMsg string) {
}
}
}
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
FullWidth: true,
}) {
Continue with Email

View file

@ -39,10 +39,9 @@ templ MagicLinkSent(email string) {
>
@csrf.Token()
<input type="hidden" name="email" value={ email }/>
@button.Button(button.Props{
@button.Submit(button.Props{
Variant: button.VariantOutline,
FullWidth: true,
Type: button.TypeSubmit,
}) {
Resend magic link
}

View file

@ -76,8 +76,7 @@ templ AuthPassword(errorMsg string) {
</a>
</div>
}
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
FullWidth: true,
}) {
Sign In

View file

@ -66,8 +66,7 @@ templ OnboardingWelcome() {
<form action="/auth/logout" method="POST" class="text-center mt-6">
@csrf.Token()
<span class="text-sm text-muted-foreground">Not you? </span>
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
Variant: button.VariantLink,
Class: "p-0 h-auto text-sm",
}) {
@ -138,8 +137,7 @@ templ OnboardingName(errorMsg string) {
@icon.ArrowLeft()
Back
}
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
Class: "grow",
}) {
Continue
@ -150,8 +148,7 @@ templ OnboardingName(errorMsg string) {
<form action="/auth/logout" method="POST" class="text-center mt-6">
@csrf.Token()
<span class="text-sm text-muted-foreground">Not you? </span>
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
Variant: button.VariantLink,
Class: "p-0 h-auto text-sm",
}) {
@ -222,8 +219,7 @@ templ OnboardingSpace(name string, errorMsg string) {
@icon.ArrowLeft()
Back
}
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
Class: "grow",
}) {
Create Space
@ -233,8 +229,7 @@ templ OnboardingSpace(name string, errorMsg string) {
<form action="/auth/logout" method="POST" class="text-center mt-6">
@csrf.Token()
<span class="text-sm text-muted-foreground">Not you? </span>
@button.Button(button.Props{
Type: button.TypeSubmit,
@button.Submit(button.Props{
Variant: button.VariantLink,
Class: "p-0 h-auto text-sm",
}) {