🐛 implement resource error handling and UI improvements across multiple pages
Browse files at this commit3d9f9c4133b8fd598894bf7223f17304b4ffb1bfParent: 84d770d- fix
- 🐛 implement resource error handling and UI improvements across multiple pages
1 changed file +0 -69
- .fix_prompt.txt +0 -69
.fix_prompt.txtdeleted+0 -69
| @@ -1,69 +0,0 @@ | |||
| 1 | -Fix these remaining issues in the SolidJS project. All builds must pass after changes. Use bun, never npm. | ||
| 2 | - | ||
| 3 | -### 1. notes-page.tsx — Add resource error handling | ||
| 4 | -- Import `formatApiError` from `@/api/client` and `Alert` from `@/components/ui/alert` | ||
| 5 | -- Below `<Suspense>` in the main content, add: | ||
| 6 | -```tsx | ||
| 7 | -<Show when={notes.error}> | ||
| 8 | - <Alert variant="destructive">{formatApiError(notes.error)}</Alert> | ||
| 9 | -</Show> | ||
| 10 | -``` | ||
| 11 | - | ||
| 12 | -### 2. events-page.tsx — Add resource error + fix raw button | ||
| 13 | -- Import `formatApiError` and `Alert` | ||
| 14 | -- Add error check below `<Suspense>` | ||
| 15 | -- Replace the raw `<button>` (create event toggle) with `<Button>` component | ||
| 16 | - | ||
| 17 | -### 3. exams-page.tsx — Add resource error handling | ||
| 18 | -- Import `formatApiError` and `Alert` | ||
| 19 | -- The exams resource is `list` variable. Add error check: `list.error` | ||
| 20 | - | ||
| 21 | -### 4. courses-page.tsx — Add resource error handling | ||
| 22 | -- Import `formatApiError` and `Alert` | ||
| 23 | -- Add error check for `courses` resource | ||
| 24 | - | ||
| 25 | -### 5. marks-page.tsx — Add resource error handling | ||
| 26 | -- Import `formatApiError` and `Alert` | ||
| 27 | -- Add error check for `mine` resource | ||
| 28 | - | ||
| 29 | -### 6. login-page.tsx | ||
| 30 | -- Remove `tabIndex={-1}` from the password toggle button | ||
| 31 | -- Replace hardcoded `aria-label={"Hide password"}/{"Show password"}` with `t()` using keys `"auth.hidePassword"` and `"auth.showPassword"` | ||
| 32 | -- Add `auth.hidePassword` and `auth.showPassword` to MessageKey type and EN/TR dictionaries in messages.ts | ||
| 33 | - | ||
| 34 | -### 7. register-page.tsx | ||
| 35 | -- Add a password confirmation field after the password field | ||
| 36 | -- Add a `confirmPassword` signal | ||
| 37 | -- Validate that passwords match before submit | ||
| 38 | -- Show inline error if they don't match | ||
| 39 | - | ||
| 40 | -### 8. admin-users-page.tsx | ||
| 41 | -- When `users()` is empty, show a dashed-border empty state instead of empty table | ||
| 42 | -- Use `t("admin.noUsers")` i18n key — add it to MessageKey type and EN/TR dicts | ||
| 43 | - | ||
| 44 | -### 9. live-monitor-page.tsx | ||
| 45 | -- Fix redundant ternary on line ~76: `setError(err instanceof ApiError ? formatApiError(err, locale()) : formatApiError(err, locale()))` → just `setError(formatApiError(err, locale()))` | ||
| 46 | -- Add loading indicator when `snapshot()` is null and `!error()`: show `<PageSpinner />` | ||
| 47 | - | ||
| 48 | -### 10. profile-page.tsx | ||
| 49 | -- Remove `void navigate({ to: "/" })` after save — let user stay on profile page | ||
| 50 | - | ||
| 51 | -### 11. course-detail-page.tsx | ||
| 52 | -- Add `ConfirmDialog` before calling `deleteCourseEnrollmentByUserId` for roster removal | ||
| 53 | -- Follow the same pattern as `attendance-table.tsx`'s confirm dialog | ||
| 54 | - | ||
| 55 | -### 12. exam-detail-page.tsx → use `useParams` | ||
| 56 | -- Replace `decodeURIComponent(location().pathname.split("/")[2] ?? "")` with `useParams(from: "/exams/$id")` | ||
| 57 | -- Same for `exam-room-page.tsx` and `live-monitor-page.tsx` | ||
| 58 | - | ||
| 59 | -### 13. attendance-status-picker.tsx | ||
| 60 | -- Replace `.map()` with `<For>` component for rendering options | ||
| 61 | - | ||
| 62 | -### 14. exam-form.tsx | ||
| 63 | -- Add `id` and `aria-label` to the time input fields | ||
| 64 | - | ||
| 65 | -### 15. event-detail-page.tsx | ||
| 66 | -- Fix error message when marking attendance with empty user ID: instead of `throw new Error(t("events.userId"))`, use `setError(t("events.userIdRequired"))` and `return` | ||
| 67 | -- Add `events.userIdRequired` to MessageKey and dictionaries | ||
| 68 | - | ||
| 69 | -Return a summary of all changes made. | ||