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

feat: Add a Color Selector Control #30 #574

Merged
merged 18 commits into from
Aug 13, 2023
Merged

feat: Add a Color Selector Control #30 #574

merged 18 commits into from
Aug 13, 2023

Conversation

MichaelThomas0721
Copy link
Contributor

@MichaelThomas0721 MichaelThomas0721 commented Aug 4, 2023

Description

This PR adds a color selector control. This control allows users to use the color input type to select a color as a string (hex format). This grants users the ability to quickly choose/change colors on the fly without needing to have pre selected them. Personally I was looking for a way to quickly test out new colors and previously I was using a separate website's color selector to pick a color and then copy pasting the hex code into a string control. This makes that process a lot more streamlined and reactive.
#573 #30

Additional context

I am new to VUE and was struggling with the best way to update the state, when I was just using the emit function that I saw in other controls, it was super slow, probably because it was doing it so much. I ended up implemented a throttle function so it will only shoot every 15ms which fixed it. If there is a better way then let me know. I tried to follow the guidelines as best as possible, let me know if anything needs to be changed :)

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • [] Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Aug 4, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@codesandbox
Copy link

codesandbox bot commented Aug 4, 2023

This branch is running in CodeSandbox. Use the links below to review this PR faster.


CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview

@netlify
Copy link

netlify bot commented Aug 4, 2023

Deploy Preview for histoire-examples-svelte3 failed.

Name Link
🔨 Latest commit 2f738a7
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/64d918b6141e520009a04c5b

@netlify
Copy link

netlify bot commented Aug 4, 2023

Deploy Preview for histoire-controls ready!

Name Link
🔨 Latest commit 2f738a7
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/64d918b692c3f800088a5912
😎 Deploy Preview https://deploy-preview-574--histoire-controls.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Aug 4, 2023

Deploy Preview for histoire-site ready!

Name Link
🔨 Latest commit 2f738a7
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/64d918b6c8ec04000854519e
😎 Deploy Preview https://deploy-preview-574--histoire-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Aug 4, 2023

Deploy Preview for histoire-examples-vue3 ready!

Name Link
🔨 Latest commit 2f738a7
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/64d918b6ab6c48000706bfea
😎 Deploy Preview https://deploy-preview-574--histoire-examples-vue3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MichaelThomas0721 MichaelThomas0721 changed the title Add a Color Selector Control feat: Add a Color Selector Control #573 Aug 4, 2023
@MichaelThomas0721 MichaelThomas0721 changed the title feat: Add a Color Selector Control #573 feat: Add a Color Selector Control #30 Aug 4, 2023
@MichaelThomas0721
Copy link
Contributor Author

I've never used cypress before so I could be wrong but it seems that since the color selector control also uses a text input it is returning two when looking for the HstText, I will fix this shortly and add a test case for the color selector control as well.

@MichaelThomas0721
Copy link
Contributor Author

I had to change the way that cypress gets the text control since the color selector control also uses a text input. Instead of grabbing the ones that contain input[type="text"] (which isn't recommended under cypress best practices), it grabs it by .contains("HstText"). I did the same with the new color select test. This fixed the HstText test.

I also updated the amount of stories in it to 30 from 29 since I didn't account for the new Color Select Control :)

@Akryum Akryum merged commit 91f226e into histoire-dev:main Aug 13, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants