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

Bug 1804285: Fix for overlapping labels in topology nodes #4354

Merged

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-3035

Analysis / Root cause:
The change was made to be 20 characters when we added the name of the resource to the edit action in the context menu so they would be consistent. 20 characters is what the rest of the Console UI uses and we wanted consistency.

Solution Description:
Change both the nodes and the context menu to truncate at 16 characters.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

cc @openshift/team-devconsole-ux @Veethika @serenamarie125

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 18, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1804285, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1804285: Fix for overlapping labels in topology nodes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 18, 2020
@@ -18,7 +18,7 @@ const LEFT_MARGIN = 20;
const TEXT_MARGIN = 10;

const truncateOptions: TruncateOptions = {
length: 35,
length: 20,
Copy link
Member Author

Choose a reason for hiding this comment

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

Noticed that in some cases the name of groups would overlap the group boundaries as well. Changes the truncation length to be the standard 20 characters.

@christianvogt
Copy link
Contributor

There are changes in the truncation that still causes the labels to be large:

image

Truncation not occurring until a certain threshold is hit:
image
image

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 18, 2020
@jeff-phillips-18
Copy link
Member Author

@christianvogt Updated:

image

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 19, 2020
@jeff-phillips-18
Copy link
Member Author

/cherrypick release-4.4

@openshift-cherrypick-robot

@jeff-phillips-18: once the present PR merges, I will cherry-pick it on top of release-4.4 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jeff-phillips-18
Copy link
Member Author

/test analyze

@andrewballantyne
Copy link
Contributor

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 19, 2020
@@ -115,10 +108,34 @@ class LayoutNode {
this.yy = undefined;
}

@computed
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this needs to be a @computed value because bounds is constantly changing during layout.
Did you do this for performance and find that a memoized value was beneficial?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I just assumed that with cloning the performance would be better if we set @computed.

Comment on lines 113 to 119
return (
this.node
.getBounds()
.clone()
.padding(this.node.getStyle<GroupStyle>().padding).width +
this.distance * 2
);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should avoid cloning if there is no padding.

@@ -112,6 +112,13 @@ export default class Rect implements Translatable {
return this;
}

//
// Padding Format: [all], [horizontal, vertical], [left, vertical, right], [left, top, right, bottom]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what I was thinking when I did this.
Let's update to follow the CSS shorthand notation.

[all], [vertical, horizontal], [top, horizontal, bottom], [top, right, bottom, left]

Comment on lines 62 to 65
const b = c
.getBounds()
.clone()
.padding(c.getStyle<GroupStyle>().padding);
Copy link
Contributor

Choose a reason for hiding this comment

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

Best to avoid cloning as much as possible especially if there is no padding.

this.node
.getBounds()
.clone()
.padding(this.node.getStyle<GroupStyle>().padding).height +
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename the type from GroupStyle to NodeStyle

@spadgett
Copy link
Member

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@spadgett: This pull request references Bugzilla bug 1804285, which is valid.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jeff-phillips-18 jeff-phillips-18 force-pushed the group-labels branch 2 times, most recently from 3768bd8 to 5ddd453 Compare February 20, 2020 16:35
@jeff-phillips-18
Copy link
Member Author

/retest

1 similar comment
@jeff-phillips-18
Copy link
Member Author

/retest

Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

lgtm

@jeff-phillips-18
Copy link
Member Author

/retest

1 similar comment
@jeff-phillips-18
Copy link
Member Author

/retest

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, jeff-phillips-18, serenamarie125

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2020
@openshift-merge-robot openshift-merge-robot merged commit 6b268ae into openshift:master Feb 25, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: All pull requests linked via external trackers have merged. Bugzilla bug 1804285 has been moved to the MODIFIED state.

In response to this:

Bug 1804285: Fix for overlapping labels in topology nodes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@jeff-phillips-18: new pull request created: #4451

In response to this:

/cherrypick release-4.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.5 milestone Feb 28, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the group-labels branch December 2, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants