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

Update KDS theme token #12742

Merged

Conversation

AllanOXDi
Copy link
Member

@AllanOXDi AllanOXDi commented Oct 24, 2024

Summary

References

Closes #12735.

Reviewer guidance


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Oct 24, 2024
@AlexVelezLl AlexVelezLl self-requested a review October 24, 2024 17:32
Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

Hey @AllanOXDi! For this change we need to update the KDS version from 4.4.0 (the current version installed in release-v0.17.x) to 4.6.0 which is the version that introduces the theme token updates. Between these versions there are two breaking changes that we will need to solve:

  • In 4.5.0: There is a breaking change that was the removal of the internal state of KCheckbox, to handle this breaking change we need to backport this commit that handled this breaking change in develop, but is not present yet in release-v0.17.x
  • In 4.6.0: Here we introduced the theme token updates, you can see linked the whole mapping, I see that we still need to update some more theme tokens in this pr (e.g. the grey palette).

As we havent updated the KDS version yet, we can see some regressions like this:

Before After
image image

@@ -59,7 +59,7 @@
v-if="attemptLog.missing_resource"
class="coach-content-label"
icon="warning"
:color="$themePalette.yellow.v_1100"
:color="$themePalette.yellow.v_500"
Copy link
Member

Choose a reason for hiding this comment

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

Just a note: v_1100 values map to v_600, so we will need to fix the current changes that changed v_1100 to v_500

@marcellamaki
Copy link
Member

Thanks @AlexVelezLl for the helpful notes on the KDS upgrade requirements to make those required changes clearer in terms of what needs to be added to make sure the KDS version works.

@AllanOXDi I also wanted to add, in regards to this point in the acceptance criteria

any places that use the theme token numerical values in kolibri (so, anything that aligns with the updates spec in learningequality/kolibri-design-system#775) should be updated to use the correct value. So, themeTokens.primary does not need to be updated anywhere. But, if there is a place where themeTokens.v_1000 is used, that needs to be updated to themeTokens.v_500. Note: I have not proactively evaluated how many places will need to be updated. It may be a handful, it may be a lot!

"But, if there is a place where themeTokens.v_1000 is used, that needs to be updated to themeTokens.v_500" was just one example to illustrate that any situations where the numerical values is used does need to be updated, vs. themeTokens.primary which does not. This will have to be updated for all of the numbers. I didn't write this in a clear way. The mapping that Alex linked above and in that linked issue in the acceptance criteria shows all of the values that have been updated. The current state of v0.17.x is in the image on the color with the hex code, and the new number that we need to replace it with is what is in the red. For the "Brand" colors 200 becomes 100, 400 becomes 200, etc. If you have more questions about how to interpret the spec, please let me know!

nucleogenesis and others added 2 commits October 25, 2024 18:30
…kbox

KCheckbox no longer maintains its own internal state, rather, it is just
like a fancy button which emits an event that it's been clicked and the
parent component must react and update the value it passes to `checked`
or `indeterminate` accordingly.

These tests rely on KCheckbox to emit its internal state whenever it
emits `change` and that no longer is the case given KCheckbox doesn't
keep an internal state.

I've tweaked some of the conditionals in UserTable that relied on that
emitted `checked` value so that they instead get the same information
from existing available values.
@github-actions github-actions bot added DEV: renderers HTML5 apps, videos, exercises, etc. APP: User Re: User app (sign-in, sign-up, user profile, etc.) labels Oct 25, 2024
Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Thanks for the work on this @AllanOXDi! Overall it looks good - I appreciate the detail-oriented work in you last updates. There are few small places where the tokens were missed or there is some other mis-match, which I've noted for reference, and I'll be opening a follow up PR momentarily so we can get those resolved and into the beta today.

Files with remaining theme tokens:

  • PermissionsIcon.vue
  • ProgressBar.vue
  • HeaderTab.vue
  • ToggleHeaderTabs.vue

@@ -115,8 +115,8 @@
},
linkStyle() {
const hoverBg = this.isFullscreen
? this.$themeBrand.secondary.v_1100
: this.$themePalette.grey.v_600;
? this.$themeBrand.secondary.v_300
Copy link
Member

Choose a reason for hiding this comment

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

I think here, because you previous had updated some of the code from v_1100 to v_600, you have now converted "twice", and there are a few places where you've changed v_1100 to v_300. First, from v_1100 to v_600 (correct) and then when you went through with the additional updates, you changed the already updated v_600 to v_300.

I'll mark the places where this "double" remapping has happened

@@ -63,7 +63,7 @@
return {
color: this.$themeTokens.text,
':hover': {
'background-color': this.$themeBrand.secondary.v_1100,
'background-color': this.$themeBrand.secondary.v_300,
Copy link
Member

Choose a reason for hiding this comment

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

here

@@ -341,10 +341,10 @@
cancelStyleOverrides() {
return {
color: this.$themeTokens.textInverted,
'background-color': this.$themePalette.red.v_1100,
'background-color': this.$themePalette.red.v_300,
Copy link
Member

Choose a reason for hiding this comment

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

here

@@ -10,7 +10,7 @@
<KIcon
icon="warning"
class="icon"
:color="$themePalette.yellow.v_1100"
:color="$themePalette.yellow.v_600"
Copy link
Member

Choose a reason for hiding this comment

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

The token on line 6 should also be updated

@marcellamaki marcellamaki merged commit 826a1f1 into learningequality:release-v0.17.x Oct 25, 2024
34 checks passed
This was referenced Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: frontend DEV: renderers HTML5 apps, videos, exercises, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants