Skip to content

Aditya-Fix dark mode text visibility in Weekly Project Summary dashboard charts#4620

Open
Aditya-gam wants to merge 23 commits intodevelopmentfrom
Aditya-fix/dark-mode-text-visibility-pr3882
Open

Aditya-Fix dark mode text visibility in Weekly Project Summary dashboard charts#4620
Aditya-gam wants to merge 23 commits intodevelopmentfrom
Aditya-fix/dark-mode-text-visibility-pr3882

Conversation

@Aditya-gam
Copy link
Copy Markdown
Contributor

@Aditya-gam Aditya-gam commented Dec 24, 2025

Description

Fixes dark mode text visibility issues across multiple charts in the Weekly Project Summary dashboard by replacing native HTML date inputs with react-datepicker components and implementing consistent dark mode styling.

IssueDescription1 IssueDescription2 IssueDescription3

Related PRs (if any):

Main changes explained:

Key Changes:

  1. Date Input Migration (4+ components):
    • Replaced native <input type="date"> with react-datepicker for better dark mode styling
    • Updated date state from strings to Date objects
    • Added date range validation (minDate/maxDate constraints)
    • Files: ToolsAvailabilityPage.jsx, DistributionLaborHours.jsx, ExpenseBarChart.jsx, ToolsHorizontalBarChart.jsx
  2. Dark Mode Styling:
    • Standardized color scheme: #2b3344 backgrounds, #fff text, #253342 chart containers
    • Added high-specificity CSS selectors to prevent global style overrides
    • Created/updated CSS modules for consistent styling across charts
  3. Chart Components Updated:
    • Tools: Availability page, Horizontal bar chart, Tool status donut chart
    • Financials: Expense bar chart (new CSS module)
    • Labor: Distribution of Labor Hours
    • Charts: Project Risk Profile Overview, Supplier Performance, Injury Severity, Longest Open Issues
    • UI Elements: Project Status cards, Most Frequent Keywords filters
  4. Code Quality:
    • Refactored nested ternary operations for readability
    • Improved button contrast in light mode (DistributionLaborHours)
    • Maintained accessibility (ARIA labels, semantic HTML)

How to test:

  1. Checkout branch: Aditya-fix/dark-mode-text-visibility-pr3882
  2. Reinstall dependencies and clear cache: rm -rf node_modules && yarn cache clean
  3. Run yarn install and start the app: yarn start:local
  4. Login as owner/admin.
  5. Navigate to BM Dashboard → Weekly Project Summary
  6. Test dark mode toggle - verify all charts switch properly
  7. Test key components:
    • Tools Availability: date range pickers, project selection
    • Distribution of Labor Hours: date filters, submit button contrast
    • Expense Bar Chart: project/category dropdowns, date filters
    • Project Risk Profile: multi-select dropdowns, chart axes visibility
    • Issues charts: background color (#253342), filter styling

Verify: All text is readable in both modes, date pickers function correctly, no console errors, consistent styling across components.

Screenshots or videos of changes:

TestVideo.mov

Note:

  • Changed date components to react-datepicker.
  • Styles for PaidLaborCost chart are fixed in PR #4496

- Update filter dropdowns to use #2b3344 background and #fff text in dark mode
- Change chart container background from #1e1e1e to #253342 in dark mode
- Set axes labels to #fff in dark mode for better visibility
- Refactor nested ternary operations for improved code readability
- Add high-specificity CSS selectors to prevent style overrides
- Update container background from #121212 to #253342 in dark mode
- Change chart background to #253342 in dark mode
- Set axes labels to #fff for better visibility
- Update filter dropdowns and date pickers to use #2b3344 background and #fff text
- Add high-specificity CSS selectors to prevent style overrides
- Refactor nested ternary operations for improved code readability
…lters

- Set date range filter placeholder text color to #fff in dark mode
- Add high-specificity CSS selectors to prevent style overrides
- Target both direct className and react-datepicker wrapper structures
- Add dark mode styles for select and date input filters with #2b3344 background and #fff text
- Use high-specificity CSS selectors to prevent style overrides from global styles
- Add white dropdown arrow for select elements in dark mode
- Create CSS module to replace inline styles for better maintainability
- Replace native HTML5 date inputs with react-datepicker components
- Update date state from strings to Date objects
- Remove native date input CSS and add react-datepicker styles
- Add dark mode styles for date picker inputs and calendar popup
- Follow pattern from InjuryCategoryBarChart for consistency
…tionLaborHours

Replace native HTML date inputs with react-datepicker components to properly support dark mode styling. Add high-specificity CSS selectors for datepicker inputs with #2b3344 background and #fff text color in dark mode, following the pattern used in InjuryCategoryBarChart.
…y Availability chart

- Replace native HTML date inputs with react-datepicker components
- Add dark and light mode styling for datepickers matching reference implementation
- Restructure filters into 2x2 grid layout for improved visual organization
- Update date state management to use Date objects instead of strings
Update button colors from black to light gray shades for better visual consistency. Hover state uses darker gray for improved feedback.
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 24, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 2190186
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69ab9595d420130008659d45
😎 Deploy Preview https://deploy-preview-4620--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Update CustomTooltip component to accept darkMode prop and apply conditional styling for better contrast and readability in dark mode.
Extract common chart styling and utility functions into a centralized
module to eliminate code duplication across BMDashboard chart components.
This addresses SonarQube duplication violations where the codebase exceeded
the 3% duplication threshold at 15.4%.

Created src/utils/bmdashboard/chartUtils.js with shared utilities:
- toYMD(): Date formatting function for YYYY-MM-DD conversion
- getSelectStyles(): React-select styling configuration for dark/light modes
- getDatePickerStyles(): Inline styles for react-datepicker components
- getChartAxisProps(): Common Recharts axis styling props

Refactored the following components to use shared utilities:
- openIssueCharts.jsx: Removed ~100 lines of duplicated select styles
- ProjectRiskProfileOverview.jsx: Removed ~100 lines of duplicated select styles
- InjuryCategoryBarChart.jsx: Removed ~100 lines of duplicated code
- ToolsHorizontalBarChart.jsx: Removed ~60 lines of duplicated code

Total reduction: ~360+ lines of duplicated code eliminated while
maintaining existing functionality and visual appearance. All components
now share consistent styling logic, making future maintenance easier.
@sonarqubecloud
Copy link
Copy Markdown

…resolve conflicts

Resolved conflicts in:
- issueChart.module.css (syntax + @media fix)
- openIssueCharts.jsx
- DistributionLaborHours.jsx & .module.css
- InjuryCategoryBarChart.jsx & .module.css
- ProjectRiskProfileOverview.jsx & .module.css
- ToolsAvailabilityPage.jsx & .module.css
- ToolsHorizontalBarChart.module.css
- WeeklyProjectSummary.jsx

Fix: remove duplicate .weeklyStatusChange selector in WeeklyProjectSummary.module.css (stylelint no-duplicate-selectors).
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@rohanrastogi311 rohanrastogi311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditya,

Well done with this implementation, however, small issue with the drop boxes on"Labor and Time tracking".

Image Image Image

Copy link
Copy Markdown

@HemanthNidamanuru HemanthNidamanuru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditya,

Nice work on this implementation overall. I noticed that in the “Labor and Time Tracking” section, the dropdown boxes are not properly aligned with the background. Also, in the “Lessons Learned” tab, the selected fields are not clearly visible. Could you please review the styling and rendering in both sections?

Image Image

Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditya,

I have reviewed your PR locally and though most of the chart are adapted to dark mode. The Labor and Time Tracking start and end date as well as the Lesson Learned dropdown selection is not adapted to dark mode.

Image Image

… hours

Apply darkMode class to container and remove inline styles from date pickers so existing module CSS controls appearance.

Made-with: Cursor
Style multi-value chips, placeholder, and input in dark mode for visibility.

Made-with: Cursor
… files

- MostFrequentKeywords.module.css: dev uses classNamePrefix=data-select so
  dev CSS targeting data-select__* is required; our project-select__* rules
  would be dead code
- ProjectRiskProfileOverview.jsx: dev version is superset — adds click-outside
  detection, CSS module adoption, chart tooltip theming, removes console.log
- ProjectRiskProfileOverview.module.css: dev JSX references new class names
  (.chartCard, .filterContainer, .formGroup, .dropdownMenu); our old names
  (.wrapper, .container, .filterRow) are no longer used
- SupplierPerformanceGraph.jsx: dev adds darkMode Redux, chartTheme object,
  CustomTooltip outside component, proper Y-domain, removes console.logs
- WeeklyProjectSummary.module.css: dev JSX (auto-resolved) references layout
  classes only present in dev CSS (.toolsTrackingLayout, .lessonsLearnedGrid,
  .financialsGrid, etc.); required for page layout correctness
The development version of SupplierPerformanceGraph.jsx imports this CSS
module but the file was not present on this branch, causing the build to
fail. Taken directly from development branch (no changes on this branch).
…lution

- MostFrequentKeywords.jsx: fix classNamePrefix mismatch — CSS module
  targets data-select__* classes (dev version) but JSX still generated
  project-select__* classes, making all react-select dark mode CSS dead code.
  Changed classNamePrefix from 'project-select' to 'data-select'.

- WeeklyProjectSummary.module.css: re-add .weeklyStatusChange class that
  was present in branch's CSS but missing from the development version we
  took during conflict resolution. WeeklyProjectSummary.jsx uses
  styles.weeklyStatusChange, which requires the camelCase class to exist.
  Uses --wow-color CSS variable (already set via inline style on the card)
  to apply the correct color for positive/negative/neutral change indicators.
.darkMode .statusCard had background: var(--card-bg) !important which
overrode the inline style={{ backgroundColor: cardBg }} set in JSX.
Since CSS !important beats inline styles, all cards were rendered with
the same flat #2b3e59 background, losing the accent-tinted colors
computed by darkTintedCardBg().

Removed only the background override — color and border-color rules
remain to ensure text and borders are correctly themed.
@Aditya-gam
Copy link
Copy Markdown
Contributor Author

Hi guys,
I have made changes so now both the Labor and time tracking and lessons learned charts have properly adjusted to dark mode.

Screenshot 2026-03-06 at 7 00 47 PM Screenshot 2026-03-06 at 7 01 24 PM

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 7, 2026

Copy link
Copy Markdown

@rohanrastogi311 rohanrastogi311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditya,

Good fix, paid labor cost now has white boxes in dark mode.

Image

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.

4 participants