Skip to content

Comments

fix(frontend): harden route-level error handling and i18n compliance#319

Merged
fpindej merged 3 commits intomasterfrom
fix/route-issues-302
Feb 24, 2026
Merged

fix(frontend): harden route-level error handling and i18n compliance#319
fpindej merged 3 commits intomasterfrom
fix/route-issues-302

Conversation

@fpindej
Copy link
Owner

@fpindej fpindej commented Feb 24, 2026

Summary

  • Secondary fetch error handling: users/[id] and roles/[id] server loads now check response.ok on secondary API fetches (roles list, permissions list). On failure, logs a warning and passes rolesLoadFailed/permissionsLoadFailed flags so pages render with partial data instead of silently hiding failures or crashing entirely.
  • i18n compliance: All hardcoded English error fallbacks in server load functions replaced with paraglide m.*() calls. Added serverError_* keys to both en.json and cs.json. Paraglide middleware provides locale context via AsyncLocalStorage, so messages resolve correctly server-side.
  • Documentation: Added explanatory comments to reset-password (why no auth redirect -- needed for invite flow) and verify-email (why client-side onMount mutation instead of form action).

Closes #302

Test plan

  • All 217 existing frontend tests pass
  • pnpm run check -- 0 errors
  • pnpm run lint -- clean
  • pnpm run format -- clean
  • Manual: verify users/[id] page still renders when roles API returns 500 (shows user info, role assignment section shows empty)
  • Manual: verify roles/[id] page still renders when permissions API returns 500 (shows role info, permissions section shows empty)
  • Manual: verify error pages display localized messages when backend returns errors in non-English locale

🤖 Generated with Claude Code

@fpindej fpindej added the frontend Frontend (SvelteKit) label Feb 24, 2026
@fpindej fpindej force-pushed the fix/route-issues-302 branch from 040d6fd to 2420b05 Compare February 24, 2026 05:27
fpindej and others added 3 commits February 24, 2026 06:40
- Add response.ok checks on secondary API fetches in users/[id] and
  roles/[id] server loads; surface rolesLoadFailed/permissionsLoadFailed
  flags so pages render with partial data instead of silently hiding
  failures or crashing entirely
- Replace all hardcoded English error fallbacks in server load functions
  with paraglide m.*() calls (paraglide middleware provides locale
  context via AsyncLocalStorage, so messages resolve correctly server-side)
- Add i18n keys (serverError_*) to en.json and cs.json for server-side
  error messages
- Document why reset-password intentionally skips the auth redirect
  (needed for admin invite flow)
- Document why verify-email uses client-side onMount mutation instead
  of a form action (one-shot POST with loading/success/error states)

Closes #302

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Display warning banners using Alert component when secondary API
fetches fail, so users understand why role assignment or permission
editing is unavailable instead of seeing empty state silently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This key was added anticipating a primary fetch scenario for permissions,
but permissions is only ever a secondary fetch with graceful degradation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fpindej fpindej force-pushed the fix/route-issues-302 branch from 4c770c5 to a5415ce Compare February 24, 2026 05:40
@fpindej fpindej enabled auto-merge (squash) February 24, 2026 05:41
@fpindej fpindej merged commit 6865e3a into master Feb 24, 2026
4 checks passed
@fpindej fpindej deleted the fix/route-issues-302 branch February 24, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend (SvelteKit)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(frontend): route-level issues — silent failures, hardcoded English, verify-email

1 participant