2.7 KiB
2.7 KiB
Plan: Shift Calendar Cell Layout and Readability Enhancements
Overview
The user reported that the text in the Monthly Shift Calendar cells is too small to read, especially the shift times. The objective is to optimize the styling, spacing, and typography of the shift calendar cells inside the React frontend to make the layout clean, readable, and professional.
Project Type
WEB (React + Tailwind CSS frontend modification)
Success Criteria
- Shift name and shift time font sizes are increased for clear readability.
- Cell badge height and padding are adjusted so the larger text fits without overlapping or clipping.
- The shift calendar grid maintains its alignment, horizontal scrollability, and aesthetics across screen sizes.
- No purple or violet color schemes are introduced (adhering to styling guidelines).
Tech Stack
- React & Inertia.js: Frontend framework.
- Tailwind CSS: Styling utility classes.
File Structure
resources/js/pages/hr/shifts/calendar.tsx(Target component containing the calendar grid and cell rendering)
Task Breakdown
Task 1: Adjust Cell Badge Layout & Dimensions
- Agent:
frontend-specialist - Skill:
frontend-design,react-best-practices - Priority: P1
- Dependencies: None
- INPUT: The badge container
divstyling inside thedates.maprender block ofcalendar.tsx(around lines 268-278). - OUTPUT:
- Update cell badge height from
h-10(40px) toh-12(48px) orh-13(52px) to provide more vertical space. - Increase font size from
text-[9px]totext-[11px](ortext-xs). - Align text elements vertically with appropriate line-height (
leading-normalorleading-tight).
- Update cell badge height from
- VERIFY: Check that the shift labels (
OPS,RD, etc.) render in the new larger font size and are vertically centered.
Task 2: Enhance Time Label Readability & Formatting
- Agent:
frontend-specialist - Skill:
frontend-design - Priority: P1
- Dependencies: Task 1
- INPUT: The shift time
spanrendering within the badge (around lines 274-276). - OUTPUT:
- Increase the time font size from
text-[7px]totext-[9.5px]ortext-[10px]. - Format the time string dynamically (e.g., trim leading zeroes from
03:30PMto3:30 PM) for a cleaner look.
- Increase the time font size from
- VERIFY: Check that times are legible, properly aligned, and styled with high-contrast text colors relative to the badge background.
Phase X: Verification Checklist
- Lint: Run
npm run lintornpx eslintto ensure no syntax/type errors. - Build: Run
npm run buildon local machine to check compilation success. - Visual Audit: Verify the table cells display correctly in light and dark modes.
- Accessibility Audit: Ensure text meets color contrast standards.