AI-CLO PTITHCM — TIẾN TRÌNH DỰ ÁN 06/09/2026

Checkpoint cuối ngày 06/09/2026. Trong ngày có hai giai đoạn chính: ổn định Assessment/persistence và hoàn tất refactor CSS ownership theo owner/domain. Frontend hiện ở V12.4.24.

1. Checkpoint hiện tại

2. Giai đoạn A — ổn định Assessment V12.4.0 → V12.4.3

2.1. Cache-busting persistence

Đồng bộ query version của:

js/ui/subpage-state.js
js/ui/form-persistence.js

Mục đích: tránh browser dùng persistence JS cũ sau deploy.

2.2. Student Attempt full-width

Màn sinh viên làm bài chuyển khỏi Drawer sang #content:

2.3. Khôi phục đúng câu đang làm

Local attempt draft lưu thêm:

currentQuestionIndex

Khi reload/mở lại:

  1. lấy payload chính thức từ Supabase;
  2. phủ pending local chưa sync;
  3. giữ deadline an toàn;
  4. đọc currentQuestionIndex;
  5. clamp về phạm vi hợp lệ;
  6. mở đúng câu đang làm.

2.4. Assessment vào shared persistence

assessment.js đăng ký các workspace:

qua:

window.AICLO_SUBPAGE_STATE.register(...)

Builder/Detail giữ đúng exam_id; nút quay lại/hủy/đóng Result chủ động xóa state để không restore ngược.

2.5. Backend giữ nguyên

Không đổi:

Assessment tiếp tục dùng các RPC hiện hành như start_exam_attempt, get_exam_attempt_payload, save_exam_progress, submit_exam_attempt, get_attempt_result.

3. Giai đoạn B — chuẩn hóa CSS ownership V12.4.4 → V12.4.24

Mục tiêu: loại các lớp CSS lịch sử chồng nhau, đưa mỗi nhóm UI về một owner rõ ràng, bảo toàn computed behavior desktop/mobile và giảm nguy cơ regression khi chỉnh một module.

3.1. Quick Edit / app-window

3.2. Question/Assessment ownership split

3.3. Drawer → shell

Drawer được chuyển khỏi app.css về css/ui/shell.css.

app.css không còn Drawer chrome.

3.4. Header ownership

Toàn bộ desktop/tablet/mobile header về shell.css:

Các fallback header trong application.css, mobile-overrides.css, final-layer.css, app.css lần lượt được loại bỏ.

3.5. Sidebar ownership

Sidebar được gom dần về shell.css:

sidebar-fit.css được nhập vào shell rồi xóa.

Desktop geometry 245px vẫn thuộc application.css.

3.7. Chương · Chủ đề · CLO

Tạo:

css/courses/structure.css

Owner cho:

Không còn structure-* trong app.css/application.css.

3.8. Auth/Login + application legacy modules

Sau bước này application.css gần như chỉ còn layout/sizing.

3.9. Notifications / Activity + Question Bank

Notifications/Activity tách:

css/system/notifications.css
css/system/activity.css

Xóa stylesheet mixed activity-notifications.css.

Question Bank:

3.10. Public CSS + late compatibility

3.11. Dashboard / Profile / Members / Assessment

final-layer.css sau bước này chỉ còn 2 primitive compatibility.

3.12. Giải thể final-layer + tách dialogs

3.13. App layout + UI primitives

3.14. Brand/logo + generic layout system

Checkpoint V12.4.24:

4. CSS ownership hiện tại

Core/UI

css/app.css
css/app-brand.css
css/ui/application.css
css/ui/primitives.css
css/ui/shell.css
css/ui/dialogs.css
css/ui/app-window.css
css/ui/layout-system.css
css/ui/mobile-overrides.css

Domain

css/courses/
css/questions/
css/exams/
css/system/
css/students/
css/results/

css/legacy/ là archive only.

Quy mô tại V12.4.24:

Đánh giá: dung lượng nhỏ; không cần nhập source file. Nếu profiling sau này cho thấy request count là bottleneck, tối ưu bằng build-time bundle.

5. Persistence hiện tại — phân vai

js/ui/subpage-state.js

js/ui/form-persistence.js

Attempt local recovery

Không tạo persistence navigation song song.

6. Backup/refactor trong ngày

Nhiều backup branch được tạo trước từng batch. Các mốc đáng chú ý gồm:

Backup gần nhất của đợt code:

backup-before-brand-layout-system-cleanup-20260906

7. Tổ chức tài liệu

Từ checkpoint tài liệu cuối ngày:

docs/project/
├─ PROJECT-NOTES-AI-CLO.md
├─ ARCHITECTURE-AI-CLO.md
├─ TECHNICAL-AGREEMENTS.md
├─ PROJECT-STATUS-2026-09-06.md
└─ PROJECT-PROGRESS-2026-09-06.md

Vai trò:

docs/releases/ giữ lịch sử VERSION/upgrade thay vì để README phình theo từng phiên bản.

8. Việc tiếp theo

Sau khi Assessment stabilization và CSS architecture đã hoàn tất, không nên tiếp tục refactor lớn chỉ vì mã có thể sạch hơn.

Ưu tiên:

  1. Smoke desktop/mobile shell.
  2. Login/Auth.
  3. Question Bank desktop/mobile, filter, card/table, quick edit.
  4. Assessment Detail/Builder/Attempt.
  5. Reload/discard/tab switch cho mọi subpage đã đăng ký persistence.
  6. Teacher/student qua Supabase/RLS.
  7. Đổi học phần không lẫn state/AI feedback.
  8. Excel đáp án+CLO với /cham-thi-clo.
  9. Compile TeX với công thức phức tạp.
  10. Chỉ sau profiling mới cân nhắc CSS bundle/asset optimization.

9. Quy tắc tiếp tục phát triển


Checkpoint cuối ngày 06/09/2026: V12.4.24 — Assessment ổn định, CSS ownership refactor lớn hoàn tất; chuyển trọng tâm sang kiểm thử tích hợp thực tế.