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

Made the KLogo component #460

Merged
merged 21 commits into from
Oct 23, 2023
Merged

Made the KLogo component #460

merged 21 commits into from
Oct 23, 2023

Conversation

ShivangRawat30
Copy link
Contributor

@ShivangRawat30 ShivangRawat30 commented Oct 1, 2023

Description

This PR Adds KLogo

Issue addressed

Addresses #373

Steps to test

  1. Navigate to http://localhost:4000/klogo

(optional) Implementation notes

At a high level, how did you implement this?

Does this introduce any tech-debt items?

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change has been added to the changelog

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

Comments

Signed-off-by: shivangrawat30 <[email protected]>
@nucleogenesis nucleogenesis added the TODO: needs review Waiting for review label Oct 1, 2023
Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

I'll leave approval to @thanksameeelian to be sure here, but I do question whether or not this should be a prop in this component or if we should instead make a separate KLogo or something which uses KImg without these changes rather than making the otherwise generic KImg component configurable for one particular special purpose by a prop.

lib/KImg.vue Outdated
@@ -14,6 +14,8 @@

<script>

import kolibriLogo from '../docs/common/DocsPageTemplate/SideNav/kolibri-logo.svg';
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we should be linking to an SVG in the docs directory here. Perhaps it'd be worth copy-pasting it directly into the same directory as this file?

Copy link
Member

Choose a reason for hiding this comment

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

Definitely would be good to copy it to KImg/KLogo directory

Copy link
Member

Choose a reason for hiding this comment

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

I doubt that someone re-organizing docs code and pages would get an idea to check whether it broke something in library. So good to have strict separation.

lib/KImg.vue Outdated
@@ -115,6 +124,9 @@
imgMinWidth() {
return this.validateAndFormatUnits(this.minWidth);
},
logo() {
Copy link
Member

Choose a reason for hiding this comment

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

Since the item being shown won't always be a "logo" maybe we can call this something like imgSrc

@MisRob
Copy link
Member

MisRob commented Oct 2, 2023

@nucleogenesis

but I do question whether or not this should be a prop in this component or if we should instead make a separate KLogo or something which uses KImg without these changes rather than making the otherwise generic KImg component configurable for one particular special purpose by a prop

It was just a light-hearted issue we made with @akolson to conclude his project in a little silly way utilizing our LE slogan "Kolibri Fly!" :) I admit I didn't put much technical thinking into it. This PR follows the specification exactly #373, so the fault is on me.

You're right that KLogo would make more sense. So, perhaps we could

  • If @ShivangRawat30 wants to refactor it, you're welcome, but please know we realize that the problem is the specification and not your work on it
  • If you can't to make these updates @ShivangRawat30, I would still vote for accepting the PR @nucleogenesis if it passes the review and then I would make sure to address this concern myself soon in a follow-up.

Would that be okay?

@ShivangRawat30
Copy link
Contributor Author

@MisRob I would appreciate the opportunity to improve it. Should I create a new file named Klogo.vue and create a separate tag for the logo image?

@MisRob
Copy link
Member

MisRob commented Oct 2, 2023

Great, @ShivangRawat30, thanks for being open. Yes, it'd be a new component named KLogo.vue. You can find some guidance on creating a new component in the dev docs (https://github.com/learningequality/kolibri-design-system/blob/release-v1.5.x/dev_docs/03_how_to_update_library.md#addupdate-a-component). Optionally, you could create a new simple documentation page for it if you'd like to give it a try https://github.com/learningequality/kolibri-design-system/blob/release-v1.5.x/dev_docs/04_how_to_update_docs.md#create-a-documentation-page-for-a-new-component but we can also open a follow-up issue. It's up to you.

@nucleogenesis Could you please provide some guidance to @ShivangRawat30 if he has some more questions?

@ShivangRawat30
Copy link
Contributor Author

@MisRob @nucleogenesis Should I create a new folder specifically for images to house the kolibrilogo.svg, or is it more appropriate to retain it within the lib folder?

@thanksameeelian
Copy link
Contributor

@MisRob @nucleogenesis Should I create a new folder specifically for images to house the kolibrilogo.svg, or is it more appropriate to retain it within the lib folder?

@ShivangRawat30 you can make your new KLogo component a directory that houses an index.vue and the svg file, like the file structure used in this example from Kolibri. this is mostly a question of preference about organization rather than about function, but it would be nice to uphold that same pattern 🙂

@ShivangRawat30
Copy link
Contributor Author

@nucleogenesis Please review the PR with the changes I've implemented.

@ShivangRawat30
Copy link
Contributor Author

Screenshot 2023-10-04 at 12 00 15 AM screenshot of the implemented change.

@MisRob MisRob changed the title Made the kolibriFly prop Made the KLogo component Oct 4, 2023
@MisRob
Copy link
Member

MisRob commented Oct 6, 2023

Wonderful @ShivangRawat30, and thanks for drafting the documentation page! I will leave the final review of this work on @thanksameeelian or @nucleogenesis. For now, only one high-level request - instead of <img>, could you use <KImg>? Then, we wouldn't need to have the same logic two times.

You can just pass KLogo props down to KImg, for example

<div>
  <KImg
    :height="height"
    :width="width"
    ...
  />
</div>

lib/KLogo/index.vue Outdated Show resolved Hide resolved
@MisRob
Copy link
Member

MisRob commented Oct 6, 2023

Also, @radinamatic, when displaying our logo https://raw.githubusercontent.com/learningequality/kolibri-design-system/ff15d1a2d8a3ae82c61de82ede74caf8177a1c9d/lib/KLogo/kolibri-logo.svg, does it need to have alternative text or should it be empty?

@radinamatic
Copy link
Member

@MisRob Yes, alternative text for the logo image would be required.

If the logo is used just as a flat image, the string Kolibri logo should suffice. If, however, the logo image is also a link, than the alternative text should give the context where the link is leading (for example Go to home page, or similar).

@MisRob
Copy link
Member

MisRob commented Oct 6, 2023

@radinamatic Thank you.

@ShivangRawat30 based on @radinamatic's comment, I'd then suggest different API for KLogo than for KImg in regards to alternative text:

  • no isDecorative prop (as logo will never be decorative)
  • altText prop will stay (with no default value though as we may need to translate it, and this won't happen in KDS) and it will be required prop

You will then just send KLogo's altText to KImges altText

Signed-off-by: shivangrawat30 <[email protected]>
@ShivangRawat30
Copy link
Contributor Author

@MisRob I've made the suggested changes, please review it.

@MisRob
Copy link
Member

MisRob commented Oct 12, 2023

Please note that release-v1.5.x branch was renamed to main

Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

Thank you, @ShivangRawat30, this is starting to look great.

I added one note related to removing the logic that's duplicate of KImg'es logic

lib/KLogo/index.vue Outdated Show resolved Hide resolved
@ShivangRawat30
Copy link
Contributor Author

@MisRob Done!!

Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

Almost there @ShivangRawat30. Left you one comment. In KLogo, there is no need for any duplicate of KImg logic. We only need to keep things specific particular to KLogo there (e.g. different alt text requirements)

lib/KLogo/index.vue Outdated Show resolved Hide resolved
Signed-off-by: shivangrawat30 <[email protected]>
Signed-off-by: shivangrawat30 <[email protected]>
Signed-off-by: shivangrawat30 <[email protected]>
Signed-off-by: shivangrawat30 <[email protected]>
Signed-off-by: shivangrawat30 <[email protected]>
@MisRob MisRob mentioned this pull request Oct 20, 2023
2 tasks
@MisRob MisRob self-requested a review October 20, 2023 12:37
Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

@ShivangRawat30 Thanks for all work here!

I pushed a commit to finalize the documentation page - finishing docs is something we don't require from contributors, so I organized it myself rather than writing review. It was primarily adjustments related to organization and conventions we use. Your draft was very helpful and saved us time, thank you.

On that opportunity I also pushed a small cleanup to KLogo itself, primarily using required instead of throwing a custom warning (it's a different situation from KImg's warning).

You're welcome to ask any questions and I can elaborate more if there's something you're interested in.

I will update changelog next week and merge.

@MisRob
Copy link
Member

MisRob commented Oct 20, 2023

@radinamatic I used some of your alt text notes for the usage section in the docs
Screenshot from 2023-10-20 15-31-30

<DocsPageSection title="Usage" anchor="#usage">
<h3>Alternative text</h3>

<p>Alternative text (<code>altText</code>) is always required for the logo image. When creating it, consider the following:</p>
Copy link
Member

@radinamatic radinamatic Oct 20, 2023

Choose a reason for hiding this comment

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

Looking good @MisRob, I'd just suggest to remove 'always', as in the wide world logos are not absolutely required to have alternative text. They can also be used for decorative purposes, but I'm unaware we are using ours that way anywhere in Kolibri. In our case just 'required' should suffice.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, will do before merging. Thank you

@ShivangRawat30
Copy link
Contributor Author

@MisRob I greatly appreciate your help related to the PR, and I'm eager to make further contributions to the codebase. Please consider assigning me more issues as I'm enthusiastic about resolving them.

@MisRob
Copy link
Member

MisRob commented Oct 23, 2023

You're welcome, @ShivangRawat30! We welcome contributions, and I think there are some free "help wanted" or "good first issue" issues here in this repository or in Kolibri or Studio. Let us know if you've found something suitable.

@MisRob MisRob merged commit 8a889bd into learningequality:main Oct 23, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants