8.7 KiB
8.7 KiB
Pre-Sprint 6 Responsive Audit Review
Summary
งานรอบนี้เป็น responsive audit แบบ minimal-impact สำหรับหน้า TMS หลักก่อนเริ่ม Sprint 6 โดยโฟกัสที่ shared layout, page header, data table, report table, form action area, dialog และ card layout ที่กระทบการใช้งานบน mobile/tablet มากที่สุด
ผลลัพธ์หลัก:
- ลดโอกาส header overflow บนจอเล็ก
- ทำให้ page header action ใช้งานได้บนมือถือมากขึ้น
- ทำให้ data table toolbar, pagination และ table content รองรับการ wrap/scroll บน mobile
- ปรับ report filter form และ report tables ให้ไม่ล้นจอ
- ปรับ action buttons ใน training records และ certificate manager ให้กดใช้ง่ายบน mobile
- ปรับ dashboard widgets บางจุดให้ข้อความไทยและ badge แตกบรรทัดได้ดีขึ้น
Files Changed
src/components/layout/header.tsxsrc/components/layout/page-container.tsxsrc/components/ui/dialog.tsxsrc/components/ui/table/data-table.tsxsrc/components/ui/table/data-table-toolbar.tsxsrc/components/ui/table/data-table-pagination.tsxsrc/features/overview/components/recent-sales.tsxsrc/features/overview/components/bar-graph.tsxsrc/features/overview/components/area-graph.tsxsrc/features/overview/components/pie-graph.tsxsrc/features/reports/components/reports-page-content.tsxsrc/features/reports/components/report-table-card.tsxsrc/features/training-records/components/training-record-form.tsxsrc/features/training-records/components/training-record-review-form.tsxsrc/features/training-records/components/training-record-review-page.tsxsrc/features/training-records/components/training-record-certificate-manager.tsxsrc/features/training-policy/components/training-policy-page.tsxsrc/features/import-employees/components/employee-import-page.tsxsrc/features/import-employees/components/master-review-page.tsx
Pages Audited
/dashboard/overview/dashboard/training-records/dashboard/training-records/[id]/dashboard/training-records/[id]/review/dashboard/pending-review/dashboard/courses/dashboard/training-policy/dashboard/import-employees/dashboard/master-review/dashboard/reports
Responsive Issues Found
- Header มีความเสี่ยงล้นจอเมื่อ breadcrumb ยาวและ action ด้านขวาถูกรวมอยู่ในแถวเดียว
- Page header action หลายหน้ามีโอกาสชิดขวาเกินไปบน mobile และกดใช้งานยาก
- Data table toolbar วาง filter/action แบบแนวนอนตายตัวเกินไปสำหรับ mobile
- Data table pagination มีโอกาสอัดแน่นและอ่านยากบนหน้าจอเล็ก
- ตารางรายงานไม่มี minimum width ที่ชัดเจน ทำให้ horizontal scroll behavior ไม่สม่ำเสมอ
- Report filter form และ action buttons ยังไม่เป็น mobile-first พอ
- Training records form/review action buttons ยังวางเป็นแถวเดียว
- Certificate action buttons มีโอกาสแน่นเกินไปบนจอเล็ก
- ข้อความไทยยาวใน recent activity, badge และ review detail มีโอกาสชน layout
- Card summary บางหน้าบน tablet ยังขึ้นหลายคอลัมน์เกินไป
Responsive Issues Fixed
- ปรับ header ให้มี
min-w-0, ลด separator บนจอเล็ก และป้องกัน breadcrumb overflow - ปรับ
PageContainerให้ page header stack บน mobile และบังคับ action area ใช้เต็มความกว้างได้ - ปรับ
DataTableให้ table มีmin-w-maxและรักษา horizontal scroll สำหรับตารางกว้าง - ปรับ
DataTableToolbarให้ stack/filter wrap ได้บน mobile และ search input ใช้ความกว้างเต็มได้ - ปรับ
DataTablePaginationให้แยกเป็นหลายบรรทัดบน mobile และยังคง compact บน desktop - ปรับ
DialogContentให้มี max-height และ scroll ได้เมื่อเนื้อหายาวบนมือถือ - ปรับ
ReportsPageContentให้ filter form และปุ่ม action stack ได้บนจอเล็ก - ปรับ
ReportTableCardให้ export button full width บน mobile และ table มีmin-w-[720px] - ปรับ training record form/review/certificate action buttons ให้ full width บน mobile
- ปรับ review detail และ recent activity ให้ข้อความไทย wrap ได้และ badge ไม่ดัน layout
- ปรับ card summary grid ของ training policy, import employees และ master review ให้เหมาะกับ tablet มากขึ้น
Components Updated
- Dashboard shell:
HeaderPageContainer
- Shared responsive surfaces:
DialogContentDataTableDataTableToolbarDataTablePagination
- Overview widgets:
RecentSalesBarGraphAreaGraphPieGraph
- Reports:
ReportsPageContentReportTableCard
- Training records:
TrainingRecordFormTrainingRecordReviewFormTrainingRecordReviewPageTrainingRecordCertificateManager
- HRD pages:
TrainingPolicyPageEmployeeImportPageMasterReviewPage
Breakpoints Tested
เป้าหมาย breakpoint ที่ใช้ตรวจรอบนี้:
- Mobile:
360px - Tablet:
768px - Desktop:
1024px
วิธีตรวจ:
npx tsc --noEmitผ่านnpm run lintผ่าน โดยเหลือเฉพาะ warning เดิมที่ไม่เกี่ยวกับงานรอบนี้- ตรวจ responsive behavior จาก shared component structure และ class breakpoints ในจุดที่กระทบทุกหน้าหลัก
ข้อจำกัด:
- ใน session นี้ไม่มี Browser/Playwright tool พร้อมใช้งาน จึงยังไม่ได้ทำ visual automation หรือ screenshot verification จริง
Manual Test Checklist
- Desktop layout still works.
- Sidebar works on desktop.
- Sidebar/drawer works on mobile by existing shared sidebar implementation.
- Dashboard cards stack correctly on mobile.
- Tables scroll horizontally on mobile.
- Forms fit mobile width.
- Buttons are usable on mobile.
- Dialogs fit mobile width.
- No horizontal page overflow except intended table scroll.
- Thai labels do not break layout in updated components.
- HRD pages work on tablet.
- Employee pages work on mobile.
Remaining Limitations
- ยังไม่มี visual regression หรือ screenshot-based verification จริงในรอบนี้
- Table cells ของบางคอลัมน์ยังใช้
whitespace-nowrapตามพฤติกรรม data table เดิม เพื่อรักษา desktop table density; บน mobile จึงอาศัย horizontal scroll เป็นหลัก - หน้า legacy/non-TMS อื่น ๆ ใน repo ยังไม่ได้อยู่ใน responsive audit รอบนี้
- warning เดิมจาก lint ยังอยู่ในไฟล์นอกขอบเขตงาน responsive นี้
Recommendation Before Sprint 6
- ทำ visual QA จริงบน 360px / 768px / 1024px หลังจากเปิด dev server ด้วย browser automation หรือ manual QA
- ถ้า Sprint 6 มีการเพิ่ม table/filter ใหม่ ควร reuse shared toolbar/pagination pattern ที่แก้แล้วในรอบนี้
- พิจารณาเพิ่ม visual regression snapshots สำหรับหน้า TMS หลัก โดยเฉพาะ overview, training records, pending review และ reports