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: Added searchValue and onSearchValueChange props on SearchSelect #944

Conversation

perryraskin
Copy link
Contributor

Description

Related issue(s)

What kind of change does this PR introduce? (check at least one)

  • Bug fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • New Feature (BREAKING CHANGE which adds functionality)
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

How has this been tested?

Utilized JSONPlaceholder API to simulate an API request upon entering a search query. Normally an API would accept filters which would only return the filtered list of items, but I didn't have a mock API to use for the Story example.

Screenshots (if appropriate):

The PR fulfils these requirements:

  • It's submitted to the main branch
  • When resolving a specific issue, it's referenced in the related issue section above
  • My change requires a change to the documentation. (Managed by Tremor Team)
  • I have added tests to cover my changes
  • Check the "Allow edits from maintainers" option while creating your PR.
  • Add refs #XXX or fixes #XXX to the related issue section if your PR refers to or fixes an issue.
  • By contributing to Tremor, you confirm that you have read and agreed to Tremor's CONTRIBUTING.md guideline. You also agree that your contributions will be licensed under the Apache License 2.0 license.

Copy link

vercel bot commented Feb 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tremor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2024 7:51am

@CodiumAI-Agent
Copy link

CodiumAI-Agent commented Feb 1, 2024

PR Analysis

(review updated until commit 6a06bb5)

  • 🎯 Main theme: This PR introduces two new props, searchValue and onSearchValueChange, to the SearchSelect component. This allows the component to handle server-side rendering scenarios where the search query needs to be exposed and controlled externally.
  • 📝 PR summary: The PR adds searchValue and onSearchValueChange props to the SearchSelect component, allowing for better control of the search query. This is particularly useful for server-side rendering scenarios. The PR also includes a new story example demonstrating this feature.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 3, because the PR introduces a new feature and modifies several parts of the code. However, the changes are straightforward and the code is well-structured, making it relatively easy to understand.
  • 🔒 Security concerns: No security concerns found

PR Feedback

💡 General suggestions: The PR is well-structured and the changes are clear. However, it would be beneficial to add tests for the new feature to ensure its functionality and prevent potential regressions in the future. Additionally, it would be good to handle potential errors in the API request in the story example.

🤖 Code feedback:
relevant filesrc/components/input-elements/SearchSelect/SearchSelect.tsx
suggestion      

Consider adding a default value for searchValue prop to avoid potential issues with undefined values. [medium]

relevant linesearchValue?: string;

relevant filesrc/stories/input-elements/helpers/SimpleSearchSelect.tsx
suggestion      

It would be good to handle potential errors in the API request to prevent application crashes and improve user experience. [important]

relevant line.catch((error) => console.error("Error fetching user data:", error));


✨ Usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:

/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...

With a configuration file, use the following template:

[pr_reviewer]
some_config1=...
some_config2=...
Utilizing extra instructions

The review tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.

Examples for extra instructions:

[pr_reviewer] # /review #
extra_instructions="""
In the code feedback section, emphasize the following:
- Does the code logic cover relevant edge cases?
- Is the code logic clear and easy to understand?
- Is the code logic efficient?
...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

How to enable\disable automation
  • When you first install PR-Agent app, the default mode for the review tool is:
pr_commands = ["/review", ...]

meaning the review tool will run automatically on every PR, with the default configuration.
Edit this field to enable/disable the tool, or to change the used configurations

About the 'Code feedback' section

The review tool provides several type of feedbacks, one of them is code suggestions.
If you are interested only in the code suggestions, it is recommended to use the improve feature instead, since it dedicated only to code suggestions, and usually gives better results.
Use the review tool if you want to get a more comprehensive feedback, which includes code suggestions as well.

Auto-labels

The review tool can auto-generate two specific types of labels for a PR:

  • a possible security issue label, that detects possible security issues (enable_review_labels_security flag)
  • a Review effort [1-5]: x label, where x is the estimated effort to review the PR (enable_review_labels_effort flag)
Extra sub-tools

The review tool provides a collection of possible feedbacks about a PR.
It is recommended to review the possible options, and choose the ones relevant for your use case.
Some of the feature that are disabled by default are quite useful, and should be considered for enabling. For example:
require_score_review, require_soc2_review, enable_review_labels_effort, and more.

More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the review usage page for a comprehensive guide on using this tool.

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit 6a06bb5

@severinlandolt severinlandolt changed the base branch from main to beta-search-select February 3, 2024 07:44
@severinlandolt severinlandolt merged commit f945686 into tremorlabs:beta-search-select Feb 3, 2024
5 checks passed
Copy link

github-actions bot commented Feb 3, 2024

🎉 This PR is included in version 3.14.0-beta-search-select.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

severinlandolt added a commit that referenced this pull request Feb 9, 2024
…#944) (#958)

* Adds searchValue and onSearchValueChange props

---------

Co-authored-by: Perry Raskin <perryraskin@gmail.com>
severinlandolt added a commit that referenced this pull request Feb 9, 2024
* fix: add shrink-0

* fix: remove double shadow date range picker (#953)

* add icon flex story

* fix: badge dark mode

* fix: BadgeDelta dark mode, Table

* feat: Add scale props to sparkcharts (#950)

* add autominValue, minValue, maxValue to spark charts

* feat: Add onValueChange props to BarList (#948)

* add onvaluechange prop

* fix: add generic data barlist (#957) (#960)

* add onvaluechange prop

* fix lint

* add generic data

* fix lint

---------

Co-authored-by: mbauchet <90607026+mbauchet@users.noreply.github.com>
Co-authored-by: Maxime BAUCHET <maxime.bauchet@insystem.fr>

* chore: update readme

* update readme

* update logo dark mode

* feat: Added searchValue and onSearchValueChange props on SearchSelect (#944) (#958)

* Adds searchValue and onSearchValueChange props

---------

Co-authored-by: Perry Raskin <perryraskin@gmail.com>

* fix: trigger release

---------

Co-authored-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: mbauchet <90607026+mbauchet@users.noreply.github.com>
Co-authored-by: Maxime BAUCHET <maxime.bauchet@insystem.fr>
Co-authored-by: Perry Raskin <perryraskin@gmail.com>
severinlandolt added a commit that referenced this pull request Feb 11, 2024
…ta and for barlist, new props for SearchSelect, new readme (#963)

* fix: remove double shadow date range picker (#953)

* fix: BadgeDelta dark mode, Table

* feat: Add scale props to sparkcharts (#950)

* feat: Add onValueChange props to BarList (#948)

* fix: add generic data barlist (#957) (#960)

* chore: update readme

* feat: Added searchValue and onSearchValueChange props on SearchSelect (#944) (#958)

Co-authored-by: Perry Raskin <perryraskin@gmail.com>
Co-authored-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: mbauchet <90607026+mbauchet@users.noreply.github.com>
Co-authored-by: Perry Raskin <perryraskin@gmail.com>
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

3 participants