-
Notifications
You must be signed in to change notification settings - Fork 20
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(cc-input-date): init component #845
Conversation
5e95fc1
to
c85d21d
Compare
🔎 A preview has been automatically published : https://clever-components-preview.cellar-c2.services.clever-cloud.com/cc-input-date/init/index.html. This preview will be deleted once this PR is closed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is impressive!
Huge gg for all the tests you have set up, really great work!
As always, the code is well documented, thanks a lot for this.
A few notes in addition to the few comments I've left:
-
I think the experience with keyboard as it is 👍.
-
Since we're dealing with an input that will always be used for dates, the stories should reflect the a11y requirements that come with it: the label must always specify the format: "The label (YYYY-MM-DD HH:MM:SS)" => it is a long format, and it will be even a longer label with required. We may use the "help text" for that info exceptionally but it's really not a good practice (and I should open an issue to change where the help text is displayed + make place the required text closer to its input). Actually we could use the help text to specify that we also accept ISO?
-
I'm not sure I understand the custom width story, was it to warn devs about the fact that the component should have a minimum size?
-
The simulation story seems to be missing a label and a value.
-
TODO test with screen readers (I didn't have the time right now but I'll come back once I've tested)
Again big gg to you!
Ah yes, I need to come back to the |
Accessibility testsScreen readers
One issue I found is that the underlayer value does not seem to be up-to-date with the input value. Since screen readers access the underlayer text, it reads We should add an I think we should try to warn blind users that they can use up / down arrows once the date is valid.
KeyboardAs said before, I think the user experience with keyboard is good. I tried to make it even better by selecting the part of the date being edited to highlight it and make left / right arrow keys go to the previous / next part of the date to edit. A demo is available here: To test it:
This is a POC so contrasts of selected text is not great + I've only tested the Is it a good idea? I'm not sure, this is more a "What do you think?" test 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll admit I did not expect this component to be this tricky. 🧠
The implementation is impressive, GG. Especially the test suite.
As the for the global architecture, regarding the fact that quite a lot of code is involved, I have the feeling there may or may not be some room for improvements: I'll leave that for more experienced devs. 👀
8c184da
to
dabc494
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What an impressive work, GG! 💪
dabc494
to
840cb80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive work @pdesoyres-cc 👏
Praise and kudos 👍
- The keyboard navigation is super slick
- The underline is subtle but I like it
- I had something different in mind but this is better
- The quantity and quality of the unit tests is impressive, well done!
- The introduction of the e2e tests and the mouse/keyboard helpers is so nice!!
Concerns 🤔
Nothing really blocking, mostly suggestions, so we can discuss the details if you don't agree with me 😉
- The
cc-input-date
has a lot of indirections and a few features I'm not sure we need right now which makes it hard to review (and maybe to maintain) - The date parser and formatter use a lot of classes and I think most of them can be replaced by functions and moved to the
date-utils.js
file.
EDIT: now that I see what you did with the DateDisplayer, some of my suggestions here aren't that simple. We'll discuss this together 😉
a8cd826
to
40c978b
Compare
🔎 The preview has been automatically deleted. |
Fixes #842