-
Notifications
You must be signed in to change notification settings - Fork 83
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
New component: Initial implementation of KCard
component
#625
New component: Initial implementation of KCard
component
#625
Conversation
I've added a few cards to the playground for @radinamatic to perform QA testing. Once everything is approved by the QA team, we'll remove the cards before merging the code. |
Regarding the responsiveness, I don't know if it's because of Netlify view of the playground (🙃) but I'm wondering if it's how it's supposed to look and behave...? Or maybe we can only properly test this once the cards are in the grid? 🤔 Untitled.Project.mp4 |
The last question I had was regarding the other interactive elements inside the card (button/icon to open other options, etc.): that is not in the scope of this PR and is supposed to come in subsequent ones, correct? |
I think it's something we tried and tested here learningequality/studio#4480 |
I think that's how it should behave for now.
The Grid will control it's behavior further . I will defer to @MisRob for more thoughts and guidance on this. |
I don't recall having tested that, is it live somewhere for me to take a look? |
Not- it's not yet live for testing as dev is still on going. |
Thank you @radinamatic and @AllanOXDi. Regarding responsiveness - that's something that a grid will control, so yes, it is to be implemented and tested later on. Regarding buttons in the footer area - |
All good then, will wait for the refactor of semantic |
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.
Hi @AllanOXDi! I am glad that our KCard is already taking shape 🎉. I noticed a few things, especially in the documentation, and in the KCard code structure. Let me know any thoughts of any of the comments 👐.
lib/KCard/index.vue
Outdated
<!-- @slot Places content to be placed above the title.. --> | ||
<slot name="aboveTitle"></slot> | ||
<!-- @slot for the title content --> | ||
<slot name="title"></slot> |
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 think this title slot is an alternative to the title prop. So I think we will probably want to make this part of the BaseCard component perhaps?
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.
That would not be a good idea. I think BasCard
is to enforce consistent structure and accessibility for cards across our product and Isolates basic accessibility requirements from potential changes in the KCard
component,
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.
BaseCard
is meant to have the validation "Contains validation to check that title prop or slot has been used, throwing an error if neither is provided" (see acceptance criteria here #529) so I think the slot will need to be present in the BaseCard
. It will add some clarity as well. This is part of the enforcement that BaseCard
does - it needs to ensure that title is provided, and that can happen either via the prop or the slot.
@AllanOXDi you too have made a good point and regarding that, we need to ensure that BaseCard
shouldn't have any styles or layout logic related to how the title appears.
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.
Wonderful work overall @AllanOXDi, and it's great that a11y QA passes, that was the most tricky thing!
I am posting some first feedback. I haven’t reviewed yet everything - will follow up gradually.
docs/assets/vertical-layout.png
Outdated
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.
[required] I believe this is unused file that can be removed
[required]
I see the title text not being rendered as heading: Could you adjust the behavior to follow the expected behavior in all of the following cases? Note that in one of them it works well already, but not for all - including all for clarity. There's also an additional issue in the screenshots below regarding the placement of the
|
[required] One important area to address here is to check the resulting UI against the "Updated Cards Specs Metadata" designs and make sure that all the logic and styles that
These are just a few places I noticed, and is not meant to be a full list. Could you please take some time to test all available layouts and compare with designs? Placement, font sizes, padding/margins, and pretty much anything we can do to follow designs closely. Figma will provide you with all information and useful measurement tools, such as Note that letterboxing should be preserved though even though it's not showed on the designs. The image on the designs corresponds to the whole thumbnail area (possibly letterboxed) in the final implementation. |
@AllanOXDi There are some acceptance criteria from the issues this PR is meant to close that appear not yet be implemented or have unclear status. Could you please read through all related issues, particularly "Markup/style requirements" and the "Acceptance criteria" sections and resolve them or mention where things are if there are any blockers? Some examples: "Supports RTL", "Even though the whole area is clickable, text content is still selectable", "[documentation] contains guidance on the headingLevel to notify developers that they need to choose a correct level based on context", and perhaps few more. I know it's lots of work, but there's time to finish it and would suggest we do so in this PR since it's not draft like the first Studio PR. I think it will be easier than opening many follow ups since there's no pressure around merging. This will prepare robust ground for further work and help with implementing card grids as well. If you needed to chat around how to organize work or encountered some blocking issues, we'll have time to chat :) |
257caa1
to
2c6281d
Compare
…yles Relatedly - Removes 'aside' element (in some layouts it doesn't correspond to its meaning) - Removes 'titleLines' prop since this is (and needs to be) controlled by layout - Removes /deep/ selectors in favor of using 'headingStyles' prop (the implementation dependet on nested selectors with /deep/ in the middle, however it only seemed to work by chance when missing scss language config. For <style scoped lang="scss"> it caused the page compilation break.
2c6281d
to
11b16e9
Compare
6addb69
to
edc6495
Compare
Hi @AllanOXDi, I finished the final review. Overall it feels much more robust now, layouts look great, and I really appreciate you took time to prepare cards preview similar to the cards we will implement in Kolibri. I am sure this will make all further work in products smooth. Thank you for all your hard work :) As we chatted earlier, it'd be great to have this merged before you're back online and open follow-ups if there's some more work. I will open a few, but for some changes, it's a bit easier for me to push them right away rather than explaining in new issues, and I also hope it will help with other work we have in progress in Kolibri and Studio that you can return to when you are back. I hope you don't mind - it's done with the intention of support, and hope it aligns well with all we talked about together. I'm trying my best to describe reasons for changes in the commit messages, and will be available to talk about each of them. The main areas updated I considered important (cc @AlexVelezLl for review): User-facing:
Other:
(You will also see some documentation and renaming mixed in my commits and that's just me nitpicking and doing little improvements when I see an opportunity as I'm in the code already, nothing really important, and in majority of cases, I wouldn't be posting to review :) After I am done, I will ask @AlexVelezLl to review my updates, and then we will merge. Thanks both and talk to you soon. |
Would you please give the components one last look, @AlexVelezLl? Please also see the playground page that simulates more use-cases now. I will delete it before merging, but keep a copy somewhere for testing (this will be perfect first task for automated visual tests :) Also please note that the following will be resolved in follow-ups (some already open, and I will open later remaining ones). If there's any feedback from you that's not resolved and not blocking, please mention.
|
I took a look at the latest version of the playground and tested with NVDA in Windows. One thing popped up as a concern, but again I'm not sure if it's determined by this base card implementation, or will it be further injected by other products. Namely, the color contrast of the channel name (is that in the Similarly, even though I understand what was mentioned earlier, that:
I just wanted to reiterate 🙂 , that we need to pay attention to offer full and comprehensive information about those element in the footer. For example, this is the full readout of one of the cards by NVDA:
All above looks Ok, just 2 comments regarding the last line:
I know this might not be in the scope of the present PR, but it cannot hurt to repeat it 😉 |
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.
This LGTM! Code looks good and well documented, documentation looks very informative and easy to follow, and visual examples in the playground looks great! I think is ready to go! Just left a super minor comments about docs.
Thank you @AllanOXDi for all your consistent hard and great work here!! and @MisRob for your great guidance! Will leave the final merge to @MisRob once playground is cleaned and QA passes.
// If the time difference is greater than or equal to 200 milliseconds, | ||
// it means that the mouse button was pressed and held for a longer time, | ||
// which is not typically interpreted as a click event. Do not navigate | ||
// in such case. |
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 see value in adding that this allows us select text for example.
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.
Ah yes, it was couple of lines above - will make sense to have it here together. Updated, thank you.
data-test="aboveTitle" | ||
class="above-title" | ||
> | ||
<slot name="aboveTitle"></slot> |
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 think we should document these slots as well.
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.
Ah yes, thank you. Done
!important was needed in times when 'thumbnail' was applied directly to KImg but this was later changed and is now applied to its wrapping div so it's not needed anymore.
Thank you @radinamatic, I appreciate it. Yes, these are all the things that consuming apps need to ensure as they will inject it. I'd like us to have some guidance into the documentation to clarify for developers what we need to take care of when implementing cards on top of this component vs what is it already taking care of. Also, as soon as we have first few Kolibri card components implemented and a11y tested, we could use the way they look for the documentation examples to reflect this all a bit better. |
^ We will keep working on this all gradually as part of the project, this component is a core step, and also a beginning of larger body of work in a sense. |
Thanks for feedback @AlexVelezLl! Merging now. |
Description
This PR introduces the KCard component to KDS, It will act a foundational building block for creating various card types within our product eco system. By serving as a base component for creating different card types like lesson cards, resource cards, and channel cards.
Issue addressed
#530
#528
#529
Changelog
KCard
component #625]KCard
componentSteps to test
I suggest looking at these issues
#530
#528
#529
(optional) Implementation notes
At a high level, how did you implement this?
Does this introduce any tech-debt items?
Testing checklist
Reviewer guidance
After review
CHANGELOG.md
Comments