Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Start DateInput#398

Merged
Ladsgroup merged 6 commits into
masterfrom
date_component
Apr 1, 2021
Merged

Start DateInput#398
Ladsgroup merged 6 commits into
masterfrom
date_component

Conversation

@Ladsgroup
Copy link
Copy Markdown
Contributor

@Ladsgroup Ladsgroup commented Mar 18, 2021

Bug: T273002

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@micgro42 micgro42 left a comment

Choose a reason for hiding this comment

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

looks good so far 👍

Comment thread vue-components/src/components/DateInput.vue
<b>{{ parsedValue }}</b>
</p>
<BouncingDots v-if="!parsedValue && value" type="small" />
<div class="wikit-DateInput--CalendarNotice" v-if="calendarNotice && parsedValue">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this class should be wikit-DateInput__CalendarNotice - it is an element, not a modifier, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'm terrible at BEM. Fixed now.

@Ladsgroup Ladsgroup marked this pull request as ready for review March 18, 2021 15:55
:label="label"
:value="value"
:error="error"
:feedback-type="feedbackType"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

InputWithExtender doesn't have a prop "feedback" type. The error prop is good enough

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh nice. Thanks. done now.

Copy link
Copy Markdown
Collaborator

@micgro42 micgro42 left a comment

Choose a reason for hiding this comment

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

Solid job! just one little detail to fix and it can have my approval 👍

@sai-san
Copy link
Copy Markdown
Contributor

sai-san commented Mar 19, 2021

This is really great! 💯

There's a Reference error that prevents the Basic story from being displayed in Chromatic. Adding some comments here after checking the components in the All story:

  • For some reason, the IntroText style is not being applied to the default prompt in Chrome & Safari on MacOs (the style looks good in Firefox/Linux, though):

Screenshot 2021-03-19 at 12 59 12

  • The variants in the All page should have some more vertical space between them (see the All story of the ExtendedNumberInput for reference). I believe that the spacing is achieved by containing the variants in paragraphs (which is probably also not ideal).

  • In the design specification, it was indicated that text elements inside the Extender menu should be contained in 24px high "bounding boxes" (aka divs) verticall-spaced by 4px. Checking the current implementation, I'm not sure if that's applied or even if it's necessary, but definitely the vertical spacing between elements should be increased, to probably 8px (dimension.spacing.small.value). I wasn't sure where to suggest the change

@sai-san
Copy link
Copy Markdown
Contributor

sai-san commented Mar 30, 2021

Charlie made a good point regarding the default active state of the DateInput component that made me think the interaction flow could be improved in the following way:

Current: Once the user focuses on the DateInput, the extender menu opens to display the prompt text.
Desired: Once the user focuses on the DateInput, instead of just the prompt, users also see the resultsIntroText. In the following way:

Screenshot 2021-03-30 at 10 39 48

This removes a step from the flow and concentrates all interaction in a single menu, that now displays the different states (pre-input, during input, and result).

Since the component is still in the last stages of development, I thought we still are on time to make this improvement 🙏

@Ladsgroup
Copy link
Copy Markdown
Contributor Author

This is really great! 100

There's a Reference error that prevents the Basic story from being displayed in Chromatic. Adding some comments here after checking the components in the All story:

* For some reason, the IntroText style is not being applied to the default prompt in Chrome & Safari on MacOs (the style looks good in Firefox/Linux, though):

Screenshot 2021-03-19 at 12 59 12

* The variants in the All page should have some more vertical space between them (see the All story of the ExtendedNumberInput for reference). I believe that the spacing is achieved by containing the variants in paragraphs (which is probably also not ideal).

Added <br> in between.

* In the design specification, it was indicated that text elements inside the Extender menu should be contained in 24px high "bounding boxes" (aka divs) verticall-spaced by 4px. Checking the current implementation, I'm not sure if that's applied or even if it's necessary, but definitely the vertical spacing between elements should be increased, to probably 8px (dimension.spacing.small.value). I wasn't sure where to suggest the change

Isn't it $wikit-InputExtender-padding-vertical?

@sai-san
Copy link
Copy Markdown
Contributor

sai-san commented Mar 30, 2021

Thanks for all the changes and fixes, @Ladsgroup!

  • For some reason, the IntroText style is not being applied to the default prompt in Chrome & Safari on MacOs (the style looks good in Firefox/Linux, though):

This error still persists: the text-styles applied to the prompt are ignored in MacOS (checked Safari, Firefox and Chrome)

Isn't it $wikit-InputExtender-padding-vertical?

Yes, that token is defining the internal padding of the menu, but the elements inside are unaffected. Maybe we should define their spacing separately, like in the options menu? I can update the tokens file (#400)

Comment thread vue-components/src/components/DateInput.vue Outdated
Comment thread vue-components/src/components/DateInput.vue Outdated
<slot v-if="!value" name="prompt" />
<BouncingDots v-if="!parsedValue && value" type="small" />
<div class="wikit-DateInput__CalendarNotice" v-if="calendarNotice && parsedValue">
<Icon type="info" size="small" />
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.

can we apply color="subtle" to the icon or make it inherit the color of the text it accompanies? Any of the options are fine

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't have "subtle" color type. The ones are 'base', 'warning', 'error', 'notice', 'success', 'inherit'. I change it to inherit.

Copy link
Copy Markdown
Contributor

@sai-san sai-san Mar 31, 2021

Choose a reason for hiding this comment

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

thanks! inherit makes sense. I'm opening a small PR to add those missing colors to the icon component (I was convinced they were there, but maybe mixed up colors and sizes), but no further change is needed here.

Comment thread vue-components/src/components/DateInput.vue
Comment thread vue-components/src/components/DateInput.vue
@wmde wmde deleted a comment from Ladsgroup Mar 30, 2021
@sai-san
Copy link
Copy Markdown
Contributor

sai-san commented Mar 30, 2021

yay! looks so good! I would approve right away if it weren't (again) for that missing style:

Screenshot 2021-03-30 at 17 58 14

Is there anything we can try there? Should we create a class for that text element too? The style literally matches that of the input placeholder.

<p class="wikit-DateInput__ParsedValue" v-if="parsedValue">
<b>{{ parsedValue }}</b>
</p>
<slot v-if="!value" name="prompt" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not blocking this PR: But since we now show the intro text always, do we want the prompt to actually still be a slot? That is where the application can inject whatever markup it wants. Or would we not prefer for this now to be a text-only prop? @SaiSan-WMDE

Though, this is not blocking the merge and can still be adjusted later on.

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.

@Ladsgroup and I just discussed this and originally agreed to keep the slot. But you're right, this is some static text that will always be displayed, so using a text-only prop like in the other cases makes more sense and is more consistent?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You tell me 🙃
This really depends on what you envision might be inserted there by the application.
If it is only ever going to be plain text that is always supposed to be styled the same way, then a prop makes more sense.
On the other hand, if you want to keep the possibility open that the application might want to provide some copy that includes a "learn more" link, then we should keep the slot.

If you two discussed this and decided that to keep the slot, then I'm confident that this is the right decision and am very happy to approve this as soon as we have the note in the CHANGELOG.md :)

Copy link
Copy Markdown
Contributor

@sai-san sai-san Apr 1, 2021

Choose a reason for hiding this comment

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

I believe this should be a text prop for now, since I cannot foresee any use cases that justify the use of a slot at the moment. A slot could be introduced later if that changed.

Last change and we should be done with this component!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Implemented as requested.

@micgro42
Copy link
Copy Markdown
Collaborator

micgro42 commented Apr 1, 2021

This still needs a line in the CHANGELOG.md, I think :)

Ladsgroup and others added 2 commits April 1, 2021 16:56
Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de>
@sai-san sai-san self-requested a review April 1, 2021 15:13
Copy link
Copy Markdown
Contributor

@sai-san sai-san left a comment

Choose a reason for hiding this comment

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

Just gorgeous. Thanks, Michael and Amir! 💯

giphy (4)

@Ladsgroup Ladsgroup merged commit 42bd210 into master Apr 1, 2021
@Ladsgroup Ladsgroup deleted the date_component branch April 1, 2021 19:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants