Skip to content

Conversation

JeanMarcMilletScality
Copy link
Contributor

@JeanMarcMilletScality JeanMarcMilletScality commented Sep 8, 2025

Reworks Global health bar using Recharts lib
Tooltip:

  • Use Portal for tooltip to avoid clipping issue when GlobalHealthBar is in a container

Label:

  • Add calculation and conditions for ticks labels to have consistent spacing between labels and have same behavior as previous chart
  • Add margin to chart to avoid label clipping

Next Step: Add round edges to bars when bars is at start or end of chart (use mask?)

@bert-e
Copy link
Contributor

bert-e commented Sep 8, 2025

Hello jeanmarcmilletscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Sep 8, 2025

Conflict

There is a conflict between your branch feature/global-health-bar-recharts and the
destination branch development/1.0.

Please resolve the conflict on the feature branch (feature/global-health-bar-recharts).

git fetch && \
git checkout origin/feature/global-health-bar-recharts && \
git merge origin/development/1.0

Resolve merge conflicts and commit

git push origin HEAD:feature/global-health-bar-recharts

@JeanMarcMilletScality JeanMarcMilletScality force-pushed the feature/global-health-bar-recharts branch from c6c8af7 to 73aebbd Compare September 8, 2025 14:32
@bert-e
Copy link
Contributor

bert-e commented Sep 8, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JeanMarcMilletScality JeanMarcMilletScality marked this pull request as ready for review September 8, 2025 14:33
@bert-e
Copy link
Contributor

bert-e commented Sep 10, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JeanMarcMilletScality JeanMarcMilletScality force-pushed the feature/global-health-bar-recharts branch 2 times, most recently from 9c35fde to 5e1f951 Compare September 10, 2025 15:35
@bert-e
Copy link
Contributor

bert-e commented Sep 12, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@bert-e
Copy link
Contributor

bert-e commented Sep 12, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JeanMarcMilletScality JeanMarcMilletScality force-pushed the feature/global-health-bar-recharts branch from 1d9f433 to 14b943c Compare September 15, 2025 13:13
@bert-e
Copy link
Contributor

bert-e commented Sep 15, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

JBWatenbergScality and others added 18 commits September 17, 2025 15:29
…oltip functionality and data handling. Remove unused HistoryProvider and HistorySlider components. Update tooltip styling and data structure for alerts.

Add 'Small' variant to text component
…actor data handling with useHealthBarData hook.
…XAxis component and consolidating utility constants in utils.tsx. Update CustomTooltip to accept tooltipProps for enhanced functionality.
…lobalHealthBar. Update GlobalHealthBar to utilize the new portal for tooltip display, enhancing positioning and visibility.
@JeanMarcMilletScality JeanMarcMilletScality force-pushed the feature/global-health-bar-recharts branch from 14b943c to fcdaae5 Compare September 17, 2025 13:43
@bert-e
Copy link
Contributor

bert-e commented Sep 17, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

startTimestamp: number,
endTimestamp: number,
) => {
return (props: any, key: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return (props: any, key: string) => {
return (props: SHOULD_BE_RECT_PROPS, key: string) => {


setTooltipPosition({ left, top });
}
}, [coordinate, chartContainerRef]);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit(for later): I feel like the whole logic of the effect also needs to be executed on scroll and window resize 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably some of this can be computed using utils from floating-ui instead of re-inventing the wheel 🤔

Comment on lines +41 to +59
shouldShowLabel && (
<g transform={`translate(${payload.coordinate},${y})`}>
<text
textAnchor="middle"
dy={10}
dx={edgeMargin}
fontSize={fontSize.smaller}
fill={theme.textSecondary}
>
{is7DaySpan || isDaySpan ? (
<FormattedDateTime
format="day-month-abbreviated-hour-minute"
value={new Date(payload.value)}
/>
) : (
<FormattedDateTime format="time" value={new Date(payload.value)} />
)}
</text>
</g>
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the same logic for linetemporal chart and temporal bar charts ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no such logic in Barchart but we could use it in Line chart

Comment on lines 44 to 53
const handlePointerEnter = useCallback(
(key: string) => {
setTooltipData(data[0][`alert_${key}`]);
},
[data],
);

const handlePointerLeave = useCallback(() => {
setTooltipData(null);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't be only pointer, but focus changes so that keyboard navigation can trigger the tooltip

dataKey: string;
yAxisId: string;
fill: string;
shape: (props: BarProps) => JSX.Element;
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure we can replace this props by alertstartTime and endTime and simplify usage of this alertBar component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JBWatenbergScality Remove it as proper data for recharts make it useless

* Calculates rectangle properties for alert bars
*/
export const getRectangleProps = (
props: any,
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to type this

);

const data = useMemo(
() => [
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure to understand why data needs to be an array if there is always a single entry in there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because Barchart expect an array for data.
I compute everything in data so I propose to separate the data needs for the barchart from the data for tooltip and bars

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.

3 participants