-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chrome] Fix extension truncation #83000
[Chrome] Fix extension truncation #83000
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
<EuiFlexGroup responsive={false} gutterSize={'none'} className="eui-textTruncate"> | ||
<EuiFlexItem grow={false} className="eui-textTruncate"> | ||
{Breadcrumbs} | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={true} className="chrHeaderNavBreadcrumbs__appendExtensionContainer"> | ||
<HeaderExtension extension={breadcrumbsAppendExtension.content} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #82015 (review) we discussed about a future improvement to allow plugins to mutate the breadcrumb. I think it would be easier to migrate to it later if you were altering the last breadcrumb element instead of creating a flexGroup around it.
Would somethink like
lastCrumb.text = (
<EuiFlexGroup responsive={false} gutterSize={'none'} className="eui-textTruncate">
<EuiFlexItem grow={false} className="eui-textTruncate">
{lastCrumb.text}
</EuiFlexItem>
<EuiFlexItem grow={true} className="chrHeaderNavBreadcrumbs__appendExtensionContainer">
<HeaderExtension extension={breadcrumbsAppendExtension.content} />
</EuiFlexItem>
</EuiFlexGroup>
);
solves the truncation on small width, or are you forced to have the extension outside of the breadcrumb element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text-overflow
is always a pain to use properly. Anyway, as @kibana-design has been requested for review, maybe they could take a look. Else, keeping it as it is would be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason the text-overflow: ellipsis;
isn't being honored here is because the EuiFlexItem
components have a style of display: flex;
. Changing the offending EuiFlexItem
to display: block;
should remedy it (if this is a path you would prefer to take).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelMarcialis, thanks for the tip! it helped and I made it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello. I've left two small comments for your review.
fbfa072
to
29e6c97
Compare
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -51,15 +51,14 @@ export function HeaderBreadcrumbs({ appTitle$, breadcrumbs$, breadcrumbsAppendEx | |||
), | |||
})); | |||
|
|||
if (breadcrumbsAppendExtension) { | |||
if (breadcrumbsAppendExtension && crumbs[crumbs.length - 1]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: isn't bool(crumbs[crumbs.length - 1])
just bool(crumbs.length)
but harder to read 😅 ?
This appears to work as advertised. Before giving my stamp of approval, CCing @cchaos for her opinions regarding:
|
@MichaelMarcialis To answer your specific questions:
For instance the text alignment is not quite right And in the new Amsterdam theme, the styles are especially off. We can merge this for now, but most likely, EUI will have to provide something on the component side to support this directly. |
* master: [Advanced Settings] Introducing telemetry (elastic#82860) [alerts] add executionStatus to event log doc for action execute (elastic#82401) Add additional sources routes (elastic#83227) [ML] Persisted URL state for the "Anomaly detection jobs" page (elastic#83149) [Logs UI] Add pagination to the log stream shared component (elastic#81193) [Index Management] Add an index template link to data stream details (elastic#82592) Add maps_oss folder to code_owners (elastic#83204) fix truncation issue (elastic#83000) [Ingest Manger] Move asset getters out of registry (elastic#83214)
… alerts/action-groups-as-conditions * origin/alerts/stack-alerts-public: (91 commits) removed import from plugin code as it causes FTR to fail [Advanced Settings] Introducing telemetry (elastic#82860) [alerts] add executionStatus to event log doc for action execute (elastic#82401) Add additional sources routes (elastic#83227) [ML] Persisted URL state for the "Anomaly detection jobs" page (elastic#83149) [Logs UI] Add pagination to the log stream shared component (elastic#81193) [Index Management] Add an index template link to data stream details (elastic#82592) Add maps_oss folder to code_owners (elastic#83204) fix truncation issue (elastic#83000) [Ingest Manger] Move asset getters out of registry (elastic#83214) make defaulted field non maybe Remove unused asciidoc file (elastic#83228) [Lens] Remove background from lens embeddable (elastic#83061) [Discover] Unskip flaky tests based on discover fixture index pattern (elastic#82991) Removing unnecessary trailing slash in CODEOWNERS Trying to fix CODEOWNERS again, where was a non-existent team prior (elastic#83236) Trying to fix CODEOWERS, missing a starting slash (elastic#83233) skip flaky suite (elastic#83231) Add enzyme rerender test helper (elastic#83208) Move Elasticsearch type definitions out of APM (elastic#83081) ...
Summary
In #82015 we introduced new extension point for
chrome
that allows externally append an element to the last breadcrumb.That is needed for future send to background UI: #81004
Mocks https://whimsical.com/LMKSnR7vmPrmAypPXYuA8T
I noticed a bug, that extension is not visible in case last breadcrumb is truncated (for example on a mobile device inside a dashboard app with a long dashboard title).
This pr attempt to fix it:
Checklist
Delete any items that are not applicable to this PR.
For maintainers