Skip to content

v0.1.4

Choose a tag to compare

@github-actions github-actions released this 12 Mar 23:06

OOB Toast (HTMX error handlers)

These all fire through the exception handlers in main.py.

  • CredentialsError (401 toast)

    1. Go to /account/login
    2. Enter a valid email format but wrong credentials
    3. Submit — toast renders: "Invalid email or password"
  • RequestValidationError (422)

    1. Go to /account/login
    2. Leave both fields blank, submit
    3. Toast is rendered with validation messages
  • PasswordValidationError (422)

    1. Go to /account/register
    2. Fill in name/email, enter a weak password like abc, different confirm password
    3. Submit — toast renders: "The passwords you entered do not match"
  • RateLimitError (429 toast)

    1. Go to /account/login
    2. Submit wrong credentials rapidly ~6 times (depends on your limiter config)
    3. Eventually toast renders: "Too many attempts..." with Retry-After
  • HTTPException (business logic errors)

    1. Log in, go to an org page
    2. Try to create a role with a name that already exists (e.g. "Owner")
    3. Toast: "A role with that name already exists"
  • StarletteHTTPException (404 toast via HTMX)

    • Harder to trigger naturally. You can use browser devtools to fire an HTMX request to a
      non-existent route:
      htmx.ajax('GET', '/nonexistent', {target: 'body', headers: {'HX-Request': 'true'}})

OOB Toasts (HTMX success — append_toast)

These return the partial content + an appended toast in the same response.

  • Profile update

    1. Log in, go to /user/profile
    2. Click Edit, change your name, Save
    3. Toast: "Profile updated successfully."
  • Role CRUD

    1. Go to an org page where you're Owner
    2. Create a new role — toast: "Role created successfully."
    3. Edit that role's name — toast: "Role updated successfully."
    4. Delete that role — toast: "Role deleted successfully."
  • [] User role update

    1. On the org page, edit a member's roles (check/uncheck roles)
    2. Save — toast: "User role updated successfully."
  • [] Remove member

    1. On the org page, remove a non-owner member
    2. Toast: "User removed from organization."
  • [] Send invitation

    1. On the org page, invite a new email address
    2. Toast: "Invitation sent successfully."
  • Email update (HTMX path)

    1. On /user/profile, enter a new email in the Update Email form
    2. Submit — toast: "Confirmation email sent. Check your inbox."

    Flash Cookie (PRG redirects — full page load)

    These set a flash_message cookie that the JS in base.html reads on the next page load.

  • Confirm email update

    1. Trigger an email update from profile
    2. Click the confirmation link from the email
    3. You'll be redirected to /user/profile — toast: "Your email address has been successfully
      updated."
  • [] Forgot password

    1. Go to /account/forgot_password (or use the Change Password section on profile)
    2. Submit your email
    3. Redirected to ?show_form=false — toast: "If an account exists with this email, a password reset
      link will be sent."
  • Update organization name

    1. On the org page, edit the org name and save
    2. Page redirects via HX-Redirect — toast: "Organization updated successfully."
  • Delete organization

    1. On the org page, delete the organization
    2. Redirected to /user/profile — toast: "Organization deleted successfully."

JS showToast() (client-side validation)

  • Avatar file validation

    1. Go to /user/profile, click Edit
    2. Try uploading a file that's too large — toast: "File size must be less than X MB"
    3. Try uploading a .txt file — toast: "File format must be one of: ..."
    4. Try a very small image (e.g. 1x1 px) — toast: "Image dimensions must be at least ..."

    Quick checklist

    ┌────────────────┬─────────────────────────────────────────────┬────────────────────────────────┐
    │ Mechanism │ Trigger │ Where to look │
    ├────────────────┼─────────────────────────────────────────────┼────────────────────────────────┤
    │ toast_response │ Any HTMX error (login, register, │ Bottom-right toast │
    │ │ validation) │ │
    ├────────────────┼─────────────────────────────────────────────┼────────────────────────────────┤
    │ append_toast │ Any HTMX success mutation (profile, roles, │ Bottom-right toast alongside │
    │ │ members, invitations) │ updated partial │
    ├────────────────┼─────────────────────────────────────────────┼────────────────────────────────┤
    │ Flash cookie │ PRG redirects (email confirm, forgot │ Bottom-right toast after page │
    │ │ password, org update/delete) │ load │
    ├────────────────┼─────────────────────────────────────────────┼────────────────────────────────┤
    │ showToast() JS │ Avatar file picker validation │ Bottom-right toast, no network │
    │ │ │ request │
    └────────────────┴─────────────────────────────────────────────┴────────────────────────────────┘