feat: Assign colors to events#15298
Conversation
|
@anikdhabal is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add community label" took an action on this PR • (06/03/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (06/03/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (08/11/24)1 reviewer was added to this PR based on Keith Williams's automation. |
|
This PR is being marked as stale due to inactivity. |
There was a problem hiding this comment.
Amazing work so far @anikdhabal ! Found a small issue that should be fixed. Can you also fix the merge conflicts.
You select a specific colour for event type and save the event type. Now you toggle the colour settings off and on again, but don't save the event type. The colour reverts to its default value, becoming inconsistent with current state of event type. Ideally it should still be the colour previously saved as we did not make any changes to it. Attached a video for better understanding.
Recording.2024-06-28.230706.mp4
|
This PR is being marked as stale due to inactivity. |
Hey @Udit-takkar , why do we need to create a different color picker component with limited colors when we already have one? I think the current picker provides more color options. Additionally, creating a new component would make the code larger, and the use case for that color component is only for the event type color picker. Lmk what you think |
We can't allow any colour to be selected as we have to make sure it doesn't fail the WCAG Contrast guidelines https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable/Color_contrast. Just confirm with @ciaranha once about the design and let me know |
Sure @Udit-takkar , and for WCAG contrast guidelines, we can add a check and display a message. I think in our code, we check the contrast for both dark and light modes in some components |
Ciaran confirmed that we can use the color picker that we should have |
There was a problem hiding this comment.

Translation not loading

I was able to set this colour and didnt get an error
Created a replit for easier testing of this fn manually.
We may honestly need a light/dark mode colour selector if we're not going for a preset color pallets like in the designs.
|
Hey @sean-brydon, the problem is that the way we handle the contrastCheck function is not optimal. The function is guaranteed to return a boolean, but we unnecessarily use it inside a try-catch block in every instance. After changes:- And yes, it would be optimal to add a light and dark mode color selector. |
sean-brydon
left a comment
There was a problem hiding this comment.
Nice one! Thanks for making them changes - much better behaviour now
|
Fixed the conflicts |
sean-brydon
left a comment
There was a problem hiding this comment.
Tested again - this is a neat feature!
E2E results are ready! |



What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist