Files
alla-tms/plans/change-sidebar-master-data-group.md
2026-07-16 09:53:14 +07:00

132 lines
3.5 KiB
Markdown

You are a Senior Frontend Engineer.
Project:
Training Management System (TMS)
Current task:
Refactor HRD/Admin sidebar navigation into grouped menu.
Requirement:
Group the following HRD/Admin menus under a parent menu named "ข้อมูลหลัก":
ข้อมูลหลัก
├─ พนักงาน
├─ หลักสูตร
├─ นโยบาย
├─ ประกาศ
Important constraints:
- Do NOT delete routes.
- Do NOT delete APIs.
- Do NOT change database schema.
- Do NOT break existing role-based navigation.
- Do NOT affect Employee sidebar.
- Keep Thai UI.
- Keep responsive/mobile sidebar behavior.
- Minimal-impact changes only.
Navigation behavior:
1. HRD/Admin sidebar should show parent menu:
- ข้อมูลหลัก
2. Under "ข้อมูลหลัก", show submenu items:
- พนักงาน
Route:
/dashboard/users or /dashboard/employees
Use whichever route currently exists for employee/user management.
- หลักสูตร
Route:
/dashboard/courses
- นโยบาย
Route:
/dashboard/training-policy
- ประกาศ
Route:
/dashboard/announcements
3. Remove these items from the root level of HRD/Admin sidebar:
- พนักงาน
- หลักสูตร
- นโยบาย
- ประกาศ
4. Keep other HRD/Admin root menus unchanged, such as:
- แดชบอร์ด
- รอตรวจสอบ
- ประวัติการอบรม
- นำเข้าพนักงาน
- รายงาน
- Audit Log
5. Employee sidebar must not be affected.
6. Sidebar UX:
- Parent menu "ข้อมูลหลัก" should be collapsible if the current sidebar supports nested items.
- If the current sidebar does not support collapsible groups, use existing nested item pattern if available.
- Submenu should highlight active route.
- If user is currently on one of child routes, parent menu should appear active/open.
7. Mobile behavior:
- Nested menu must work in mobile drawer.
- Sidebar should close after selecting submenu on mobile if current behavior supports it.
- Long Thai labels must not overflow.
Files likely involved:
- src/config/nav-config.ts
- src/components/layout/app-sidebar.tsx
- src/components/layout/nav-main.tsx
- src/components/layout/sidebar-nav.tsx
- src/components/ui/sidebar.tsx
Output Review File:
Create:
docs/management-change-sidebar-master-data-group-review.md
Include:
1. Summary
2. Files Changed
3. Navigation Before
4. Navigation After
5. Role Impact
6. Active Route Behavior
7. Mobile Sidebar Behavior
8. Manual Test Checklist
9. Known Limitations
Manual Test Checklist:
- HRD/Admin sees "ข้อมูลหลัก" parent menu.
- "ข้อมูลหลัก" contains พนักงาน.
- "ข้อมูลหลัก" contains หลักสูตร.
- "ข้อมูลหลัก" contains นโยบาย.
- "ข้อมูลหลัก" contains ประกาศ.
- Root-level พนักงาน menu is removed.
- Root-level หลักสูตร menu is removed.
- Root-level นโยบาย menu is removed.
- Root-level ประกาศ menu is removed.
- Other HRD/Admin menus still work.
- Employee sidebar is unchanged.
- Active submenu is highlighted.
- Parent menu opens when child route is active.
- Mobile sidebar nested menu works.
- No route or API was deleted.
Return:
- Complete code changes with file paths.
- Content of docs/management-change-sidebar-master-data-group-review.md.