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

feat(cxl-ui): refactor light-card #346

Closed
wants to merge 1 commit into from

Conversation

HenerHoop
Copy link

@HenerHoop HenerHoop commented Oct 18, 2023

@github-actions
Copy link

github-actions bot commented Oct 18, 2023

size-limit report 📦

Path Size
packages/cxl-ui/pkg/dist-web/cxl-ui.js 64.68 KB (+1.64% 🔺)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js 11.87 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js 27.69 KB (+0.09% 🔺)
packages/cxl-ui/pkg/dist-web/vendor.js 135.58 KB (0%)
packages/cxl-ui/pkg/dist-web/cxl-ui-jwplayer.js, packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js, packages/cxl-ui/pkg/dist-web/cxl-ui.js, packages/cxl-ui/pkg/dist-web/manifest.js, packages/cxl-ui/pkg/dist-web/unresolved.js, packages/cxl-ui/pkg/dist-web/vendor.js 240.97 KB (+0.45% 🔺)

@HenerHoop HenerHoop force-pushed the hener/feat/refactor-light-card branch 3 times, most recently from d3d0e55 to 6330383 Compare October 23, 2023 09:20
@HenerHoop HenerHoop marked this pull request as ready for review October 23, 2023 09:38
@HenerHoop HenerHoop force-pushed the hener/feat/refactor-light-card branch from 6330383 to fa4439d Compare October 23, 2023 13:20
@HenerHoop HenerHoop force-pushed the hener/feat/refactor-light-card branch from fa4439d to c41ac7d Compare October 26, 2023 07:17
Copy link

@pawelkmpt pawelkmpt left a comment

Choose a reason for hiding this comment

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

Bottom right corner of an image should not leak out from the card.

Screenshot 2023-10-26 at 10 24 23

packages/cxl-ui/scss/cxl-light-card.scss Outdated Show resolved Hide resolved
packages/cxl-ui/scss/cxl-light-card.scss Outdated Show resolved Hide resolved
packages/cxl-ui/scss/cxl-light-card.scss Outdated Show resolved Hide resolved
packages/cxl-ui/scss/cxl-light-card.scss Outdated Show resolved Hide resolved
packages/cxl-ui/scss/cxl-light-card.scss Outdated Show resolved Hide resolved

@property({ type: Boolean, reflect: true }) new = false;

@property({ type: Boolean, reflect: true }) portrait = false;

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 defined by theme. @freudFlintstone @anoblet WDYT?

Choose a reason for hiding this comment

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

It's only used in CSS, so yes, theme would be more consistent with the rest of the components. It is better to have a property only if the component needs to conditionally, and maybe dynamically, render parts of the template depending on that property.


@property({ type: Boolean, reflect: true }) completed = false;

@property({ type: String, attribute: 'link' }) link = '';

Choose a reason for hiding this comment

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

Is it named link in other cards not url?

Comment on lines +92 to +96
_renderTime() {
if ( this.time ) {
return html`
<cxl-time time=${this.time} ?show-icon=${this.showTimeIcon}></cxl-time>
`;

Choose a reason for hiding this comment

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

As far as I see we don't have time anywhere in the design. @heshfekry can you confirm?

Choose a reason for hiding this comment

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

There are no component states with time in the figma file, or in the dashboard, apparently.
https://www.figma.com/file/RTj2PtUSrCOUFtljOiq0W3/CXL-2.0?type=design&node-id=2728-497829&mode=dev

packages/cxl-ui/src/components/cxl-light-card.js Outdated Show resolved Hide resolved
packages/cxl-ui/src/components/cxl-light-card.js Outdated Show resolved Hide resolved
@HenerHoop HenerHoop force-pushed the hener/feat/refactor-light-card branch from c41ac7d to 6345e18 Compare October 26, 2023 09:17
@HenerHoop HenerHoop force-pushed the hener/feat/refactor-light-card branch from 6345e18 to bbebec0 Compare October 26, 2023 09:19

@customElement('cxl-light-card')
export class CXLLightCardElement extends CXLBaseCardElement {
export class CXLLightCardElement extends LitElement {

Choose a reason for hiding this comment

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

We reverted course on this change in the last call with hesh, remember? We decided to edit the current cxl-light-card, which extends CXLBaseCardElement, instead of doing it from scratch. It looks like you copied a lot of code from other files. That's usually a sign we are going in the wrong direction.

Choose a reason for hiding this comment

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

@HenerHoop you missed this, and now it looks like you copied a lot of what base-card already handles. This is becoming way too complicated for a component that doesn't even have logic. We got lost here.

Copy link

@freudFlintstone freudFlintstone Oct 27, 2023

Choose a reason for hiding this comment

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

I'm sorry, @HenerHoop, looks like I forgot to submit the old review. I take responsibility for that. But you did do exactly the opposite of what was agreed in a call with Hesh, so that's still a problem. We need this to go forward, and it looks to be working well now, so let's push it over the line and add a backlog task to fix it later.


@property({ type: Boolean, reflect: true }) new = false;

@property({ type: Boolean, reflect: true }) portrait = false;

Choose a reason for hiding this comment

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

It's only used in CSS, so yes, theme would be more consistent with the rest of the components. It is better to have a property only if the component needs to conditionally, and maybe dynamically, render parts of the template depending on that property.

Comment on lines +92 to +96
_renderTime() {
if ( this.time ) {
return html`
<cxl-time time=${this.time} ?show-icon=${this.showTimeIcon}></cxl-time>
`;

Choose a reason for hiding this comment

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

There are no component states with time in the figma file, or in the dashboard, apparently.
https://www.figma.com/file/RTj2PtUSrCOUFtljOiq0W3/CXL-2.0?type=design&node-id=2728-497829&mode=dev

@pawelkmpt
Copy link

Closing in favor of #353

@pawelkmpt pawelkmpt closed this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants