Skip to content
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

[Dashboard][Papercut] Customize overflow text for Links Panel #199844

Closed
wants to merge 21 commits into from

Conversation

rshen91
Copy link
Contributor

@rshen91 rshen91 commented Nov 12, 2024

Summary

Closes #199829

Editor toggle options added

Screenshot 2024-11-13 at 10 35 09 AM

This PR introduces a setting for the link editor panels. Users can decide to wrap text for long links or use the default clip with ellipsis.

Text wrap

Screenshot 2024-11-13 at 10 34 18 AM

Ellipses

Screenshot 2024-11-13 at 10 34 48 AM

Checklist

@rshen91 rshen91 self-assigned this Nov 12, 2024
@rshen91 rshen91 added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas papercut Small "burr" in the product that we should fix. release_note:enhancement backport:skip This commit does not require backporting labels Nov 13, 2024
@rshen91 rshen91 marked this pull request as ready for review November 14, 2024 14:36
@rshen91 rshen91 requested review from a team as code owners November 14, 2024 14:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@botelastic botelastic bot added the Feature:Drilldowns Embeddable panel Drilldowns label Nov 14, 2024
@Heenawter Heenawter self-requested a review November 14, 2024 15:01
Comment on lines 55 to 82
<EuiSpacer size="s" />
<EuiSwitch
compressed
name="overflowEllipsis"
label={dashboardDrilldownConfigStrings.component.getOverflowEllipsis()}
checked={options.overflowEllipsis}
onChange={() =>
onOptionChange({
overflowEllipsis: !options.overflowEllipsis,
overflowTextWrap: !options.overflowTextWrap,
})
}
data-test-subj="dashboardDrillDownOptions--overflowEllipsis--checkbox"
/>
<EuiSpacer size="s" />
<EuiSwitch
compressed
name="overflowTextWrap"
label={dashboardDrilldownConfigStrings.component.getOverflowTextWrap()}
checked={options.overflowTextWrap}
onChange={() =>
onOptionChange({
overflowTextWrap: !options.overflowTextWrap,
overflowEllipsis: !options.overflowEllipsis,
})
}
data-test-subj="dashboardDrillDownOptions--overflowTextWrap--checkbox"
/>
Copy link
Contributor

@Heenawter Heenawter Nov 14, 2024

Choose a reason for hiding this comment

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

@rshen91 I think it is confusing to have seperate "Wrap text" and "Ellipses" toggles - these components should be used for entirely distinct settings, and they shouldn't be "linked" (pun intended 😛) together like this:

Nov-14-2024 08-12-19

I think a button group, where only a single option is allowed, might be a better option here. Pinging @andreadelrio here to see if she has a better suggestion, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! I updated the UI in 1ac9d8d. I'm open to suggestions with any labels and naming thanks!!!

Copy link
Contributor

@Heenawter Heenawter Nov 14, 2024

Choose a reason for hiding this comment

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

If we keep the setting per-link, I think the "Overflow" setting should come first:

Current Suggested
image image

I also wonder if we could do something with an icon instead? This is just an idea, though - would definitely need @andreadelrio's opinion here 😆

Nov-14-2024 09-47-48

This ties in to #199844 (comment), since we shouldn't be putting this setting in the shared component - it should be just for links.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to using a button group.

Comment on lines 15 to 16
overflowTextWrap: boolean;
overflowEllipsis: boolean;
Copy link
Contributor

@Heenawter Heenawter Nov 14, 2024

Choose a reason for hiding this comment

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

I think this should be a setting for the entire links panel, not per-link. What do you think @rshen91?

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @andreadelrio here, too 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I personally like having this per link, for greater user flexibility, but will default to what you both think if you both like it for the entire links panel.

Copy link
Contributor

Choose a reason for hiding this comment

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

@andreadelrio can be our tie breaker, hahaha :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a setting for the entire links panel.

Copy link
Contributor

Choose a reason for hiding this comment

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

So the problem with making changes to this file is that this component is used for both drilldowns and links. You can see here that we now have an "Overflow" setting for dashboard drilldowns which.... doesn't really make sense :P

Screenshot 2024-11-14 at 8 53 36 AM

This setting is only relevant to links panels IMO.

@rshen91 rshen91 marked this pull request as draft November 18, 2024 16:32
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 18, 2024

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

History

cc @rshen91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Drilldowns Embeddable panel Drilldowns papercut Small "burr" in the product that we should fix. release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard][Links Panel] Add setting for text overflow cut off
6 participants