From b2d57d2afbfa20ab0730a1e5565b76a33d9c05fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Sat, 12 Sep 2026 12:36:03 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=A8=20migrate=20the=20app=20on?= =?UTF-8?q?to=20the=20Figma=20design=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - semantic light/dark aliases with the landing page's #00ADD8 brand override and the pixel-wing logo mark; user-selected accents stay authoritative over the default brand - desktop shell geometry at the 1440px reference: 260px sidebar, 45px top bar, 34px nav rows, 30px sub-nav rows, 1100px content area - controls settle on 36px base button/input, 26px small button, 20px badge pill, 32px tab, so per-call-site h-10/rounded-* overrides go away - 39 shared glyphs compiled from the pinned @phosphor-icons/core Regular sources; app-specific Lucide-style icons stay - /login matches the SYS-01 480px standalone panel, keeping the current username/password contract - desktop composition across courses, homework, exams, question bank, classes, admin users, payments, settings, staff work, work log, meals, messages, whiteboards and the teacher report screens: raw palette colors give way to success/warning/destructive and the surface/border aliases, tables pin their actions column to 110px at a 45px row, and ad-hoc tinted section shells defer to data-shell - student mobile: the 7-tab course detail scrolls horizontally below sm instead of wrapping to four cramped rows, nested report tables drop their min-width, and the whiteboard's three floating toolbar islands reflow into one wrapping bar under 640px where they used to overlap - docs/ui/figma-migration-coverage.md records route-level coverage and the features held back for want of a backend contract Figma screens that show mastery scores, AI risk tags, streaks, occupancy bars and work-quality ratings are deliberately not built: the API exposes none of it, and the alternative is a page of invented numbers. Export and discard buttons with nothing behind them are left out for the same reason. --- bun.lock | 3 + docs/ui/figma-migration-coverage.md | 155 ++++++++ docs/ui/ui-redesign-tokens.md | 43 +- e2e/auth-shell.spec.ts | 2 + index.html | 29 +- package.json | 1 + public/favicon.svg | 17 +- src/api/__tests__/auth/auth.test.ts | 6 +- .../__tests__/contract/helpers/live-client.ts | 1 + src/api/auth/postLogin.ts | 1 + src/api/auth/postRegister.ts | 1 + .../attendance/attendance-report-view.tsx | 2 +- src/components/brand/logo-mark.tsx | 45 +++ src/components/courses/course-card.tsx | 14 +- src/components/courses/course-notes-panel.tsx | 2 +- .../courses/course-subjects-panel.tsx | 8 +- .../courses/course-teachers-panel.tsx | 2 +- src/components/exams/bank-question-form.tsx | 6 +- src/components/exams/exam-form.tsx | 34 +- src/components/exams/exam-questions-panel.tsx | 24 +- src/components/exams/exam-result-badge.tsx | 4 +- src/components/exams/grade-form.tsx | 2 +- .../homework/course-homework-panel.tsx | 12 +- .../homework/homework-submission-panel.tsx | 14 +- .../homework/homework-submissions-panel.tsx | 20 +- src/components/layout/app-shell.tsx | 21 +- src/components/layout/mobile-tab-bar.tsx | 10 +- src/components/layout/nav-bar.tsx | 9 +- src/components/layout/page-header.tsx | 10 +- src/components/layout/side-nav.tsx | 6 +- src/components/layout/sidebar-account.tsx | 19 +- src/components/marks/marks-report-view.tsx | 2 +- src/components/meals/meal-menu-card.tsx | 10 +- src/components/messages/gmail-compose-box.tsx | 14 +- src/components/messages/gmail-mail-detail.tsx | 18 +- src/components/messages/gmail-mail-row.tsx | 6 +- src/components/ui/alert.tsx | 12 +- src/components/ui/badge.tsx | 5 +- src/components/ui/button.tsx | 6 +- src/components/ui/card.tsx | 2 +- src/components/ui/chart-bar.tsx | 6 +- src/components/ui/chart-heatmap.tsx | 6 +- src/components/ui/chart-line.tsx | 12 +- src/components/ui/chart-progress-ring.tsx | 8 +- src/components/ui/data-table.tsx | 2 +- src/components/ui/dialog.tsx | 8 +- src/components/ui/empty-state.tsx | 20 +- src/components/ui/icons.tsx | 372 +++++------------- src/components/ui/input.tsx | 2 +- src/components/ui/side-panel.tsx | 6 +- src/components/ui/table.tsx | 6 +- src/components/ui/tabs.tsx | 2 +- src/components/ui/toast.tsx | 4 +- src/components/users/user-table.tsx | 11 +- .../whiteboard/whiteboard-canvas.tsx | 176 +++++---- src/i18n/messages.ts | 14 +- src/index.css | 116 ++++-- src/lib/payments.ts | 6 +- src/pages/admin-user-detail-page.tsx | 2 +- src/pages/admin-users-page.tsx | 8 +- src/pages/bank-question-detail-page.tsx | 12 +- src/pages/classes-page.tsx | 7 +- src/pages/course-detail-page.tsx | 62 +-- src/pages/courses-page.tsx | 16 +- src/pages/dashboard-page.tsx | 26 +- src/pages/exam-detail-page.tsx | 76 ++-- src/pages/exams-page.tsx | 35 +- src/pages/homework-detail-page.tsx | 22 +- src/pages/homework-page.tsx | 20 +- src/pages/login-page.tsx | 42 +- src/pages/meal-detail-page.tsx | 36 +- src/pages/meals-page.tsx | 4 +- src/pages/messages-page.tsx | 23 +- src/pages/payments-page.tsx | 47 ++- src/pages/question-bank-page.tsx | 11 +- src/pages/register-page.tsx | 24 +- src/pages/settings-page.tsx | 18 +- src/pages/staff-work-page.tsx | 26 +- src/pages/student-attendance-page.tsx | 7 +- src/pages/student-marks-page.tsx | 10 +- src/pages/whiteboard-page.tsx | 24 +- src/pages/whiteboards-page.tsx | 14 +- src/pages/work-log-page.tsx | 8 +- 83 files changed, 1097 insertions(+), 858 deletions(-) create mode 100644 docs/ui/figma-migration-coverage.md create mode 100644 src/components/brand/logo-mark.tsx 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 @@
- - + + - + -{props.course.description || "—"}
-{props.course.description || "—"}
+{props.labels.capacity}
+{props.labels.capacity}
{props.course.capacity ?? props.labels.unlimited}
{error()}
}{error()}
} + {error() &&{error()}
}+
-