FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

improvement(CatalogTile): Removed truncation fade and fixed length by rebeccaalpert · Pull Request #3378 · patternfly/patternfly-react · GitHub

improvement(CatalogTile): Removed truncation fade and fixed length - #3378

Merged
dlabaj merged 13 commits into
patternfly:masterfrom
rebeccaalpert:catalogtile-openshift-updates
Jan 14, 2020
Merged

improvement(CatalogTile): Removed truncation fade and fixed length#3378
dlabaj merged 13 commits into
patternfly:masterfrom
rebeccaalpert:catalogtile-openshift-updates

Conversation

Copy link
Copy Markdown
Member

Removed truncation fade per OpenShift request and added CSS/SCSS to deal with the description length (limit to 3 lines maximum).

jcaianirh previously approved these changes Dec 5, 2019

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-3378.surge.sh

jcaianirh previously approved these changes Dec 5, 2019

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

jeff-phillips-18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I disagree with the 3 line strategy. It won't be suitable for all applications and will leave tiles truncated with trailing empty vertical space. Better than what is there now, but only because it currently leaves an abundance of empty space.

Are we against using a height measurer as was done at https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTile/CatalogTile.js#L29 ?

@@ -1,3 +1,10 @@
@mixin co-line-clamp($lines: 3) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

co?

codecov-io commented Dec 5, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #3378 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3378      +/-   ##
==========================================
- Coverage    67.1%   67.09%   -0.01%     
==========================================
  Files         903      903              
  Lines       25483    25482       -1     
  Branches     2254     2257       +3     
==========================================
- Hits        17100    17097       -3     
- Misses       7342     7343       +1     
- Partials     1041     1042       +1
Flag Coverage Δ
#misc 95.45% <ø> (ø) ⬆️
#patternfly3 69.29% <ø> (ø) ⬆️
#patternfly4 64.19% <100%> (-0.02%) ⬇️
Impacted Files Coverage Δ
...tension/src/components/CatalogTile/CatalogTile.tsx 90.19% <100%> (-4.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4574ad2...f9f40e3. Read the comment docs.

Copy link
Copy Markdown
Member Author

So the reason we have so much empty vertical space in OpenShift right now is to accommodate the absolute longest tile. This new change will keep everything a more consistent length so we don't need as much space (we will potentially need some vertical space given that titles and providers vary so much in length -- that's something we could potentially do this with as well if Sam is game for it).

Copy link
Copy Markdown
Member

This is patternfly-react, not specific to Console, right?

Copy link
Copy Markdown
Member Author

Yes, this is PatternFly-React rather than a console-specific change. We've been using OpenShift as a staging area to see how this component behaves with more variable data.

<CardBody className="catalog-tile-pf-body">
<div className="catalog-tile-pf-description">
<span className={classNames({'truncated': isTruncated})}>
<span className={classNames('co-line-clamp', {'truncated': isTruncated})}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If we are auto-truncating via the co-line-clamp then we should not be truncating the string at all and no need for the truncated class.

We should remove the truncation properties (and update the text in the example tiles)

Copy link
Copy Markdown
Member Author

The original catalog tiles had a truncation function and allowed you to pass one in. Removing it would be a breaking change; is that what you want to do?

I worked with Joe on a refs-based solution. We have to do more complicated stuff here since it's not a fixed width and height container, but it seems to work. I know you're on vacation, but let us know your thoughts when you get back.

jcaianirh previously approved these changes Dec 19, 2019

jcaianirh left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm after updating the examples

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

some console statements still in code fyi (in case you didn't realize)

Copy link
Copy Markdown
Member Author

Thanks Joe.

jcaianirh previously approved these changes Jan 2, 2020

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

jeff-phillips-18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, a few suggestions which would be nice to get in.

jeff-phillips-18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

/** Modifies the card to include compact styling */
isCompact?: boolean;
/** Callback for card ref */
innerRef?: React.Ref<any>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should not be on the exported type, only on the inner component.

}

export const Card: React.FunctionComponent<CardProps> = ({
export const Card0: React.FunctionComponent<CardProps> = ({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should not be exported.

);
};

// eslint-disable-next-line react/no-multi-comp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't believe this is necessary.

Copy link
Copy Markdown
Member

I still maintain that a hard coded line truncation is a bad idea.

Copy link
Copy Markdown
Member Author

Hey - I wound up speaking to Dana about this yesterday because I was noticing some performance issues with the refs on the PF4 developer site. He and Michael Coker suggested we use a CSS solution, so I'm in the process of rolling back to the original approach. Coker thought line clamp was a decent approach for this.

Serena just pointed out the issue we've been trying to fix with this PR to a larger audience and Joe and I would like to fast-track this fix so we can get it in under the wire into this upcoming version of OpenShift.

Copy link
Copy Markdown
Member

Why is this less performant than it was in the previous version?

Copy link
Copy Markdown
Member Author

In addition to the issues with the line height that we discussed over Slack, there seemed to be an issue where we were intermittently receiving the incorrect clientHeight. It happened intermittently on refresh on the dev site. I asked Dana about it and we tried running a production build to see if it was an issue with the dev site. However, on the production build, you would see a delay, where there was an incorrect clientHeight and then the correct values seemed to kick in, resizing the content. This is not acceptable behavior for OpenShift.

dlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do all items in the catalog have icons? If you don't have one it looks strange since the header is so large.

Copy link
Copy Markdown
Member Author

They mostly have text badges. We're going to shrink them down in OpenShift to widths and heights that make sense for those layouts.

Copy link
Copy Markdown
Member Author

Rebased.

dlabaj previously approved these changes Jan 13, 2020
jcaianirh previously approved these changes Jan 13, 2020

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

rebeccaalpert dismissed stale reviews from jcaianirh and dlabaj via f9f40e3 January 13, 2020 21:37

jcaianirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm thanks for updating the snapshots

dlabaj merged commit d6e9156 into patternfly:master Jan 14, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL