refactor: remove light/dark props from Card #41

Merged
klaipras merged 7 commits from remove-light-dark-props into ui_change 2026-10-17 22:36:14 +00:00
Member

Description

The props for card currently contain the "lightColor" and "darkColorProp" which is then used to determine the color of the component. The client calls in the different value depending on whether the card is selected or not. In the components itself, the value are also parsed into selected or not again. We could easily just used selected: boolean as prop instead of putting different prop; this still behave the same.

I understand that future feature might be able to make use of the colorprop but this is what works better at the moment

Closes #40

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Test coverage
  • Documentation

Testing

  • I added/updated tests.
  • I tested my changes locally.
    • I tested my changes with a laptop-size screen.
    • I tested my changes with a phone-size screen.
    • I tested my changes with a tablet-size screen.
  • I tested on the dev app (dev.cmustudy.com)

Screenshots/Recordings

Checklist

  • My code follows the project's existing style.
  • I have reviewed my changes.
  • Only the necessary files and lines have been changed.
  • This PR is ready for review.
## Description The props for card currently contain the "lightColor" and "darkColorProp" which is then used to determine the color of the component. The client calls in the different value depending on whether the card is selected or not. In the components itself, the value are also parsed into selected or not again. We could easily just used selected: boolean as prop instead of putting different prop; this still behave the same. I understand that future feature might be able to make use of the colorprop but this is what works better at the moment ## Related Issue Closes #40 ## Type of change - [ ] Bug fix - [ ] New feature - [x] Refactor / code improvement - [ ] Test coverage - [ ] Documentation ## Testing - [ ] I added/updated tests. - [x] I tested my changes locally. - [ ] I tested my changes with a laptop-size screen. - [ ] I tested my changes with a phone-size screen. - [ ] I tested my changes with a tablet-size screen. - [ ] I tested on the dev app (dev.cmustudy.com) ## Screenshots/Recordings ## Checklist - [x] My code follows the project's existing style. - [x] I have reviewed my changes. - [x] Only the necessary files and lines have been changed. - [x] This PR is ready for review.
refactor: remove light/dark props from Card
Some checks failed
kennel/build skipped: no services or static sites defined
Deploy to Railway Dev / Deploy to Dev (push) Has been cancelled
Test / Unit and integration tests (push) Has been cancelled
Test / Unit and integration tests (pull_request) Has been cancelled
0c51c42992
All current calls is just "selected" as bool,
can be readded if more color choice are needed
refactor: remove the groupColor constants
Some checks failed
kennel/build skipped: no services or static sites defined
Deploy to Railway Dev / Deploy to Dev (push) Has been cancelled
Test / Unit and integration tests (push) Has been cancelled
Test / Unit and integration tests (pull_request) Has been cancelled
eea657e0fe
Unused now due to previous change
annadavi force-pushed remove-light-dark-props from eea657e0fe
Some checks failed
kennel/build skipped: no services or static sites defined
Deploy to Railway Dev / Deploy to Dev (push) Has been cancelled
Test / Unit and integration tests (push) Has been cancelled
Test / Unit and integration tests (pull_request) Has been cancelled
to fb9880c18c
All checks were successful
kennel/build skipped: no services or static sites defined
Test / Unit tests (push) Successful in 1m22s
Test / Integration tests (push) Successful in 4m28s
Test / Deploy to Production (push) Has been skipped
Test / Deploy to Dev (push) Successful in 1m31s
2026-09-28 03:03:01 +00:00
Compare
Member

I just added a PR template to the repo. In the future, it will automatically populate new PRs. Since this PR was made before the template existed, please just edit the description, copy the following template into it, and fill in the template:

## Description



## Related Issue


Closes #

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor / code improvement
- [ ] Test coverage
- [ ] Documentation

## Testing

- [ ] I added/updated tests.
- [ ] I tested my changes locally.
    - [ ] I tested my changes with a laptop-size screen.
    - [ ] I tested my changes with a phone-size screen.
    - [ ] I tested my changes with a tablet-size screen.
- [ ] I tested on the dev app (dev.cmustudy.com)

## Screenshots/Recordings



## Checklist

- [ ] My code follows the project's existing style.
- [ ] I have reviewed my changes.
- [ ] Only the necessary files and lines have been changed.
- [ ] This PR is ready for review.
I just added a PR template to the repo. In the future, it will automatically populate new PRs. Since this PR was made before the template existed, please just edit the description, copy the following template into it, and fill in the template: <pre> ## Description <!-- Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR. No AI slop. --> ## Related Issue <!-- Link the issue this PR addresses, if applicable. --> Closes # ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Test coverage - [ ] Documentation ## Testing - [ ] I added/updated tests. - [ ] I tested my changes locally. - [ ] I tested my changes with a laptop-size screen. - [ ] I tested my changes with a phone-size screen. - [ ] I tested my changes with a tablet-size screen. - [ ] I tested on the dev app (dev.cmustudy.com) ## Screenshots/Recordings <!-- If this includes a UI change, attach screenshots on both laptop and mobile. --> ## Checklist - [ ] My code follows the project's existing style. - [ ] I have reviewed my changes. - [ ] Only the necessary files and lines have been changed. - [ ] This PR is ready for review. </pre>
refactor: remove light/dark props from Card
Some checks failed
kennel/build skipped: no services or static sites defined
Deploy to Railway Dev / Deploy to Dev (push) Has been cancelled
Test / Unit and integration tests (push) Has been cancelled
Test / Unit and integration tests (pull_request) Has been cancelled
0c51c42992
All current calls is just "selected" as bool,
can be readded if more color choice are needed
refactor: remove the groupColor constants
Some checks failed
kennel/build skipped: no services or static sites defined
Deploy to Railway Dev / Deploy to Dev (push) Has been cancelled
Test / Unit and integration tests (push) Has been cancelled
Test / Unit and integration tests (pull_request) Has been cancelled
eea657e0fe
Unused now due to previous change
Merge branch 'remove-light-dark-props' of ssh://git.cmu.dev/ScottyLabs/study into remove-light-dark-props
All checks were successful
kennel/build skipped: no services or static sites defined
Test / Unit tests (push) Successful in 1m25s
Test / Integration tests (push) Successful in 1m34s
Test / Deploy to Production (push) Has been skipped
Test / Deploy to Dev (push) Successful in 1m43s
5aa08fa481
Member

Can you link the issue in the description and add an explanation to the description of what you did and why, so we can understand the reason behind the changes/why you solved the issue this way?

Can you link the issue in the description and add an explanation to the description of what you did and why, so we can understand the reason behind the changes/why you solved the issue this way?
Author
Member

@annadavi I have explained more in the desc and like the issue.

@annadavi I have explained more in the desc and like the issue.
Member

Can you also add UI tests that verify the colors in light/dark mode and selected/not, just to build up the tests as we implement?

Can you also add UI tests that verify the colors in light/dark mode and selected/not, just to build up the tests as we implement?
Author
Member

I'm not sure how to implement a test for this kind of component

I'm not sure how to implement a test for this kind of component
Member

Take a look at the existing tests (and maybe tests added on other open PRs) and do some research on UI testing with Vitest, which is what we use for our tests. Basically, just add tests to confirm it looks as you expect (colors are correct for light/dark mode and selected vs not, so just 4 cases). This is mostly just to give you practice writing tests for your PRs, even if it seems a little silly on a small change like this!

Take a look at the existing tests (and maybe tests added on other open PRs) and do some research on UI testing with Vitest, which is what we use for our tests. Basically, just add tests to confirm it looks as you expect (colors are correct for light/dark mode and selected vs not, so just 4 cases). This is mostly just to give you practice writing tests for your PRs, even if it seems a little silly on a small change like this!
feat: add test for card class
All checks were successful
kennel/build skipped: no services or static sites defined
Test / Unit tests (push) Successful in 1m50s
Test / Integration tests (push) Successful in 5m17s
Test / Deploy to Production (push) Has been skipped
Test / Deploy to Dev (push) Successful in 2m33s
688889ac9a
Merge branch 'ui_change' of ssh://git.cmu.dev/ScottyLabs/study into remove-light-dark-props
All checks were successful
kennel/build skipped: no services or static sites defined
Test / Unit tests (push) Successful in 1m31s
Test / Integration tests (push) Successful in 4m58s
Test / Deploy to Production (push) Has been skipped
Test / Deploy to Dev (push) Successful in 2m19s
3b21ca7b0e
Author
Member

@annadavi I have added the test to check for cards props. It check for the class.

@annadavi I have added the test to check for cards props. It check for the class.
klaipras merged commit 0af978b24f into ui_change 2026-10-17 22:36:14 +00:00
klaipras deleted branch remove-light-dark-props 2026-10-17 22:36:15 +00:00
Sign in to join this conversation.
No description provided.