📝 plan note file attachment frontend work
Browse files at this commit2c64b3ac8a8d34b496b3017df5e32441e3a768fbParent: f25a788- docs
- 📝 plan note file attachment frontend work
3 changed files +26 -2
- AGENTS.md +1 -1
- README.md +13 -1
- docs/frontend-next-steps.md +12 -0
AGENTS.mdmodified+1 -1
| @@ -68,7 +68,7 @@ Solid components run **once**, there is no re-render: | ||
| 68 | 68 | ## Project docs and current UI rules |
| 69 | 69 | |
| 70 | 70 | - Treat these docs as active project context before changing related areas: |
| 71 | - - `docs/frontend-next-steps.md` — active backlog, role/pagination/request audit notes. | |
| 71 | + - `docs/frontend-next-steps.md` — completed audit summary plus active backend-dependent/frontend follow-up notes. | |
| 72 | 72 | - `docs/navigation-patterns.md` — interaction rules, role scope, side-panel/full-page decisions, dashboard structure. |
| 73 | 73 | - `docs/ui-redesign-tokens.md` — visual density, radius, table, side-panel, status UI, and dashboard card conventions. |
| 74 | 74 | - `docs/role-scope-matrix.md` — role access matrix for pages/nav/dashboard cards. |
README.mdmodified+13 -1
| @@ -56,7 +56,7 @@ Dashboard and table summaries must use the same role scope as the related page. | ||
| 56 | 56 | | `/login`, `/register` | Guests | Authentication | |
| 57 | 57 | | `/` | Authenticated | Role-scoped, observation-only dashboard | |
| 58 | 58 | | `/profile` | Authenticated | Edit personal info (name, email, phone, birth date) | |
| 59 | -| `/notes` | Student+ | Personal notebook CRUD with paper-style read dialogs | | |
| 59 | +| `/notes` | Student+ | Personal notebook CRUD with paper-style read dialogs; file attachments are the next frontend integration | | |
| 60 | 60 | | `/events`, `/events/:id` | Student+ | Event list & detail with search, time filters, and lazy attendance roster | |
| 61 | 61 | | `/exams` | Student+ | Exam table with role-scoped course filtering | |
| 62 | 62 | | `/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. | ||
| 79 | 79 | - **Course sessions**: right-panel session creation and paginated roll call panels |
| 80 | 80 | - **Schedule validation**: event, exam, and lesson-session forms use `GET /time` for server-clock-aware past-date warnings before submit |
| 81 | 81 | - **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 |
| 82 | +- **Note files**: backend supports per-note file upload/list/download/delete; frontend integration will use native `FormData`, no upload dependency | |
| 82 | 83 | - **Events and courses**: events keep card rendering with toolbar search and upcoming/past filters; courses use table search plus term/unassigned filters |
| 83 | 84 | - **Attendance UI**: localized status labels with explanatory detail text and semantic colors |
| 84 | 85 | - **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. | ||
| 96 | 97 | - Disclosure sections either defer hidden content for request savings or preserve mounted content when local state should not reset. |
| 97 | 98 | - Event detail attendance roster is teacher-only and lazy-loaded when its disclosure opens. |
| 98 | 99 | |
| 100 | +## Upcoming Note File Integration | |
| 101 | + | |
| 102 | +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: | |
| 103 | + | |
| 104 | +- Add `NoteFile` and `max_file_bytes` to API types/settings. | |
| 105 | +- Add one API file per request: list, upload, delete, and a download URL helper. | |
| 106 | +- Use native `FormData`; do not set `Content-Type` manually for multipart. | |
| 107 | +- Mount a small attachments panel in the note reader dialog only after a note exists. | |
| 108 | +- Read `settings.max_file_bytes` for a client-side size warning; backend remains authoritative for `413` and the 10-file cap. | |
| 109 | +- Skip list-card attachment counts and file previews until there is a real product need. | |
| 110 | + | |
| 99 | 111 | ## Docs |
| 100 | 112 | |
| 101 | 113 | - `docs/frontend-next-steps.md` — completed frontend audit summary and backend-dependent follow-ups. |
docs/frontend-next-steps.mdmodified+12 -0
| @@ -18,6 +18,7 @@ validation, and list filtering cleanup. | ||
| 18 | 18 | - Settings requests are cached and refreshed after settings patches. |
| 19 | 19 | - Sidebar icons use local SVG wrappers to avoid large icon package module graphs. |
| 20 | 20 | - Notes use a paper-style notebook card layout, a paper-style read dialog, and dialog-based create/edit/delete flows. |
| 21 | +- 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. | |
| 21 | 22 | - List endpoints return `{ items, total, limit, offset }`. API helpers under `src/api/` accept optional `limit`/`offset` via `Page<T>`. |
| 22 | 23 | - Events keep card rendering with shared toolbar search and all/upcoming/past filters. |
| 23 | 24 | - 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. | ||
| 53 | 54 | |
| 54 | 55 | ## Active Backlog |
| 55 | 56 | |
| 57 | +### Note File Attachments | |
| 58 | + | |
| 59 | +| Item | Plan | | |
| 60 | +|---|---| | |
| 61 | +| API types | Add `NoteFile` and `SchoolSettings.max_file_bytes` | | |
| 62 | +| API helpers | Add list/upload/delete helpers plus a download URL helper; keep one file per request | | |
| 63 | +| Upload transport | Use native `FormData` with the multipart field named `file`; do not route multipart through JSON `client()` | | |
| 64 | +| UI | Add a compact `NoteFilesPanel` inside the note reader dialog; no card-level file counts | | |
| 65 | +| Limits | Read `settings.max_file_bytes` for client warning; backend remains authoritative for 10-file cap and `413` | | |
| 66 | +| Deferred | No previews, no drag-drop dependency, no draft-upload queue before note creation | | |
| 67 | + | |
| 56 | 68 | ### Recently fixed (this batch) |
| 57 | 69 | |
| 58 | 70 | | Item | Fix | |