3.4 KiB
3.4 KiB
Iteration Log: Mobile UI & UX Responsiveness Overhaul
Timestamp: 2026-07-30 14:45
Trigger: Direct Request / Mobile UI Audit & Overhaul (/goal)
1. Summary of Request & Scope
The user highlighted critical visual and UX defects on mobile screens (< 768px):
- 3D Globe map getting cut off horizontally/vertically.
- Layout elements tumpang tindih (overlapping).
- KPI cards taking excessive vertical space (1200px+).
- Floating action buttons obscuring the mobile bottom navigation bar.
- Table card views showing generic fallback headers ("Field 1", "Field 2").
- Modal dialogs breaking/wrapping tabs unreadably on mobile devices.
2. Steps Taken & Architectural Changes
-
Root Viewport Configuration (
src/app/layout.tsx):- Added explicit
Viewportexport (width: "device-width", initialScale: 1, maximumScale: 1, userScalable: false) ensuring mobile browsers correctly scale elements to physical device pixels.
- Added explicit
-
3D Globe Map Responsiveness (
src/components/ui/GlobeMap.tsx):- Replaced fixed
500pxheight with responsive breakpoint heights (h-[320px] sm:h-[400px] md:h-[480px]). - Added dynamic camera initial altitude (
altitude: isMobile ? 2.5 : 1.8) to fit the entire sphere comfortably within mobile screens. - Changed container overflow to
overflow-hiddento prevent Three.js WebGL canvas clipping outside card boundaries.
- Replaced fixed
-
KPI Cards Mobile Grid (
src/components/dashboard/KPICards.tsx):- Changed grid from 1-column stack to a responsive 2-column grid on mobile (
grid-cols-2 sm:grid-cols-3 xl:grid-cols-6 gap-2.5 sm:gap-4). - Added responsive typography (
text-base sm:text-xl md:text-[25px]) and padding (p-3 sm:p-4) so all 6 KPI cards fit compactly into 3 short rows.
- Changed grid from 1-column stack to a responsive 2-column grid on mobile (
-
Top Widgets & Chart Legends (
src/components/dashboard/TopWidgets.tsx):- Set column span to
col-span-full lg:col-span-3. - Updated PieChart container layout to
flex-col sm:flex-row items-center gap-3, allowing chart legends to wrap underneath cleanly on narrow mobile viewports.
- Set column span to
-
Floating Navigation & FAB Alignment (
src/components/ui/HelpCenterFAB.tsx&DashboardLayout.tsx):- Repositioned HelpCenterFAB button on mobile to
bottom-20 lg:bottom-6 right-4 lg:right-6so it floats aboveMobileBottomBar. - Increased
maincontainer bottom padding topb-28 lg:pb-8to guarantee bottom bar clearance.
- Repositioned HelpCenterFAB button on mobile to
-
Data Table Mobile Card Headers & 256-Line Threshold Refactoring (
DataTable.tsx,DataTableMobileCards.tsx,DataTableDesktopView.tsx):- Refactored
DataTableMobileCards.tsxto render exact column header nodes directly, removing generic "Field X" text. - Extracted
DataTableDesktopView.tsxfromDataTable.tsxto comply strictly with Rule 3 (256-line LOC threshold rule), reducingDataTable.tsxfrom 266 lines to 184 lines.
- Refactored
-
Modal & Dialog Responsiveness (
src/components/ui/DeviceDetailModal.tsx):- Updated modal container to
h-[92vh] sm:h-[85vh]andp-2 sm:p-4. - Changed tab bar to horizontal scrollable view (
overflow-x-auto whitespace-nowrap shrink-0 flex-nowrap) preventing multi-line tab wrapping.
- Updated modal container to
3. Outcome & Build Integrity
- Build Status: Verified via
npm run build. - Visual Standards: Compliance with
AGENTS.md§9 (Nol Scrollbar Horizontal pada page level, no text clipping, elegant dark theme). - LOC Standard: Compliance with
AGENTS.md§3 (All modified files strictly < 256 LOC).