Skip to content

Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden) - #5437

Open
Jaden300 wants to merge 15 commits into
developmentfrom
shravan-fix-conflicts-4351
Open

Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden)#5437
Jaden300 wants to merge 15 commits into
developmentfrom
shravan-fix-conflicts-4351

Conversation

@Jaden300

@Jaden300 Jaden300 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden)

This is a redo integrating the feedback on this closed PR: #4954

Description

Took over from Carlos/Shravan to bring PR #4351 (dark mode implementation for the Total Construction Summary page) to a mergeable state.

The previous branch had accumulated ~212 files due to repeated git merge development calls pulling in unrelated work from other PRs. This PR resets to a clean base off development and cherry-picks only the 22 files belonging to Carlos's original dark mode work, then resolves all blocking issues.

Related PRs

Changes made

Branch cleanup

  • Reset to a clean branch off development - removed ~190 passenger files from other PRs that had accumulated via merge commits
  • Cherry-picked only Carlos's 22 original dark mode files

Bug fixes

  • Fixed broken API endpoint (ENDPOINTS.BM_PROJECTS_LIST_FOR_MATERIALS_COST - did not exist - changed to ENDPOINTS.BM_PROJECTS)
  • Fixed field name mismatch in project data mapping (projectId/projectName - changed to _id/name to match actual API response)
  • Removed dead imports (issueCharts.css, DarkMode.css, autoComplete.css) that pointed to deleted or non-existent files

Styling

  • Fixed all stylelint violations: descending specificity, single-line declarations, deprecated word-break: break-word, deprecated @document, invalid prefers-contrast: high
  • Replaced all inline styles in DistributionLaborHours with CSS module classes
  • Fixed all WCAG 4.5:1 contrast violations on disabled option text, button colors, and link colors

Code quality

  • Resolved all SonarCloud issues: unused variables, missing button type attributes, array index keys, mutating .sort() replaced with .toSorted(), optional chaining, unused imports, nested ternaries, .removeChild replaced with .remove()
  • Reduced ToolStatusDonutChart cognitive complexity from 25 to under 15 by extracting getChartDimensions, NoDataView, and DonutChartView

Tests

  • All 6 unit tests in TotalMaterialCostPerProject.test.jsx now pass
  • All 12 unit tests in Leaderboard.test.jsx pass
  • All 29 tests in the pre-push suite pass

How to test

  1. Check out branch shravan-fix-conflicts-4351
  2. Run npm install and npm run start:local
  3. Log in as an admin user
  4. Navigate to bmdashboard/totalconstructionsummary
  5. Toggle dark mode ON - verify all sections render correctly (Risk Profile, Issue Tracking, Tools and Equipment, Labor Hours, Financials, Material Costs)
  6. Toggle dark mode OFF - verify light mode works correctly
  7. Check dropdowns, date pickers, chart tooltips in both modes
  8. Navigate to the Leaderboard page - verify dark mode toggle works and table renders correctly
  9. Navigate to the Experience Donut Chart - verify dark mode renders correctly
vid.mov

@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 11cc64c
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a80c5096a5a180008245d37
😎 Deploy Preview https://deploy-preview-5437--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.

@Jaden300 Jaden300 closed this Aug 8, 2026
@one-community one-community reopened this Aug 8, 2026
@Jaden300
Jaden300 force-pushed the shravan-fix-conflicts-4351 branch from 9abfb9e to 96d5252 Compare August 8, 2026 21:29

@AdiDubbs AdiDubbs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The cleanup makes this much easier to review, but there is one runtime blocker.

InjuryCategoryBarChart removes setChartKey from the state destructure while continuing to call it after loading, which throws before the chart can settle. The new shared select-style helper is also only wired into SupplierPerformanceGraph while the touched injury chart retains separate dark-mode styles.

The branch is currently 30 commits behind development, so please rebase and retest the chart after fixing the runtime error.


// ✅ NEW: key to force Recharts remount when needed (fixes "renders only on hover")
const [chartKey, setChartKey] = useState(0);
const [chartKey] = useState(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

setChartKey is still called on line 153, but the setter has been removed from this state destructure. Once loading finishes, the animation-frame callback throws ReferenceError: setChartKey is not defined. Please either restore the setter or remove the remount effect and key={chartKey} together.

@@ -0,0 +1,78 @@
/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice abstraction, but only SupplierPerformanceGraph imports this helper so far. The touched InjuryCategoryBarChart still uses its own react-select control, menu, and option styles with different dark-mode colours. Either migrate that chart as part of this shared-style work or narrow the docstring so it does not describe a single source of truth that is not yet in use.

@ShreyasB02 ShreyasB02 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested the changes locally; here are the suggested changes.

Screenshot
  1. In the Trend Summary Table’s risk-profile section, highlighted rows in dark mode render their text unreadable due to insufficient contrast; the highlighted text should remain clearly visible.
Screenshot
  1. Issues Breakdown Section: Under the Total Material Cost Per Project graph, the greyed-out text is not clearly visible and is hard to read in dark mode
Screenshot
  1. Under the financials section, the date field still has a white background, and the text is not visible in dark mode in those fields.
Screenshot
  1. Under the Global Distribution and Project Status Overview, the start date and end date fields do not support dark mode. The text is completely invisible.
Screenshot
  1. Under labor time and tracking, under the paid labor section, the background color of the date field is white. Needs to be changed to dark mode like the other fields.

@Adit0717 Adit0717 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested on shravan-fix-conflicts-4351. Dark mode toggle works, but need fixes for some elements before merge:

  1. Trend Summary Table - row hover breaks text contrast, hovering a row in the Trend Summary Table lights the row background white/light-blue, making the row unreadable.

  2. Hover tooltips (e.g. on the Trend Summary Table) are either: - Cut off at the edge, truncating the tooltip text, making both the tooltip and the row behind it hard to read.

  3. Date input boxes don't switch to dark mode - They stay white with black text even when the rest of the page is dark. This shows up on: Financials → Cost Variance Trend, Cost Breakdown by Category, Labor and Time Tracking → Paid Labor Cost

Image Image Image

@RuthwikHM RuthwikHM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested this locally. Found some issues

The map becomes illegible of sorts. The contrast in colors does not make it easy to read the text on the map.
Image

The labour cost chart seems to be getting compressed and text and the graph itself is not easy to get insights from. Not sure if this is from some missed files during merge from main.
Image

Some of the colors here make the text hard to make out. Using slightly darker shades of those colors like the yellow or some of the pinks could help with this.
Image

Another instance of the chart getting compressed to a very small size resulting in making it hard to reach the chart.
Image

Checked out the rest of the changes and they work well.
https://github.com/user-attachments/assets/ecc3e7a2-3f07-4986-83ed-7b1568cf4d9d

@Jaden300
Jaden300 force-pushed the shravan-fix-conflicts-4351 branch from 68d6337 to 11cc64c Compare August 15, 2026 19:59
@sonarqubecloud

Copy link
Copy Markdown

@RuthwikHM RuthwikHM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The issues mentioned in this review here are still not fixed.

Image Image Image Image Image

@linlin-husky linlin-husky left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested locally on branch shravan-fix-conflicts-4351 in Dark Mode as an Admin user.

Confirmed multiple dark mode styling and contrast defects across different sections:

  1. Calendar Date Picker Popups (Lessons Learned & Global Distribution):

    • Lessons Learned (Injury Severity by Category of Worker Injured): Clicking on Start date / End date opens a calendar popup with a solid white background and invisible white text.
    • Global Distribution and Project Status Overview: Clicking on Start Date / End Date opens a calendar popup with a solid white background where the month header, weekday labels, and dates render in white text, making them completely unreadable.
  2. Date Input Fields (Financials -> Cost Breakdown by Category):

    • The From and To date picker inputs retain a solid white background in Dark Mode with invisible/white text.
  3. Reset Filter Button & Filter Inputs Contrast (Financials -> Planned vs Actual Cost):

    • The Reset Filter button renders with a bright white background and light/white text, creating a severe contrast issue.
    • The filter input and select fields in this section also render with solid white backgrounds in Dark Mode, leading to text legibility issues.

Please see the attached screenshots and ensure consistent dark mode styling across tables, input fields, popup calendars, and buttons.

Image Image Image 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.

9 participants