fix(frontend): harden route-level error handling and i18n compliance#319
Merged
fix(frontend): harden route-level error handling and i18n compliance#319
Conversation
040d6fd to
2420b05
Compare
- 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>
4c770c5 to
a5415ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
users/[id]androles/[id]server loads now checkresponse.okon secondary API fetches (roles list, permissions list). On failure, logs a warning and passesrolesLoadFailed/permissionsLoadFailedflags so pages render with partial data instead of silently hiding failures or crashing entirely.m.*()calls. AddedserverError_*keys to bothen.jsonandcs.json. Paraglide middleware provides locale context viaAsyncLocalStorage, so messages resolve correctly server-side.reset-password(why no auth redirect -- needed for invite flow) andverify-email(why client-sideonMountmutation instead of form action).Closes #302
Test plan
pnpm run check-- 0 errorspnpm run lint-- cleanpnpm run format-- cleanusers/[id]page still renders when roles API returns 500 (shows user info, role assignment section shows empty)roles/[id]page still renders when permissions API returns 500 (shows role info, permissions section shows empty)🤖 Generated with Claude Code