[Uptime] Feature/80166 add waterfall flyout#89449
[Uptime] Feature/80166 add waterfall flyout#89449dominiqueclarke merged 55 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/uptime (Team:uptime) |
dominiqueclarke
left a comment
There was a problem hiding this comment.
Need to add telemetry and consider accessibility enhancements.
|
|
||
| let formattedValue = formatValueForDisplay(value); | ||
|
|
||
| if (postFix) { |
There was a problem hiding this comment.
I could refactor this to add a default parameter of an empty string to post fix and then not have to have this if statement when postfix is undefined.
There was a problem hiding this comment.
++, if we do this we should also consider that we'd be adding a new whitespace char that wouldn't have been there with the current solution. Not sure how much this matters.
There was a problem hiding this comment.
Yeah you're right. I hadn't considered that the first time around. I think I'll leave it as is for now.
| return formattedValue; | ||
| }; | ||
|
|
||
| const getValueForOffset = (item: NetworkItem): number => { |
There was a problem hiding this comment.
These were just moved.
x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/waterfall/types.ts
Outdated
Show resolved
Hide resolved
| import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; | ||
| import { networkItems as mockNetworkItems } from './data_formatting.test'; | ||
|
|
||
| describe('WaterfallChartWrapper', () => { |
There was a problem hiding this comment.
The waterfall chart wrapper is the best place to do unit tests that are as integrated from a front end perspective as a possible. From this parent component I can test the interaction of the click on the sidebar to opening the flyout. I have no idea how to test canvas clicks for actual clicks on the chart, and a bit of research didn't provide immediate results. Let me know if you have any ideas.
|
|
||
| import { useWaterfallContext } from '../context/waterfall_chart'; | ||
|
|
||
| export const DETAILS = i18n.translate('xpack.uptime.synthetics.waterfall.flyout.details', { |
There was a problem hiding this comment.
Is it preferred to put content in external content files, or within the component. Feel like I've seen it done both ways. Same with styled components.
There was a problem hiding this comment.
My personal preference is to just keep them inline, but this is fine as well. I think I'm in a minority, most people feel a constant like this improves readability. If it's referenced in more than one place I tend to extract them to a centralized file.
There was a problem hiding this comment.
I go back and forth between what I prefer. I feel like inline is often more readable and easier for maintenance, but external also helps for referencing it in RTL tests. Right now I'm mostly using whatever pattern is established in the file I'm working in at the time. I'd love to discuss it further later.
|
|
||
| export const useFlyout = (metaData: WaterfallMetaData) => { | ||
| const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); | ||
| const [flyoutData, setFlyoutData] = useState<WaterfallMetaDataEntry>({ |
There was a problem hiding this comment.
I mean to change this to undefined instead of a object that matches the shape with null values.
| </EuiFlexItem> | ||
| </EuiFlexGroup> | ||
| {shouldRenderLegend && <Legend items={legendItems!} render={renderLegendItem!} />} | ||
| <WaterfallFlyout /> |
There was a problem hiding this comment.
I should maybe defer the render to the Waterfall to the WaterfallChartWrapper like other renders.
418a2f5 to
778fa3d
Compare
|
The flyout looks good, great having this additional info available for each of the requests. I seem to be seeing a different metric being given in the mouseover compared with the flyout for the connection time. Where we already have this data being shown (in the mouseover on the chart, and the legend), can we make them use the same labels, for example Also, will the header sections (certificate, request, response) be collapsible (like in the mockup), or just listed like this? It might also be worth putting the certificate header below the request and response (as they tend to be most valuable in that order, of req > resp > cert). With the font being quite large for the URL, it still suffers the truncation we have elsewhere on the chart. Should we try and add an option to make it easier to get the URL (like described here)? |
|
Thank you @dominiqueclarke this is looking great! Regarding lines showing a numeric value like:
|
|
@katrin-freihofner @dominiqueclarke |
Thanks for taking a look at this.
|
…-add-waterfall-flyout
|
Thanks @dominiqueclarke, let's make the full URL requirement for this to also be part of #87189 (I've added it in there as a requirement). #87189 isn't currently down for 7.12. If we do do it, we may want @elastic/observability-design to check the existing mock up is ok as an implementation/ux before we do. |
…om/dominiqueclarke/kibana into feature/80166-add-waterfall-flyout
221701b to
df6699a
Compare
df6699a to
7406334
Compare
FYI this was resolved. |
|
|
||
| describe('WaterfallFlyout', () => { | ||
| const flyoutData: WaterfallMetaDataEntry = { | ||
| const flyoutData: WaterfallMetadataEntry = { |
There was a problem hiding this comment.
Thanks for changing the metadata naming, we could've held off on it but it's nice to be cleared up 🙂
| <EuiTitle size="s"> | ||
| <h2 id="flyoutTitle"> | ||
| <MiddleTruncatedText text={url} url={url} /> | ||
| <EuiFlexItem> |
There was a problem hiding this comment.
Out of curiosity, why EuiFlexItem outside of an EuiFlexGroup?
There was a problem hiding this comment.
EuiFlexItem applies display flex, without any additional flex-grow properties, and flex-direction column. This is exactly what I need for this scenario. EuiFlexGroup applies display flex, additional flew-grow properties, and applies flex-direction row by default. These can be overwritten but seems like extra markup and html nodes.
There was a problem hiding this comment.
Interesting i have never thought of using EuiFlexItem independently.
justinkambic
left a comment
There was a problem hiding this comment.
LGTM - smoke-tested with OBLT edge and it looks really good.
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
* adjust network events * add metaData to data formatting * add useFlyout * adjust waterfall data types * adjust MiddleTruncatedText to use span instead of div * add flyout * adjust sidebar button style * update tests * convert content to use sentence case * pass onBarClick and onProjectionClick as WaterfallChart props * use undefined value for initial flyoutData state * add telemetry * adjust typo in get_network_events * adjust connection time * added space between value and units * adjust flyout spacing, rearrange certificates, and right align values * adjust flyout labels * add focus management support to flyout * improve performance with memoization * add external link to MiddleTruncatedText * update data_formatting function * remove EuiPortal * add moment mock to data_formatting test * adjust data_formatting * adjust network_events runtime types * remove extra space in test tile * toggle flyout on sidebar click * update styling and html for open in new tab resource link * rename metaData to metadata * adjust MiddleTruncatedText styling * adjust WaterfallFlyout heading * adjust waterfall sidebar item types * adjust SidebarItem onClick type * fix license header * align middle truncated text left * move flyout logic to a render prop for better composability * add ip to flyout * update label for bytes downloaded (compressed) * lowercase compressed Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
|
Backport result |
* adjust network events * add metaData to data formatting * add useFlyout * adjust waterfall data types * adjust MiddleTruncatedText to use span instead of div * add flyout * adjust sidebar button style * update tests * convert content to use sentence case * pass onBarClick and onProjectionClick as WaterfallChart props * use undefined value for initial flyoutData state * add telemetry * adjust typo in get_network_events * adjust connection time * added space between value and units * adjust flyout spacing, rearrange certificates, and right align values * adjust flyout labels * add focus management support to flyout * improve performance with memoization * add external link to MiddleTruncatedText * update data_formatting function * remove EuiPortal * add moment mock to data_formatting test * adjust data_formatting * adjust network_events runtime types * remove extra space in test tile * toggle flyout on sidebar click * update styling and html for open in new tab resource link * rename metaData to metadata * adjust MiddleTruncatedText styling * adjust WaterfallFlyout heading * adjust waterfall sidebar item types * adjust SidebarItem onClick type * fix license header * align middle truncated text left * move flyout logic to a render prop for better composability * add ip to flyout * update label for bytes downloaded (compressed) * lowercase compressed Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
…yout (#246343) ## Summary Related to #245413 Removes the manual z-index: `euiZLevel5` override from the waterfall flyout component to ensure compatibility with the new EUI Flyout System. The override was lowering the flyout's z-index below EUI's default. This override is very old (2021) [PR](#89449), and I couldn't identify why. Keeping or removing that override didn't change anything in the UI.



Summary
Adds #80166
Adds #87189
This PR adds a flyout with a summary of data points for each resource. The flyout can be triggered on a sidebar click, a bar click, or a click on any part of the chart row.
Checklist
Delete any items that are not applicable to this PR.
For maintainers