From c0950bca978554ba1eb162baaf8bd3096331a698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Sun, 12 Jul 2026 18:06:24 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20UI/UX=20fixes=20and=20err?= =?UTF-8?q?or=20handling=20across=20pages=20-=20Added=20resource=20error?= =?UTF-8?q?=20alerts=20to=20notes,=20events,=20exams,=20courses,=20marks?= =?UTF-8?q?=20pages=20-=20Replaced=20raw=20button=20with=20Button=20compon?= =?UTF-8?q?ent=20in=20events-page=20-=20Removed=20PaginatedList=20from=20d?= =?UTF-8?q?ashboard,=20added=20resource=20error=20handling,=20cleaned=20im?= =?UTF-8?q?ports=20-=20Removed=20tabIndex=20from=20login,=20added=20i18n?= =?UTF-8?q?=20for=20password=20toggle=20aria-label=20-=20Redesigned=20regi?= =?UTF-8?q?ster=20page=20with=20centered=20card=20layout,=20password=20tog?= =?UTF-8?q?gle,=20confirm=20password=20field=20-=20Added=20confirmPassword?= =?UTF-8?q?/passwordMismatch/showPassword/hidePassword=20i18n=20keys=20-?= =?UTF-8?q?=20Added=20admin.noUsers=20empty=20state=20for=20admin=20users?= =?UTF-8?q?=20page=20-=20Replaced=20.map()=20with=20=20in=20attendanc?= =?UTF-8?q?e-status-picker=20-=20Removed=20auto-redirect=20after=20profile?= =?UTF-8?q?=20save?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .fix_prompt.txt | 69 ++++++ .../events/attendance-status-picker.tsx | 9 +- src/i18n/messages.ts | 15 ++ src/pages/admin-users-page.tsx | 19 +- src/pages/courses-page.tsx | 4 + src/pages/dashboard-page.tsx | 215 +++++++----------- src/pages/events-page.tsx | 13 +- src/pages/exams-page.tsx | 5 + src/pages/login-page.tsx | 3 +- src/pages/marks-page.tsx | 4 + src/pages/notes-page.tsx | 4 + src/pages/profile-page.tsx | 3 - src/pages/register-page.tsx | 90 +++++--- 13 files changed, 264 insertions(+), 189 deletions(-) create mode 100644 .fix_prompt.txt diff --git a/.fix_prompt.txt b/.fix_prompt.txt new file mode 100644 index 0000000..35e57eb --- /dev/null +++ b/.fix_prompt.txt @@ -0,0 +1,69 @@ +Fix these remaining issues in the SolidJS project. All builds must pass after changes. Use bun, never npm. + +### 1. notes-page.tsx — Add resource error handling +- Import `formatApiError` from `@/api/client` and `Alert` from `@/components/ui/alert` +- Below `` in the main content, add: +```tsx + + {formatApiError(notes.error)} + +``` + +### 2. events-page.tsx — Add resource error + fix raw button +- Import `formatApiError` and `Alert` +- Add error check below `` +- Replace the raw ` - - {t("common.pageOf", { page: safePage() + 1, total: totalPages() })} - - - - - - - ); -} - function StatTile(props: { label: string; value: string; diff --git a/src/pages/events-page.tsx b/src/pages/events-page.tsx index 868b2da..e56bb56 100644 --- a/src/pages/events-page.tsx +++ b/src/pages/events-page.tsx @@ -2,6 +2,8 @@ import { For, Show, Suspense, createResource, createSignal } from "solid-js"; import { getEvents } from "@/api/getEvents"; import { postEvent } from "@/api/postEvent"; import { formatApiError } from "@/api/client"; +import { Alert } from "@/components/ui/alert"; +import { Button } from "@/components/ui/button"; import { EventCard } from "@/components/events/event-card"; import { EventForm } from "@/components/events/event-form"; import { RouteGuard } from "@/components/layout/route-guard"; @@ -37,13 +39,9 @@ function EventsContent() { description={t("events.subtitle")} actions={ canCreate() ? ( - + ) : undefined } /> @@ -82,6 +80,9 @@ function EventsContent() { {error() &&

{error()}

} }> + + {formatApiError(events.error)} + {(list) => ( }> + + {formatApiError(exams.error)} + {(list) => ( setShowPassword(!showPassword())} class="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground" - tabIndex={-1} - aria-label={showPassword() ? "Hide password" : "Show password"} + aria-label={showPassword() ? t("auth.hidePassword") : t("auth.showPassword")} > }> diff --git a/src/pages/marks-page.tsx b/src/pages/marks-page.tsx index 10be8a1..bf8edd2 100644 --- a/src/pages/marks-page.tsx +++ b/src/pages/marks-page.tsx @@ -3,6 +3,7 @@ import { Link } from "@tanstack/solid-router"; import { getMyMarks } from "@/api/getMyMarks"; import { getUserMarks } from "@/api/getUserMarks"; import { formatApiError } from "@/api/client"; +import { Alert } from "@/components/ui/alert"; import type { MarksReport } from "@/api/types"; import { RouteGuard } from "@/components/layout/route-guard"; import { PageHeader } from "@/components/layout/page-header"; @@ -50,6 +51,9 @@ function MarksContent() { /> }> + + {formatApiError(mine.error)} + {t("marks.empty")}

}> {(report) => }
diff --git a/src/pages/notes-page.tsx b/src/pages/notes-page.tsx index 75d71e6..06bdc5d 100644 --- a/src/pages/notes-page.tsx +++ b/src/pages/notes-page.tsx @@ -4,6 +4,7 @@ import { getNotes } from "@/api/getNotes"; import { patchNoteById } from "@/api/patchNoteById"; import { postNote } from "@/api/postNote"; import { formatApiError } from "@/api/client"; +import { Alert } from "@/components/ui/alert"; import { RouteGuard } from "@/components/layout/route-guard"; import { PageHeader } from "@/components/layout/page-header"; import { NoteForm } from "@/components/notes/note-form"; @@ -65,6 +66,9 @@ function NotesContent() {
}> + + {formatApiError(notes.error)} + {(list) => ( }> @@ -39,7 +37,6 @@ function ProfileContent() { user={u()} onSaved={async () => { await auth.refresh(); - void navigate({ to: "/" }); }} />
diff --git a/src/pages/register-page.tsx b/src/pages/register-page.tsx index d6ea48c..99b830a 100644 --- a/src/pages/register-page.tsx +++ b/src/pages/register-page.tsx @@ -1,13 +1,12 @@ import { Link, useNavigate } from "@tanstack/solid-router"; -import { createSignal } from "solid-js"; +import { createSignal, Show } from "solid-js"; import { postRegister } from "@/api/postRegister"; import { formatApiError } from "@/api/client"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { GuestGuard } from "@/components/layout/guest-guard"; -import { LocaleSwitcher } from "@/components/layout/locale-switcher"; -import { ThemeToggle } from "@/components/layout/theme-toggle"; +import { IconEye, IconEyeOff } from "@/components/ui/icons"; import { useAuth } from "@/stores/auth-context"; import { useT } from "@/stores/preferences-context"; @@ -25,6 +24,8 @@ function RegisterForm() { const t = useT(); const [username, setUsername] = createSignal(""); const [password, setPassword] = createSignal(""); + const [confirmPassword, setConfirmPassword] = createSignal(""); + const [showPassword, setShowPassword] = createSignal(false); const [error, setError] = createSignal(""); const [pending, setPending] = createSignal(false); @@ -32,6 +33,7 @@ function RegisterForm() { e.preventDefault(); const u = username().trim(); const p = password(); + const cp = confirmPassword(); if (u.length < 3 || u.length > 32) { setError(t("auth.usernameHint")); return; @@ -40,6 +42,10 @@ function RegisterForm() { setError(t("auth.passwordHint")); return; } + if (p !== cp) { + setError(t("auth.passwordMismatch")); + return; + } setError(""); setPending(true); try { @@ -54,33 +60,19 @@ function RegisterForm() { }; return ( -
- - -
-
-
-

{t("auth.registerTitle")}

-

{t("auth.registerSubtitle")}

-
-
- - -
+
+
+
+

{t("auth.registerTitle")}

+

{t("auth.registerSubtitle")}

-
-
+ +
setUsername(e.currentTarget.value)} />
-
+ +
+
+ setPassword(e.currentTarget.value)} + /> + +
+
+ +
+ setPassword(e.currentTarget.value)} + value={confirmPassword()} + onInput={(e) => setConfirmPassword(e.currentTarget.value)} />
+ {error() && ( -

{error()}

+

{error()}

)} - -

+

{t("auth.hasAccount")}{" "} {t("auth.login")}