Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden) - #5437
Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden)#5437Jaden300 wants to merge 16 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ndering across BMDashboard
9abfb9e to
96d5252
Compare
|
AdiDubbs
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 @@ | |||
| /** | |||
There was a problem hiding this comment.
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.



Jaden taking over for Carlos/Shravan fix conflicts 4351 (DONE Jaden)
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 developmentcalls pulling in unrelated work from other PRs. This PR resets to a clean base offdevelopmentand 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
development- removed ~190 passenger files from other PRs that had accumulated via merge commitsBug fixes
ENDPOINTS.BM_PROJECTS_LIST_FOR_MATERIALS_COST- did not exist - changed toENDPOINTS.BM_PROJECTS)projectId/projectName- changed to_id/nameto match actual API response)issueCharts.css,DarkMode.css,autoComplete.css) that pointed to deleted or non-existent filesStyling
word-break: break-word, deprecated@document, invalidprefers-contrast: highCode quality
typeattributes, array index keys, mutating.sort()replaced with.toSorted(), optional chaining, unused imports, nested ternaries,.removeChildreplaced with.remove()ToolStatusDonutChartcognitive complexity from 25 to under 15 by extractinggetChartDimensions,NoDataView, andDonutChartViewTests
TotalMaterialCostPerProject.test.jsxnow passLeaderboard.test.jsxpassHow to test
shravan-fix-conflicts-4351npm installandnpm run start:localbmdashboard/totalconstructionsummaryvid.mov