diff --git a/docs/ui-redesign-tokens.md b/docs/ui-redesign-tokens.md
new file mode 100644
index 0000000..a633e94
--- /dev/null
+++ b/docs/ui-redesign-tokens.md
@@ -0,0 +1,95 @@
+# UI Redesign Tokens
+
+## Direction
+
+Dense school admin UI: Fintables-style tables, Cloudflare-style grouped sidebar,
+neutral surfaces, subtle borders, one blue accent.
+
+## Color
+
+Light palette is defined in `src/index.css` as `--ui-*` variables:
+
+- `--ui-bg`: `#f7f8f8`
+- `--ui-surface-1`: `#ffffff`
+- `--ui-surface-2`: `#f1f3f3`
+- `--ui-surface-3`: `#e7eaea`
+- `--ui-border-1`: `#d9dddd`
+- `--ui-border-2`: `#c7cccc`
+- `--ui-text-1`: `#101414`
+- `--ui-text-2`: `#4b5555`
+- `--ui-text-3`: `#788181`
+- `--ui-accent`: `#2563eb`
+- semantic colors: success, warning, danger, info, each with muted pair
+
+Dark palette mirrors same token names with dark surfaces and brighter semantic
+foregrounds.
+
+Existing shadcn tokens (`--background`, `--card`, `--primary`, etc.) are mapped
+to these `--ui-*` variables so existing components keep working.
+
+## Typography
+
+- UI face: `DM Sans`
+- Data face: `.mono` / `.num`, using `ui-monospace, SFMono-Regular, Menlo,
+ Monaco, Consolas`
+- Display serif removed from data/admin pages; `.font-display` now maps to UI
+ face for tighter dashboard hierarchy.
+
+Scale target:
+
+- `xs`: 12/16, labels and metadata
+- `sm`: 13/18, nav and table cells
+- `base`: 14/20, body
+- `lg`: 18/24, section/page titles
+- `xl`: 22/28, key page title only
+
+## Spacing
+
+CSS variables:
+
+- `--space-1`: 4px
+- `--space-2`: 8px
+- `--space-3`: 12px
+- `--space-4`: 16px
+- `--space-5`: 20px
+- `--space-6`: 24px
+- `--space-8`: 32px
+
+Density defaults:
+
+- sidebar group/header row: 32px
+- table header/cell row: 36px
+- card padding: 16px
+- radius: 6px
+- table numerals/IDs use tabular mono
+
+## Proof Of Concept
+
+Reference page: `src/pages/admin-users-page.tsx`.
+
+Implemented:
+
+- grouped accordion sidebar with active category auto-open
+- compact stat row on top of users page
+- dense sticky data table styling via `.data-table`
+- role pills with semantic tints
+- mono IDs and tabular metrics
+- neutral surfaces, subtle borders, no gradients or decorative cards
+
+Static wireframe:
+
+```text
+Students / Users
+People & roles
+
+[ Total ] [ Students ] [ Teachers ] [ Managers ] [ Admins ]
+
+Directory [ Search... ]
+┌──────────┬────────────┬──────────────┬─────────┬──────────────┬────────┐
+│ Username │ Name │ Email │ Role │ ID │ Update │
+├──────────┼────────────┼──────────────┼─────────┼──────────────┼────────┤
+│ ali │ Ali Demir │ ali@... │ Student │ 01J... │ select │
+│ ayse │ Ayse Kaya │ — │ Student │ 01J... │ select │
+│ mehmet │ Mehmet Ar │ mehmet@... │ Teacher │ 01J... │ select │
+└──────────┴────────────┴──────────────┴─────────┴──────────────┴────────┘
+```
diff --git a/src/components/layout/app-shell.tsx b/src/components/layout/app-shell.tsx
index 4e692f2..4065809 100644
--- a/src/components/layout/app-shell.tsx
+++ b/src/components/layout/app-shell.tsx
@@ -5,7 +5,7 @@ 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 { IconChevronLeft, IconChevronRight, IconMenu } from "@/components/ui/icons";
+import { IconMenu, IconPanelLeft } from "@/components/ui/icons";
import { useAuth } from "@/stores/auth-context";
import { usePreferences, useT } from "@/stores/preferences-context";
import { cn } from "@/lib/cn";
@@ -76,9 +76,7 @@ export function AppShell(props: ParentProps) {
title={collapsed() ? t("nav.expand") : t("nav.collapse")}
onClick={() => prefs.toggleSidebar()}
>
- }>
-
-
+
diff --git a/src/components/layout/side-nav.tsx b/src/components/layout/side-nav.tsx
index 71f61a1..4ef7007 100644
--- a/src/components/layout/side-nav.tsx
+++ b/src/components/layout/side-nav.tsx
@@ -1,5 +1,11 @@
import { Link, useRouterState } from "@tanstack/solid-router";
-import { For, Show, createMemo, type Component } from "solid-js";
+import { For, Show, createEffect, createMemo, createSignal, type Component } from "solid-js";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
import { useAuth } from "@/stores/auth-context";
import { useT } from "@/stores/preferences-context";
import { hasMinRole } from "@/lib/roles";
@@ -10,10 +16,10 @@ import {
IconBook,
IconCalendar,
IconChart,
+ IconChevronRight,
+ IconEdit,
IconExam,
- IconGuide,
IconHome,
- IconEdit,
IconNote,
IconUsers,
} from "@/components/ui/icons";
@@ -26,26 +32,78 @@ type NavItem = {
exact?: boolean;
};
-const MAIN_ITEMS: NavItem[] = [
- { to: "/", labelKey: "nav.home", Icon: IconHome, exact: true },
- { to: "/courses", labelKey: "nav.courses", Icon: IconBook },
- { to: "/exams", labelKey: "nav.exams", Icon: IconExam },
- { to: "/marks", labelKey: "nav.marks", Icon: IconChart },
- { to: "/attendance", labelKey: "nav.attendance", Icon: IconCalendar },
- { to: "/notes", labelKey: "nav.notes", Icon: IconNote },
- { to: "/events", labelKey: "nav.events", Icon: IconCalendar },
- { to: "/work", labelKey: "nav.work", Icon: IconChart, minRole: "teacher" },
- { to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher" },
- { to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconCalendar, minRole: "teacher" },
- { to: "/management/settings", labelKey: "nav.settings", Icon: IconEdit, minRole: "manager" },
- { to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendar, minRole: "manager" },
- { to: "/admin/users", labelKey: "nav.users", Icon: IconUsers, minRole: "admin" },
+type NavGroup = {
+ id: string;
+ labelKey: MessageKey;
+ Icon: Component<{ class?: string }>;
+ minRole?: Role;
+ items: NavItem[];
+};
+
+const NAV_GROUPS: NavGroup[] = [
+ {
+ id: "students",
+ labelKey: "nav.group.students",
+ Icon: IconUsers,
+ items: [
+ { to: "/attendance", labelKey: "nav.attendance", Icon: IconCalendar },
+ ],
+ },
+ {
+ id: "classes",
+ labelKey: "nav.group.classes",
+ Icon: IconBook,
+ items: [
+ { to: "/courses", labelKey: "nav.courses", Icon: IconBook },
+ { to: "/exams", labelKey: "nav.exams", Icon: IconExam },
+ { to: "/events", labelKey: "nav.events", Icon: IconCalendar },
+ ],
+ },
+ {
+ id: "grades",
+ labelKey: "nav.group.grades",
+ Icon: IconChart,
+ items: [
+ { to: "/marks", labelKey: "nav.marks", Icon: IconChart },
+ { to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher" },
+ ],
+ },
+ {
+ id: "reports",
+ labelKey: "nav.group.reports",
+ Icon: IconNote,
+ minRole: "teacher",
+ items: [
+ { to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconCalendar, minRole: "teacher" },
+ { to: "/work", labelKey: "nav.work", Icon: IconChart, minRole: "teacher" },
+ ],
+ },
+ {
+ id: "settings",
+ labelKey: "nav.group.settings",
+ Icon: IconEdit,
+ minRole: "manager",
+ items: [
+ { to: "/management/settings", labelKey: "nav.settings", Icon: IconEdit, minRole: "manager" },
+ { to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendar, minRole: "manager" },
+ ],
+ },
+ {
+ id: "admin",
+ labelKey: "nav.admin",
+ Icon: IconUsers,
+ minRole: "admin",
+ items: [
+ { to: "/admin/users", labelKey: "nav.users", Icon: IconUsers, minRole: "admin" },
+ ],
+ },
];
-const GUIDE_ITEM: NavItem = {
- to: "/guide",
- labelKey: "nav.guide",
- Icon: IconGuide,
+const HOME_ITEM: NavItem = {
+ to: "/",
+ labelKey: "nav.home",
+ Icon: IconHome,
+ exact: true,
};
function pathActive(pathname: string, to: string, exact?: boolean) {
@@ -57,6 +115,7 @@ function NavLink(props: {
item: NavItem;
collapsed?: boolean;
onNavigate?: () => void;
+ standalone?: boolean;
}) {
const t = useT();
const pathname = useRouterState({ select: (s) => s.location.pathname });
@@ -69,79 +128,145 @@ function NavLink(props: {
title={t(props.item.labelKey)}
aria-current={active() ? "page" : undefined}
class={cn(
- "relative flex h-10 w-full items-center rounded-md text-sm font-medium outline-none",
- "transition-all duration-150",
- props.collapsed ? "justify-center px-0" : "gap-1.5 px-2",
+ "relative flex h-8 w-full items-center rounded-sm outline-none transition-colors duration-150",
+ props.standalone ? "text-[11px] font-semibold uppercase tracking-[0.08em]" : "text-[13px] font-medium",
+ props.collapsed ? "justify-center px-0" : props.standalone ? "gap-2 px-2" : "gap-2 pl-7 pr-2",
active()
- ? "bg-primary/10 text-primary shadow-sm ring-1 ring-primary/20"
- : "text-sidebar-foreground/75 hover:bg-muted/70 hover:text-foreground",
+ ? "bg-primary/10 text-foreground"
+ : "text-sidebar-foreground/75 hover:bg-muted hover:text-foreground",
)}
>
-
-
-
-
- {t(props.item.labelKey)}
-
+
+ {t(props.item.labelKey)}
);
}
export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) {
const auth = useAuth();
-
- const items = createMemo(() =>
- MAIN_ITEMS.filter((item) => !item.minRole || hasMinRole(auth.user()?.role, item.minRole)),
+ const t = useT();
+ const pathname = useRouterState({ select: (s) => s.location.pathname });
+ const visibleGroups = createMemo(() =>
+ NAV_GROUPS
+ .filter((group) => !group.minRole || hasMinRole(auth.user()?.role, group.minRole))
+ .map((group) => ({
+ ...group,
+ items: group.items.filter((item) => !item.minRole || hasMinRole(auth.user()?.role, item.minRole)),
+ }))
+ .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 t = useT();
+ createEffect(() => {
+ const active = activeGroupId();
+ if (active) setOpenGroup(active);
+ });
return (
);
}
diff --git a/src/components/layout/sidebar-account.tsx b/src/components/layout/sidebar-account.tsx
index eb4e96c..d291662 100644
--- a/src/components/layout/sidebar-account.tsx
+++ b/src/components/layout/sidebar-account.tsx
@@ -9,7 +9,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
-import { IconChevronRight, IconGlobe, IconLogout, IconMoon, IconSun } from "@/components/ui/icons";
+import { IconChevronRight, IconGlobe, IconGuide, IconLogout, IconMoon, IconSun } from "@/components/ui/icons";
import { useAuth } from "@/stores/auth-context";
import { usePreferences, useT } from "@/stores/preferences-context";
import { cn } from "@/lib/cn";
@@ -36,26 +36,34 @@ export function SidebarAccount(props: { collapsed?: boolean; onLogout: () => voi
{(u) => {
const name = () => displayName(u());
return (
-
+
-
+
{initials(name())}
- {name()}
- {t(`role.${u().role}` as MessageKey)}
+ {name()}
+
+ {t(`role.${u().role}` as MessageKey)}
+
-
+
@@ -78,6 +86,11 @@ export function SidebarAccount(props: { collapsed?: boolean; onLogout: () => voi
{prefs.locale() === "tr" ? "TR" : "EN"}
+ void navigate({ to: "/guide" })}>
+
+ {t("nav.guide")}
+
+
void props.onLogout()}>
{t("nav.logout")}
diff --git a/src/components/ui/icons.tsx b/src/components/ui/icons.tsx
index cbb5040..39aa07e 100644
--- a/src/components/ui/icons.tsx
+++ b/src/components/ui/icons.tsx
@@ -199,6 +199,15 @@ export function IconMenu(props: IconProps) {
);
}
+export function IconPanelLeft(props: IconProps) {
+ return (
+
+ );
+}
+
export function IconBook(props: IconProps) {
return (