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 `
diff --git a/src/pages/courses-page.tsx b/src/pages/courses-page.tsx
index e8a23cf..a5bc5b8 100644
--- a/src/pages/courses-page.tsx
+++ b/src/pages/courses-page.tsx
@@ -4,6 +4,7 @@ import { getCourses } from "@/api/getCourses";
import { getMyCourses } from "@/api/getMyCourses";
import { postCourse } from "@/api/postCourse";
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 { Badge } from "@/components/ui/badge";
@@ -103,6 +104,9 @@ function CoursesContent() {
}>
+
+ {formatApiError(courses.error)}
+
0}
fallback={
diff --git a/src/pages/dashboard-page.tsx b/src/pages/dashboard-page.tsx
index c704ed7..a8838c1 100644
--- a/src/pages/dashboard-page.tsx
+++ b/src/pages/dashboard-page.tsx
@@ -1,19 +1,19 @@
import { Link } from "@tanstack/solid-router";
-import { For, Show, Suspense, createMemo, createResource, createSignal } from "solid-js";
+import { For, Show, Suspense, createMemo, createResource } from "solid-js";
import { getEvents } from "@/api/getEvents";
import { getExams } from "@/api/getExams";
import { getMyMarks } from "@/api/getMyMarks";
import { getNotes } from "@/api/getNotes";
+import { formatApiError } from "@/api/client";
import type { Event, Exam, Note } from "@/api/types";
import { RouteGuard } from "@/components/layout/route-guard";
import { PageHeader } from "@/components/layout/page-header";
import { RoleHomePanel } from "@/components/dashboard/role-home-panel";
+import { Alert } from "@/components/ui/alert";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
IconCalendar,
- IconChevronLeft,
- IconChevronRight,
IconExam,
IconNote,
IconPlus,
@@ -25,8 +25,7 @@ import { examKindLabel } from "@/lib/exam-labels";
import { formatDateTime } from "@/lib/format";
import { cn } from "@/lib/cn";
-const PREVIEW_LIMIT = 10;
-const PAGE_SIZE = 5;
+const PREVIEW_LIMIT = 5;
const roundAvg = (n: number) => (Math.round(n * 10) / 10).toString();
@@ -49,6 +48,11 @@ function DashboardContent() {
const [exams] = createResource(() => getExams());
const [marks] = createResource(() => getMyMarks());
+ const resourceError = createMemo(() => {
+ const e = notes.error || events.error || exams.error || marks.error;
+ return e ? formatApiError(e, locale()) : null;
+ });
+
const noteCount = createMemo(() => notes()?.length ?? 0);
const eventCount = createMemo(() => events()?.length ?? 0);
const examCount = createMemo(() => exams()?.length ?? 0);
@@ -77,6 +81,10 @@ function DashboardContent() {
+
+ {(msg) => {msg()}}
+
+
{/* KPIs below actions */}
}>
@@ -122,10 +130,9 @@ function DashboardContent() {
}>
- 0}
+ fallback={
}
title={t("dashboard.emptyNotesTitle")}
@@ -136,23 +143,21 @@ function DashboardContent() {
/>
}
>
- {(pageItems) => (
-
-
- {(note: Note) => (
- -
-
-
{note.title}
-
- {note.content || t("notes.noContent")}
-
-
-
- )}
-
-
- )}
-
+
+
+ {(note: Note) => (
+ -
+
+
{note.title}
+
+ {note.content || t("notes.noContent")}
+
+
+
+ )}
+
+
+
@@ -164,10 +169,9 @@ function DashboardContent() {
}>
- 0}
+ fallback={
}
title={t("dashboard.emptyEventsTitle")}
@@ -178,32 +182,30 @@ function DashboardContent() {
/>
}
>
- {(pageItems) => (
-
-
- {(event: Event) => (
- -
-
-
-
{event.title}
-
- {formatDateTime(event.starts_at, locale())}
-
-
-
- →
-
-
-
- )}
-
-
- )}
-
+
+
+ {(event: Event) => (
+ -
+
+
+
{event.title}
+
+ {formatDateTime(event.starts_at, locale())}
+
+
+
+ →
+
+
+
+ )}
+
+
+
@@ -215,10 +217,9 @@ function DashboardContent() {
}>
- 0}
+ fallback={
}
title={t("dashboard.emptyExamsTitle")}
@@ -229,23 +230,22 @@ function DashboardContent() {
/>
}
>
- {(pageItems) => (
-
-
- {(exam: Exam) => (
- -
-
-
-
{exam.title}
-
- {exam.description || "—"}
-
-
-
+
+
+ {(exam: Exam) => (
+ -
+
+
+
{exam.title}
+
+ {exam.description || "—"}
+
+
+
{examKindLabel(String(exam.kind), t)}
@@ -253,9 +253,8 @@ function DashboardContent() {
)}
- )}
-
-
+
+
@@ -263,62 +262,6 @@ function DashboardContent() {
);
}
-function PaginatedList(props: {
- items: T[];
- empty: any;
- pageSize: number;
- children: (pageItems: () => T[]) => any;
-}) {
- const t = useT();
- const [page, setPage] = createSignal(0);
-
- const totalPages = createMemo(() =>
- Math.max(1, Math.ceil(props.items.length / props.pageSize)),
- );
- const safePage = createMemo(() => Math.min(page(), totalPages() - 1));
- const pageItems = createMemo(() => {
- const start = safePage() * props.pageSize;
- return props.items.slice(start, start + props.pageSize);
- });
-
- return (
- 0} fallback={props.empty}>
-
-
{props.children(pageItems)}
-
props.pageSize}>
-
- setPage((p) => Math.max(0, p - 1))}
- >
-
- {t("common.prev")}
-
-
- {t("common.pageOf", { page: safePage() + 1, total: totalPages() })}
-
- = totalPages() - 1}
- onClick={() => setPage((p) => Math.min(totalPages() - 1, p + 1))}
- >
- {t("common.next")}
-
-
-
-
-
-
- );
-}
-
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() ? (
- setShowForm((v) => !v)}
- >
+ setShowForm((v) => !v)}>
{showForm() ? t("common.cancel") : t("events.create")}
-
+
) : 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("app.name")}
-
{t("auth.createStudent")}
-
- {t("auth.registerSubtitle")}
-
-
-
-
-
-
-
{t("auth.registerTitle")}
-
{t("auth.registerSubtitle")}
-
-
-
-
-
+
+
+
+
{t("auth.registerTitle")}
+
{t("auth.registerSubtitle")}
-