Skip to content

Shubham - Fix calendar icon visibility in Weekly Progress dark mode - #5717

Open
shubhamjakhete wants to merge 1 commit into
developmentfrom
shubham-fix-weekly-progress-calendar-dark-mode
Open

shubhamjakhete wants to merge 1 commit into
developmentfrom
shubham-fix-weekly-progress-calendar-dark-mode

Conversation

@shubhamjakhete

Copy link
Copy Markdown
Contributor

Description

Fixes (PRIORITY HIGH) Phase 2 Summary Dashboard: Fix the calender icon issue in Dark Mode.

On the Weekly Progress dashboard (/weeklyprogress), the calendar icons inside the Start date and End date inputs were rendered dark on the dark background when dark mode was on. This made the date picker icons almost invisible, so it was not obvious that the fields open a calendar.

Root cause

The date fields are native <input type="date"> elements. The calendar icon is drawn by the browser, not by our CSS, and the browser picks a light or dark icon based on the element's color-scheme. The inputs had no color-scheme set, so the browser always used the default (light) style, which has a dark icon, even when the page was in dark mode.

Related PRS (if any):

None. This is a frontend-only change; no backend changes are needed.

Main changes explained:

  • Update src/components/WeeklyProgress/WeeklyProgress.module.css
    • Add color-scheme: dark to the date inputs when body.dark-mode is active. This tells the browser to draw the native date control in its dark style, so the calendar icon becomes light and the date picker popup also opens with a dark background.
    • Add cursor: pointer to the calendar icon in dark mode.
    • Light mode is unchanged; the new rules only apply when body.dark-mode is present.
    • The fix intentionally uses only color-scheme: dark, without filter: invert() on ::-webkit-calendar-picker-indicator. Some other components combine both, but together they cancel each other out and turn the icon dark again.
  • Update src/routes.jsx
    • Re-add the /weeklyprogress route and the WeeklyProgressDashboard import. The route had been removed from development, so the page could not be opened to test or use the fix. It uses the same path and permission (weeklySummariesReport) as the original route.
  • Stylelint auto-fixes in WeeklyProgress.module.css
    • The pre-commit hook lints the whole file, and it already had 29 stylelint errors that were there before this change. These were fixed with stylelint --fix: rgba(r, g, b, a) changed to rgb(r g b / a%), (min-width: 900px) changed to (width >= 900px), and some blank lines were adjusted. These are notation changes only and do not change how the page looks.

How to test:

  1. Check out this branch: git checkout shubham-fix-weekly-progress-calendar-dark-mode
  2. Run npm install, then npm run start:local
  3. Start the backend (HGNRest) so the page can load its data
  4. Clear site data/cache
  5. Log in as an admin user
  6. Go to http://localhost:5173/weeklyprogress
  7. Light mode: verify the calendar icons in Start date and End date are visible and look the same as before
  8. Switch to dark mode (profile dropdown in the header → Dark Mode toggle)
  9. Dark mode: verify both calendar icons are now light and clearly visible on the dark background
  10. In dark mode, click each calendar icon and verify the date picker opens and is readable
  11. Select a start and end date and verify the KPI tiles and chart update
  12. Click the Last 4 / 8 / 12 Weeks buttons and verify they still work in both modes

Screenshots or videos of changes:

Screenshot 2026-10-25 at 8 05 52 PM Screenshot 2026-10-25 at 8 06 06 PM

Note:

  • The /weeklyprogress route is re-added in this PR because the page was not reachable on development without it. If the route was removed on purpose, please let me know and I will take that part out of the PR.
  • The changes are limited to the Weekly Progress component's CSS module and one route entry in routes.jsx. No other pages are affected.

The start and end date inputs on the Weekly Progress dashboard showed
a dark calendar icon on the dark background, so the date picker was
hard to find in dark mode.

Set color-scheme: dark on these inputs when body.dark-mode is active,
so the browser renders the calendar icon and the picker popup in its
dark variant. Light mode is unchanged.

Re-add the /weeklyprogress route, which had been removed from the
development branch, so the dashboard can be opened and tested. It
uses the same path and permission as the original route.

Also apply stylelint auto-fixes to existing rules in this file (modern
rgb() and media range notation, blank lines). They are required by
the pre-commit hook and do not change how the page looks.
@netlify

netlify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit b9ca53d
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6adec7e7bc196545b74043e9
😎 Deploy Preview https://deploy-preview-5717--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant