From 2c64b3ac8a8d34b496b3017df5e32441e3a768fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Thu, 16 Jul 2026 08:39:56 +0300 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20plan=20note=20file=20att?= =?UTF-8?q?achment=20frontend=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - document backend note file attachment support and minimal frontend scope - add reader-dialog attachment plan with native FormData and backend caps - refresh agent docs wording for completed audit plus follow-up notes --- AGENTS.md | 2 +- README.md | 14 +++++++++++++- docs/frontend-next-steps.md | 12 ++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4e53809..d367bb8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -68,7 +68,7 @@ Solid components run **once**, there is no re-render: ## Project docs and current UI rules - Treat these docs as active project context before changing related areas: - - `docs/frontend-next-steps.md` — active backlog, role/pagination/request audit notes. + - `docs/frontend-next-steps.md` — completed audit summary plus active backend-dependent/frontend follow-up notes. - `docs/navigation-patterns.md` — interaction rules, role scope, side-panel/full-page decisions, dashboard structure. - `docs/ui-redesign-tokens.md` — visual density, radius, table, side-panel, status UI, and dashboard card conventions. - `docs/role-scope-matrix.md` — role access matrix for pages/nav/dashboard cards. diff --git a/README.md b/README.md index 1aa5e21..b605307 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Dashboard and table summaries must use the same role scope as the related page. | `/login`, `/register` | Guests | Authentication | | `/` | Authenticated | Role-scoped, observation-only dashboard | | `/profile` | Authenticated | Edit personal info (name, email, phone, birth date) | -| `/notes` | Student+ | Personal notebook CRUD with paper-style read dialogs | +| `/notes` | Student+ | Personal notebook CRUD with paper-style read dialogs; file attachments are the next frontend integration | | `/events`, `/events/:id` | Student+ | Event list & detail with search, time filters, and lazy attendance roster | | `/exams` | Student+ | Exam table with role-scoped course filtering | | `/exams/:id` | Student+ | Exam detail, questions, grading, statistics (teacher+) | @@ -79,6 +79,7 @@ Dashboard and table summaries must use the same role scope as the related page. - **Course sessions**: right-panel session creation and paginated roll call panels - **Schedule validation**: event, exam, and lesson-session forms use `GET /time` for server-clock-aware past-date warnings before submit - **Notebook**: notes render as paper-style cards, open in a paper-style read dialog, and keep create/edit/delete in dialogs with three-dot card actions +- **Note files**: backend supports per-note file upload/list/download/delete; frontend integration will use native `FormData`, no upload dependency - **Events and courses**: events keep card rendering with toolbar search and upcoming/past filters; courses use table search plus term/unassigned filters - **Attendance UI**: localized status labels with explanatory detail text and semantic colors - **Role-scoped dashboard**: read-only summaries and KPIs by current role @@ -96,6 +97,17 @@ Dashboard and table summaries must use the same role scope as the related page. - Disclosure sections either defer hidden content for request savings or preserve mounted content when local state should not reset. - Event detail attendance roster is teacher-only and lazy-loaded when its disclosure opens. +## Upcoming Note File Integration + +The backend now supports note attachments: `POST /notes/{id}/files` with multipart field `file`, `GET /notes/{id}/files`, raw download by file id, and delete by file id. The frontend implementation should stay minimal: + +- Add `NoteFile` and `max_file_bytes` to API types/settings. +- Add one API file per request: list, upload, delete, and a download URL helper. +- Use native `FormData`; do not set `Content-Type` manually for multipart. +- Mount a small attachments panel in the note reader dialog only after a note exists. +- Read `settings.max_file_bytes` for a client-side size warning; backend remains authoritative for `413` and the 10-file cap. +- Skip list-card attachment counts and file previews until there is a real product need. + ## Docs - `docs/frontend-next-steps.md` — completed frontend audit summary and backend-dependent follow-ups. diff --git a/docs/frontend-next-steps.md b/docs/frontend-next-steps.md index 92e4855..aec50cd 100644 --- a/docs/frontend-next-steps.md +++ b/docs/frontend-next-steps.md @@ -18,6 +18,7 @@ validation, and list filtering cleanup. - Settings requests are cached and refreshed after settings patches. - Sidebar icons use local SVG wrappers to avoid large icon package module graphs. - Notes use a paper-style notebook card layout, a paper-style read dialog, and dialog-based create/edit/delete flows. +- Backend note attachments are available but not yet wired in the frontend. Planned frontend scope is reader-dialog attachments only, using native `FormData` and backend-enforced caps. - List endpoints return `{ items, total, limit, offset }`. API helpers under `src/api/` accept optional `limit`/`offset` via `Page`. - Events keep card rendering with shared toolbar search and all/upcoming/past filters. - Event, exam, and lesson-session schedule forms use `GET /time` for server-clock-aware past-date warnings before submit. @@ -53,6 +54,17 @@ validation, and list filtering cleanup. ## Active Backlog +### Note File Attachments + +| Item | Plan | +|---|---| +| API types | Add `NoteFile` and `SchoolSettings.max_file_bytes` | +| API helpers | Add list/upload/delete helpers plus a download URL helper; keep one file per request | +| Upload transport | Use native `FormData` with the multipart field named `file`; do not route multipart through JSON `client()` | +| UI | Add a compact `NoteFilesPanel` inside the note reader dialog; no card-level file counts | +| Limits | Read `settings.max_file_bytes` for client warning; backend remains authoritative for 10-file cap and `413` | +| Deferred | No previews, no drag-drop dependency, no draft-upload queue before note creation | + ### Recently fixed (this batch) | Item | Fix |