From 0be69830b88167cc16fe17439e3013c400dcf07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:27:11 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20mobile=20tab=20bar,=20setti?= =?UTF-8?q?ngs=20dirty-state,=20terms=20sidepanel,=20UX=20polish=20batch?= =?UTF-8?q?=20-=20MobileTabBar:=20bottom=20nav=20(home/courses/exams/notes?= =?UTF-8?q?/menu)=20with=20safe-area=20-=20ErrorAlert:=20shared=20destruct?= =?UTF-8?q?ive=20alert=20with=20optional=20retry=20button=20-=20app-shell:?= =?UTF-8?q?=20replace=20hamburger=20with=20MobileTabBar,=20pb-24=20on=20mo?= =?UTF-8?q?bile=20-=20side-nav:=20independent=20multi-group=20open/close?= =?UTF-8?q?=20states=20-=20settings:=20dirty-state=20save=20gate=20via=20J?= =?UTF-8?q?SON=20baseline,=20auto-clearing=20success,=20Metric=20cards,=20?= =?UTF-8?q?locked=20badges,=20EmptyRows=20fallback=20-=20terms:=20SidePane?= =?UTF-8?q?l=20create/edit=20+=20dense=20table=20row=20actions=20-=20profi?= =?UTF-8?q?le:=20localized=20role=20label=20instead=20of=20raw=20role+id?= =?UTF-8?q?=20-=20student-attendance=20+=20student-marks:=20ErrorAlert,=20?= =?UTF-8?q?personLabel,=20onSelectUser,=20localized=20emptyMessage=20-=20c?= =?UTF-8?q?ourse-sessions-panel:=20ConfirmDialog=20for=20session=20delete,?= =?UTF-8?q?=20ErrorAlert=20-=20exam-room-page:=20stale=20id=20guard=20on?= =?UTF-8?q?=20route=20change=20-=20exam-room=20+=20live-monitor:=20nested?= =?UTF-8?q?=20breadcrumbs=20(Exams=20/=20title=20/=20sub)=20-=20dashboard:?= =?UTF-8?q?=20role-ordered=20portal=20cards,=20guide=20CTA,=20empty=20time?= =?UTF-8?q?line=20CTA,=20compact=20grid=20-=20header=20create=20buttons:?= =?UTF-8?q?=20unified=20min-w-[7.5rem]=20rounded-lg=20-=20cards=20grid:=20?= =?UTF-8?q?cols-2=20on=20sm=20breakpoint=20-=20work-log:=20localized=20Sta?= =?UTF-8?q?tus=20column=20header=20-=20docs:=20sync=20frontend-next-steps?= =?UTF-8?q?=20with=20batch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/frontend-next-steps.md | 13 +- src/components/layout/app-shell.tsx | 40 +- src/components/layout/mobile-tab-bar.tsx | 83 ++++ src/components/layout/side-nav.tsx | 29 +- src/components/notes/note-list.tsx | 6 +- .../sessions/course-sessions-panel.tsx | 35 +- src/components/ui/error-alert.tsx | 24 + src/components/users/user-search-select.tsx | 7 +- src/i18n/messages.ts | 35 +- src/pages/courses-page.tsx | 2 +- src/pages/dashboard-page.tsx | 50 +- src/pages/events-page.tsx | 4 +- src/pages/exam-room-page.tsx | 47 +- src/pages/exams-page.tsx | 16 +- src/pages/live-monitor-page.tsx | 43 +- src/pages/notes-page.tsx | 2 +- src/pages/profile-page.tsx | 11 +- src/pages/settings-page.tsx | 449 +++++++++++++----- src/pages/student-attendance-page.tsx | 17 +- src/pages/student-marks-page.tsx | 19 +- src/pages/terms-page.tsx | 174 ++++--- src/pages/work-log-page.tsx | 5 +- 22 files changed, 807 insertions(+), 304 deletions(-) create mode 100644 src/components/layout/mobile-tab-bar.tsx create mode 100644 src/components/ui/error-alert.tsx diff --git a/docs/frontend-next-steps.md b/docs/frontend-next-steps.md index bf5676a..7072117 100644 --- a/docs/frontend-next-steps.md +++ b/docs/frontend-next-steps.md @@ -62,4 +62,15 @@ validation, and list filtering cleanup. ## Active Backlog -- No active frontend backlog items remain in this audit batch. +- Backend server-side pagination/search/filter params still pending (see Backend-Dependent Follow-Up). +- Deferred product features (not started): exam `allow_rejoin` UI, manager work-log corrections, session edit (`PATCH`). + +## UX polish batch (completed) + +- Session delete uses ConfirmDialog; exam room guards stale id on route change. +- Mobile bottom tab bar (home/courses/exams/notes/menu); exam-room hides tab chrome. +- Shared ErrorAlert with try-again; lookup pages show person labels; profile shows localized role. +- Manager/admin dashboard portal includes daily tools + management cards; compact guide CTA on dashboard (guide stays in account menu). +- Terms page: SidePanel create/edit + dense table row actions; header create buttons use shared min-width/radius. +- Settings: dirty-state save gate and auto-clearing success message. +- Nested breadcrumbs on exam room and live monitor. diff --git a/src/components/layout/app-shell.tsx b/src/components/layout/app-shell.tsx index 4065809..a1a3868 100644 --- a/src/components/layout/app-shell.tsx +++ b/src/components/layout/app-shell.tsx @@ -1,11 +1,12 @@ import type { ParentProps } from "solid-js"; import { Link, useLocation, useNavigate } from "@tanstack/solid-router"; import { Show, createSignal } from "solid-js"; +import { MobileTabBar } from "@/components/layout/mobile-tab-bar"; import { NavBar } from "@/components/layout/nav-bar"; import { SideNav } from "@/components/layout/side-nav"; import { SidebarAccount } from "@/components/layout/sidebar-account"; import { Button } from "@/components/ui/button"; -import { IconMenu, IconPanelLeft } from "@/components/ui/icons"; +import { IconPanelLeft } from "@/components/ui/icons"; import { useAuth } from "@/stores/auth-context"; import { usePreferences, useT } from "@/stores/preferences-context"; import { cn } from "@/lib/cn"; @@ -32,18 +33,6 @@ export function AppShell(props: ParentProps) { - - -
); } diff --git a/src/components/layout/mobile-tab-bar.tsx b/src/components/layout/mobile-tab-bar.tsx new file mode 100644 index 0000000..c7d6a6b --- /dev/null +++ b/src/components/layout/mobile-tab-bar.tsx @@ -0,0 +1,83 @@ +import { For, Show } from "solid-js"; +import { Link, useRouterState } from "@tanstack/solid-router"; +import { + IconBook, + IconExam, + IconHome, + IconMenu, + IconNote, +} from "@/components/ui/icons"; +import type { MessageKey } from "@/i18n/messages"; +import { cn } from "@/lib/cn"; +import { useT } from "@/stores/preferences-context"; +import type { Component } from "solid-js"; + +type TabItem = { + to: string; + labelKey: MessageKey; + Icon: Component<{ class?: string }>; + exact?: boolean; + action?: "menu"; +}; + +const TABS: TabItem[] = [ + { to: "/", labelKey: "nav.home", Icon: IconHome, exact: true }, + { to: "/courses", labelKey: "nav.courses", Icon: IconBook }, + { to: "/exams", labelKey: "nav.exams", Icon: IconExam }, + { to: "/notes", labelKey: "nav.notes", Icon: IconNote }, + { to: "#menu", labelKey: "nav.menu", Icon: IconMenu, action: "menu" }, +]; + +function pathActive(pathname: string, to: string, exact?: boolean) { + if (exact) return pathname === to; + return pathname === to || pathname.startsWith(`${to}/`); +} + +export function MobileTabBar(props: { onMenu: () => void }) { + const t = useT(); + const pathname = useRouterState({ select: (s) => s.location.pathname }); + + return ( + + ); +} diff --git a/src/components/layout/side-nav.tsx b/src/components/layout/side-nav.tsx index 4e1fa45..b0ab6da 100644 --- a/src/components/layout/side-nav.tsx +++ b/src/components/layout/side-nav.tsx @@ -164,21 +164,34 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) })) .filter((group) => group.items.length > 0), ); - const activeGroupId = createMemo(() => visibleGroups().find((group) => group.items.some((item) => pathActive(pathname(), item.to, item.exact)))?.id ?? visibleGroups()[0]?.id ?? ""); - const [openGroup, setOpenGroup] = createSignal(activeGroupId()); + const activeGroupId = createMemo( + () => + visibleGroups().find((group) => group.items.some((item) => pathActive(pathname(), item.to, item.exact)))?.id ?? + "", + ); + const [openGroups, setOpenGroups] = createSignal>({}); + + const isOpen = (groupId: string) => openGroups()[groupId] === true; + + const toggleGroup = (groupId: string) => { + setOpenGroups((current) => ({ ...current, [groupId]: !current[groupId] })); + }; createEffect(() => { const active = activeGroupId(); - if (active) setOpenGroup(active); + if (!active) return; + setOpenGroups((current) => (current[active] ? current : { ...current, [active]: true })); }); return ( -