diff --git a/bun.lock b/bun.lock index c520ab3..31ab881 100644 --- a/bun.lock +++ b/bun.lock @@ -6,6 +6,7 @@ "name": "hezarfen-frontend", "dependencies": { "@kobalte/core": "^0.13.12", + "@phosphor-icons/core": "2.1.1", "@tanstack/solid-router": "^1.170.18", "@tanstack/solid-table": "^8.21.3", "class-variance-authority": "^0.7.1", @@ -207,6 +208,8 @@ "@oxc-project/types": ["@oxc-project/types@0.139.0", "", {}, "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw=="], + "@phosphor-icons/core": ["@phosphor-icons/core@2.1.1", "", {}, "sha512-v4ARvrip4qBCImOE5rmPUylOEK4iiED9ZyKjcvzuezqMaiRASCHKcRIuvvxL/twvLpkfnEODCOJp5dM4eZilxQ=="], + "@playwright/test": ["@playwright/test@1.62.1", "", { "dependencies": { "playwright": "1.62.1" }, "bin": { "playwright": "cli.js" } }, "sha512-DTcUc8qii+cpHvtOwggMtBRMjKZHXYWdw8syRYu2vtzuq4Wxphqq4NfCs5Zt44L6mA8rfDfj+PHnxFc/FeK6mQ=="], "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.1.5", "", { "os": "android", "cpu": "arm64" }, "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ=="], diff --git a/docs/ui/figma-migration-coverage.md b/docs/ui/figma-migration-coverage.md new file mode 100644 index 0000000..c79a458 --- /dev/null +++ b/docs/ui/figma-migration-coverage.md @@ -0,0 +1,155 @@ +# Figma UI Migration Coverage + +Source: `Hezarfen App Design` (`E8K670gsUx87yMOySGWrKf`) + +Last reviewed: 2026-09-12 + +This document is the route-level source of truth for the Figma migration. A +Figma example never replaces a working authorization rule, API contract, +loading/error state, or mutation flow. Static names and metrics in the design +must always be replaced with real application data. + +## Design pages + +| Figma page | Node | Coverage | +|---|---:|---| +| Components | `3:3` | Shared controls, navigation, data display, and feedback audited | +| Icons | `3:4` | 84 Phosphor Regular 16px icons audited; shared app glyphs migrated | +| Admin | `3:5` | 24 screens plus 2 modal variants audited | +| Teacher | `3:6` | 14 screens plus 2 modal variants audited | +| Student | `3:7` | 11 screens plus 2 modal variants audited | +| Parent | `3:8` | 8 screens audited | +| System | `103:2` | 7 screens audited | +| Mobile Kit | `40:2` | Shared 393px mobile primitives audited | +| Student Mobile | `40:3` | 9 screens audited | +| Parent Mobile | `40:4` | 6 screens audited | +| Dark Mode | `113:9393` | 10 reference screens audited | + +The Cover manifest also names a Foundations page, but no Foundations node URL +was supplied. Exact values already exposed by component and dark-mode contexts +are used; unknown values are not inferred. + +## Implemented foundation + +- Figma semantic light/dark aliases with the landing page's `#00ADD8` brand + override and pixel-wing logo. +- User-selected accent colors remain authoritative over the default brand. +- Desktop shell: 260px expanded sidebar, 45px top bar, 34px navigation rows, + 30px sub-navigation rows, and an 1100px content area at the 1440px reference. +- Controls: 36px base button/input, 26px small button, 20px badge, 32px tab. +- Mobile tab leaf: 56px; existing iOS/Android safe-area handling is preserved. +- Shared Card, PageHeader, EmptyState, Alert, Dialog, SidePanel, and Toast + surfaces use the new geometry and semantic tokens. +- Shared table shells, headers, rows, empty states, dashboard cards, and charts + use the Figma semantic surface and border aliases. +- 39 glyphs that overlap the current application are sourced from the pinned + official Phosphor Regular SVG package and inherit the active theme color. +- `/login` matches the SYS-01 480px standalone authentication panel while + retaining the current username/password backend contract. + +## Existing routes represented in Figma + +| Route | Figma coverage | Migration rule | +|---|---|---| +| `/` | Admin, teacher, student, parent dashboards | Restyle role branches; keep read-only, API-backed data | +| `/login` | SYS-01 | Visual migration; keep current auth contract | +| `/courses`, `/courses/:id` | Teacher/student classes and mobile lessons | Reuse current course/enrollment behavior | +| `/homework`, `/homework/:id` | Teacher/student homework | Reuse DataTable, submissions, files, and role gates | +| `/exams`, `/exams/:id` | Admin/teacher/student exams and results | Keep draft/publish, attempts, grading, and statistics gates | +| `/question-bank`, `/question-bank/:id` | Admin/teacher question bank | Keep server pagination and copy semantics | +| `/calendar` | Teacher/student schedules | Keep current calendar; timetable is a future view | +| `/marks` | Student/parent result concepts | Keep student-only report contract and parent-linked access | +| `/messages` | Teacher/parent communication | Keep folders, paging, compose, archive, and trash | +| `/appointments` | Parent mobile appointment | Keep reason, confirmation, conflict, and status flows | +| `/pomodoro` | Student work session | Keep current start/finish contract until DTO expands | +| `/whiteboards`, `/whiteboards/:id` | Teacher/student boards | Keep WebSocket canvas, lock, history, and permissions | +| `/work` | Teacher work log | Keep server-stamped check-in/out behavior | +| `/management/student-marks` | Teacher student analysis | Do not fabricate mastery/AI fields | +| `/management/student-attendance` | Teacher/admin attendance | Keep course/session roll-call permissions | +| `/management/classes`, `/management/classes/:id` | Admin classes | Keep class/member/course management behavior | +| `/management/settings` | Admin settings | Keep manager+ institution settings scope | +| `/management/payments` | Admin payments | Keep ledger and permission behavior | +| `/management/staff-work` | Admin staff work | Keep existing read/update/delete contract | +| `/admin/users`, `/admin/users/:id` | Admin users and roles | Keep admin guard and critical confirmations | +| `/students` | Parent development views | Keep linked-child authorization | +| `/meals`, `/meals/:id` | Admin cafeteria | Keep menu, booking, balance, and attendance behavior | +| `/payments` | Parent/student statement | Remain read-only until a payment-provider API exists | + +## Figma features blocked by product or backend scope + +These designs are recorded but must not be implemented with placeholder data or +false actions: + +- AI recommendation approval queue, evidence history, and rule management. +- AI question generation and institution-level competency analytics. +- Ses Atölyesi audio generation, player, quality gate, and listening analytics. +- Student/parent teacher-approved study plans and mastery time series. +- Institution selection and multi-institution session context. +- Password reset, remember-me session policy, and SSO. +- Six-step institution setup wizard and e-Okul/CSV/XLSX import pipeline. +- License purchase/billing, KVKK audit log, optical-form processing, and + institution-level PDF/CSV reports. +- Schedule generation and conflict resolution. +- Payment initiation/provider flow and stored payment-method controls. +- General offline mutation queue, idempotency, conflict handling, and incident IDs. +- Invite-code boards and enriched Pomodoro lesson/break/streak fields. +- Parent/student personal notification, privacy, and AI-preference endpoints. + +## Application routes not represented by a Figma screen + +Keep the current UI and behavior until a specific design is added: + +- `/register` +- `/guide` +- `/profile/me`, `/profile/:userId` +- `/notes` +- `/questions`, `/questions/:id` +- `/events`, `/events/:id` +- `/exam-room/:id` +- `/exams/:id/live` +- `/management/pomodoros` +- `/management/terms` +- `/whiteboards/:id` live canvas details beyond the list concept +- `/meals/:id` detailed account/service/management tabs +- `/studies`, `/clubs`, and `/attendance` redirect aliases + +## Asset policy + +Figma defines 84 Phosphor Regular icons in 16px outer/leaf boxes, with documented +13px, 14px, 15px, 18px, 20px, 22px, 26px, and 28px exceptions. The 39 glyphs +currently shared by Figma and the application are compiled from the pinned +`@phosphor-icons/core@2.1.1` Regular SVG sources. Existing local Lucide-style +icons remain only for intentionally app-specific glyphs not present on the +Figma Icons page. Temporary Figma URLs are never committed. + +## Validation checklist + +- `bun run build` +- `bun run test` +- Desktop screenshots at 1440x1024 in light and dark themes +- Mobile screenshots at 393x852, 375px, and 320px widths +- iOS and Android bottom-safe-area checks +- Role/module navigation and authorization regression checks +- Keyboard/focus checks for dialogs, side panels, tables, and mobile navigation +- Asset outer-box and leaf-size comparison before declaring icon fidelity complete + +## Remaining implementation plan + +### In progress — existing backend support + +1. Parent mobile composition at 393px, then 375px and 320px: + dashboard, linked students, messages, payments, and appointments. +2. System polish: notification panel, branded 404, network/error states, + keyboard/focus audit, dark-mode screenshots, and role/module regression. + +Secondary desktop composition and student mobile composition are complete in +code. Student mobile was reasoned against Tailwind breakpoints rather than +eyeballed: the 393px, 375px, and 320px screenshot checks in the validation +checklist are still outstanding and need a running backend and a seeded +student session. + +### Waiting for backend or product decisions + +The items in “Figma features blocked by product or backend scope” stay out of +the frontend until their API contracts and authorization rules exist. They must +not be simulated with static Figma values or non-functional buttons. diff --git a/docs/ui/ui-redesign-tokens.md b/docs/ui/ui-redesign-tokens.md index ed4cccd..d9dfde0 100644 --- a/docs/ui/ui-redesign-tokens.md +++ b/docs/ui/ui-redesign-tokens.md @@ -2,29 +2,31 @@ ## Source -bDash is Hezarfen's visual source of truth. Hezarfen keeps its SolidJS -architecture, Kobalte behavior, content model, workflows, semantic status colors, -and accessibility. React/Radix implementation details are not copied. +The `Hezarfen App Design` Figma file (`E8K670gsUx87yMOySGWrKf`) is the layout +and component source of truth. The public landing project at +`/Users/burakboduroglu/Projects/hezarfen` is the brand source of truth for the +logo and blue palette. Hezarfen keeps its SolidJS architecture, Kobalte +behavior, content model, workflows, semantic status colors, and accessibility. +Static sample content from Figma never replaces live application data. ## Color Light: -- background, card, popover, sidebar: `#F8F9FA` -- foreground: `#212529` -- primary: `#495057`; primary foreground: `#F8F9FA` -- secondary and muted: `#DEE2E6` -- accent and border: `#CED4DA` -- input: `#ADB5BD`; muted foreground and ring: `#6C757D` +- brand and brand accent: `#00ADD8`; brand hover: `#0097BD` +- surface/base: `#FFFFFF`; surface/overlay: `#F7F7F7` +- surface/tint: `#F5F5F5`; surface/fill: `#E5E5E5` +- text/strong: `#0A0A0A`; text/default: `#18181B` +- text/subtle: `#737373`; text/placeholder: `#A1A1A1` +- border/line: `rgba(10, 10, 10, 0.1)`; border/hairline: `#E9E9E9` Dark: -- background, card, popover, sidebar: `#212529` -- foreground: `#F8F9FA` -- primary: `#CED4DA`; primary foreground: `#212529` -- secondary and muted: `#495057` -- accent: `#6C757D`; border: `#495057`; input: `#6C757D` -- muted foreground: `#CED4DA`; ring: `#ADB5BD` +- surface/base and background: `#0F0F0F` +- surface/overlay, tint, and fill: `#262626` +- text/strong: `#FAFAFA`; text/default: `#F5F5F5` +- text/subtle and placeholder: `#A1A1A1`; border: `#333333` +- brand stays `#00ADD8`; brand hover stays `#0097BD` Success, warning, destructive, and info remain semantic. Custom palette choice continues to override `--ui-accent`, which feeds `--primary`. @@ -41,10 +43,11 @@ continues to override `--ui-accent`, which feeds `--primary`. - Base radius: `0.5rem` - Controls and menus: `rounded-md` -- Cards and tables: `rounded-lg` -- Resource/page header: `rounded-xl` -- Default control: `h-9`; small control: `h-8`; large control: `h-10` -- Content surfaces: `shadow-sm`; menus/popovers: `shadow-xl shadow-black/10` +- Cards, tables, dialogs, and empty states: `rounded-xl` +- Page headers are plain content hierarchy, not decorative cards +- Default control: `h-9`; small button: `26px`; tabs: `32px`; badges: `20px` +- Content surfaces use a hairline border without a standing shadow; menus and + overlays use the documented contextual elevation - Dialogs and side panels: `shadow-2xl shadow-black/20` - Content surfaces stay opaque. Blur is limited to modal overlays and table headers where hierarchy needs it. @@ -59,7 +62,7 @@ display-font, translucent surface, or custom shadow rules. ## DataTable -- Table shell: `rounded-lg border bg-card` +- Table shell: `rounded-xl border-border-line bg-surface-base` - Header: sticky, `text-xs` medium **Title Case** (no uppercase transform), `tracking-normal`, muted foreground/background - Body: flat rows (no zebra), restrained hover, `tabular-nums` cells so digits diff --git a/e2e/auth-shell.spec.ts b/e2e/auth-shell.spec.ts index c40d8f4..d43c742 100644 --- a/e2e/auth-shell.spec.ts +++ b/e2e/auth-shell.spec.ts @@ -1,11 +1,13 @@ import { expect, test } from "@playwright/test"; +const school = process.env.E2E_SCHOOL_SLUG ?? "demo"; const username = process.env.E2E_ADMIN_USERNAME ?? "admin"; const password = process.env.E2E_ADMIN_PASSWORD ?? "admin123"; test("sign-in reaches the authenticated shell with keyboard-accessible navigation", async ({ page }) => { await page.goto("/login"); await expect(page.locator("#login-username")).toBeVisible(); + await page.locator("#login-school").fill(school); await page.locator("#login-username").fill(username); await page.locator("#login-password").fill(password); await page.locator("form").getByRole("button", { name: /log in|sign in|giriş yap/i }).click(); diff --git a/index.html b/index.html index 7baeb26..3e4c655 100644 --- a/index.html +++ b/index.html @@ -2,19 +2,15 @@ - - + + - + - - - + + Hezarfen + + + + + + + + + + + diff --git a/src/api/__tests__/auth/auth.test.ts b/src/api/__tests__/auth/auth.test.ts index 55b4929..4a71d0e 100644 --- a/src/api/__tests__/auth/auth.test.ts +++ b/src/api/__tests__/auth/auth.test.ts @@ -13,13 +13,13 @@ describe("auth API", () => { const mockUser = { id: "u1", username: "test" }; mockFetchSuccess(mockUser); - const result = await postLogin({ username: "test", password: "password" }); + const result = await postLogin({ school: "demo", username: "test", password: "password" }); expect(result).toEqual(mockUser); const [url, init] = lastFetchCall(); expect(url).toBe("/api/auth/login"); expect(init?.method).toBe("POST"); - expect(init?.body).toBe(JSON.stringify({ username: "test", password: "password" })); + expect(init?.body).toBe(JSON.stringify({ school: "demo", username: "test", password: "password" })); }); it("postLogout calls /auth/logout", async () => { @@ -36,7 +36,7 @@ describe("auth API", () => { const mockUser = { id: "u2", username: "newuser" }; mockFetchSuccess(mockUser); - const data = { username: "newuser", password: "password", email: "test@test.com" }; + const data = { school: "demo", username: "newuser", password: "password", email: "test@test.com" }; const result = await postRegister(data); expect(result).toEqual(mockUser); diff --git a/src/api/__tests__/contract/helpers/live-client.ts b/src/api/__tests__/contract/helpers/live-client.ts index 786651d..5b9f35d 100644 --- a/src/api/__tests__/contract/helpers/live-client.ts +++ b/src/api/__tests__/contract/helpers/live-client.ts @@ -80,6 +80,7 @@ export async function loginAdmin(): Promise { await json("/auth/login", { method: "POST", body: { + school: env.SCHOOL_SLUG ?? "demo", username: env.ADMIN_USERNAME ?? "admin", password: env.ADMIN_PASSWORD ?? "admin123", }, diff --git a/src/api/auth/postLogin.ts b/src/api/auth/postLogin.ts index aef9bb5..5bbdfbe 100644 --- a/src/api/auth/postLogin.ts +++ b/src/api/auth/postLogin.ts @@ -2,6 +2,7 @@ import { client } from "../client"; import type { User } from "../client"; export type LoginBody = { + school: string; username: string; password: string; }; diff --git a/src/api/auth/postRegister.ts b/src/api/auth/postRegister.ts index 564d64d..8ad8368 100644 --- a/src/api/auth/postRegister.ts +++ b/src/api/auth/postRegister.ts @@ -2,6 +2,7 @@ import { client } from "../client"; import type { User } from "../client"; export type RegisterBody = { + school: string; username: string; password: string; }; diff --git a/src/components/attendance/attendance-report-view.tsx b/src/components/attendance/attendance-report-view.tsx index b26698d..0c7a79a 100644 --- a/src/components/attendance/attendance-report-view.tsx +++ b/src/components/attendance/attendance-report-view.tsx @@ -130,7 +130,7 @@ export function AttendanceReportView(props: { report: AttendanceReport; compact? class="min-w-0" columns={columns()} data={props.report.courses} - tableClass={cn("w-full", compact() ? "text-xs" : "table-fixed min-w-160")} + tableClass={cn("w-full", compact() ? "text-xs" : "table-fixed sm:min-w-160")} enableColumnVisibility={false} /> diff --git a/src/components/brand/logo-mark.tsx b/src/components/brand/logo-mark.tsx new file mode 100644 index 0000000..3342312 --- /dev/null +++ b/src/components/brand/logo-mark.tsx @@ -0,0 +1,45 @@ +import { Show } from "solid-js"; + +type LogoMarkProps = { + size?: number; + class?: string; +}; + +/** + * Hezarfen's pixel wing from the public landing page. The blue leading edge + * represents upward progress; the quieter cells form the rest of the wing. + * At favicon-sized dimensions only the leading edge is rendered. + */ +export function LogoMark(props: LogoMarkProps) { + const size = () => props.size ?? 26; + const compact = () => size() < 24; + + return ( + + ); +} diff --git a/src/components/courses/course-card.tsx b/src/components/courses/course-card.tsx index 064d5cd..07de513 100644 --- a/src/components/courses/course-card.tsx +++ b/src/components/courses/course-card.tsx @@ -23,10 +23,10 @@ export function CourseCard(props: {
- +
@@ -35,8 +35,8 @@ export function CourseCard(props: { {props.labels.kind} {props.labels.enrolled}
-

{props.course.description || "—"}

-
+

{props.course.description || "—"}

+
{props.term} @@ -46,12 +46,12 @@ export function CourseCard(props: {
-
+
-

{props.labels.capacity}

+

{props.labels.capacity}

{props.course.capacity ?? props.labels.unlimited}

- +
); diff --git a/src/components/courses/course-notes-panel.tsx b/src/components/courses/course-notes-panel.tsx index d30eb70..a79fbc2 100644 --- a/src/components/courses/course-notes-panel.tsx +++ b/src/components/courses/course-notes-panel.tsx @@ -57,7 +57,7 @@ export function CourseNotesPanel(props: { }; return ( -
+
{flash()} diff --git a/src/components/courses/course-subjects-panel.tsx b/src/components/courses/course-subjects-panel.tsx index 2520375..08328d9 100644 --- a/src/components/courses/course-subjects-panel.tsx +++ b/src/components/courses/course-subjects-panel.tsx @@ -42,7 +42,7 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea { accessorKey: "description", header: t("form.description"), - meta: { cellClass: "text-sm text-muted-foreground" }, + meta: { cellClass: "text-sm text-text-subtle" }, cell: (cell) => cell.row.original.description || "—", }, ...(props.canManage @@ -123,10 +123,10 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea
{error() &&

{error()}

}
- -
@@ -157,7 +157,7 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea }} /> - {error() &&

{error()}

} + {error() &&

{error()}

} }> 0} fallback={}> diff --git a/src/components/courses/course-teachers-panel.tsx b/src/components/courses/course-teachers-panel.tsx index 9a92b38..a15da45 100644 --- a/src/components/courses/course-teachers-panel.tsx +++ b/src/components/courses/course-teachers-panel.tsx @@ -49,7 +49,7 @@ export function CourseTeachersPanel(props: { {props.onCancel && ( - )} diff --git a/src/components/exams/exam-questions-panel.tsx b/src/components/exams/exam-questions-panel.tsx index c7b9ea9..0d1c571 100644 --- a/src/components/exams/exam-questions-panel.tsx +++ b/src/components/exams/exam-questions-panel.tsx @@ -211,10 +211,10 @@ export function ExamQuestionsPanel(props: { {flash()} -
+

{t("questions.title")}

- + {questionCount()}
@@ -288,13 +288,13 @@ export function ExamQuestionsPanel(props: { /> - {error() &&

{error()}

} + {error() &&

{error()}

} }> 0} fallback={ -
+

{t("questions.empty")}

- + +
diff --git a/src/components/homework/homework-submission-panel.tsx b/src/components/homework/homework-submission-panel.tsx index db9abe6..f365a8c 100644 --- a/src/components/homework/homework-submission-panel.tsx +++ b/src/components/homework/homework-submission-panel.tsx @@ -141,7 +141,7 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) {

{t("homework.submit")}

-

{t("homework.submitHelp")}

+

{t("homework.submitHelp")}

{flash()} @@ -152,7 +152,7 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) { }> {(row) => ( -
+
{statusLabel(row().status)} @@ -180,7 +180,7 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) {
-
+

{t("notes.files")}

@@ -201,11 +201,11 @@ export function HomeworkSubmissionPanel(props: { homeworkId: string }) { {(file) => { const meta = fileTypeMeta(file); return ( -
  • - {meta.icon} +
  • + {meta.icon}

    {file.name}

    -

    {formatBytes(file.size)}

    +

    {formatBytes(file.size)}

    diff --git a/src/components/layout/nav-bar.tsx b/src/components/layout/nav-bar.tsx index 37df88b..e497195 100644 --- a/src/components/layout/nav-bar.tsx +++ b/src/components/layout/nav-bar.tsx @@ -1,5 +1,6 @@ import { Link } from "@tanstack/solid-router"; import { Show, createSignal } from "solid-js"; +import { LogoMark } from "@/components/brand/logo-mark"; import { Button } from "@/components/ui/button"; import { SideNav } from "@/components/layout/side-nav"; import { UserMenu } from "@/components/layout/user-menu"; @@ -32,8 +33,8 @@ export function NavBar() { - - H + + {t("app.name")} @@ -63,7 +64,9 @@ export function NavBar() {