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 clear button to search bar #328

Merged
merged 16 commits into from
Jun 2, 2023

Conversation

techwithanirudh
Copy link
Contributor

This commit introduces a clear button to the SearchBar component using the X icon from Lucide-React. When the user enters a query in the input field, the clear button appears allowing them to easily remove the search term. The clear button is hidden when there is no search term entered.

This commit introduces a clear button to the SearchBar component using the X icon from Lucide-React. When the user enters a query in the input field, the clear button appears allowing them to easily remove the search term. The clear button is hidden when there is no search term entered.
Changed SearchBar's input field to add padding on the left side and an absolute positioned search icon. Also, added absolute positioned X icon on the right side when there is an input value, ensuring a better user experience.
@ClaraLeigh
Copy link
Collaborator

ClaraLeigh commented May 19, 2023

Hey, I love the enthusiasm but I'm not sure this feature will help our end User Experience, as it currently stands

  1. This will create content shake, when the content is empty it will not have an icon, where as soon as you start typing the ux will change. In industry this is generally frowned upon these days and it is better to just make something look inactive.
  2. On mobile you'd loose space in the chat window, which makes me wonder if we should have this feature to begin with. I know chatgpt doesn't have it and I'm sure someones pitched the idea there
  3. Was there some other accidental style changes here? I noticed there was color changes and rounding stuff I'm not sure has been requested
  4. Have you tested this feature? if so, maybe some screenshots would go well in the PR

This commit makes changes to the SearchBar React component to render the Clear Search X icon only when the input field has a value. A showClearIcon state using useState hook is added and updated every time the input value changes. The useEffect hook is used to handle the case when the user clears the input value. This allows better UX by providing clear intent to the user that the icon is clickable and will clear the search query.
This commit modifies the NavLinks component to improve user experience by removing a rounded styling to the "Clear conversations" and "Export conversations" buttons. Prior to this change, the buttons had a rounded styling.
…lity.

Changed submit button styling for better accessibility and readability, including adjustments to padding and hover effects. The new styles ensure that the button is easily clickable for all users, while also improving its visual appearance.
Copy link
Collaborator

@ClaraLeigh ClaraLeigh left a comment

Choose a reason for hiding this comment

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

Also I saw you posted the screenshot in discord. Might be good to pop it in here too so others can see the visual change. Before I saw that screenshot I actually thought we were talking about a different area

client/src/components/Nav/NavLinks.jsx Show resolved Hide resolved
client/src/components/Nav/SearchBar.jsx Show resolved Hide resolved
client/src/components/Nav/NavLinks.jsx Show resolved Hide resolved
client/src/components/Input/SubmitButton.jsx Show resolved Hide resolved
Copy link
Collaborator

@ClaraLeigh ClaraLeigh left a comment

Choose a reason for hiding this comment

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

Lgtm. Assuming the rounded-none css is needed but @danny-avila would know for sure as you mention its a bug from their css changes. Same with the extra submit button padding

Changed the background color and hover effect of the conversation link in Conversation component to make it more visually appealing. The previous background color was '#2A2B32' and now it's 'gray-800'. The 'px-4' class has also been changed to 'hover:pr-4' for better readability.
@danny-avila danny-avila merged commit dade7b4 into danny-avila:main Jun 2, 2023
cnkang pushed a commit to cnkang/LibreChat that referenced this pull request Feb 6, 2024
* feat: Add clear button to search bar

This commit introduces a clear button to the SearchBar component using the X icon from Lucide-React. When the user enters a query in the input field, the clear button appears allowing them to easily remove the search term. The clear button is hidden when there is no search term entered.

* Refactor SearchBar component to improve user experience

Changed SearchBar's input field to add padding on the left side and an absolute positioned search icon. Also, added absolute positioned X icon on the right side when there is an input value, ensuring a better user experience.

* Refactor SearchBar component to show Clear Search icon dynamically

This commit makes changes to the SearchBar React component to render the Clear Search X icon only when the input field has a value. A showClearIcon state using useState hook is added and updated every time the input value changes. The useEffect hook is used to handle the case when the user clears the input value. This allows better UX by providing clear intent to the user that the icon is clickable and will clear the search query.

* Improve UX: Add styling to clear button & export button

This commit modifies the NavLinks component to improve user experience by removing a rounded styling to the "Clear conversations" and "Export conversations" buttons. Prior to this change, the buttons had a rounded styling.

* Refactor submit button styling for improved accessibility and readability.

Changed submit button styling for better accessibility and readability, including adjustments to padding and hover effects. The new styles ensure that the button is easily clickable for all users, while also improving its visual appearance.

* hotfix

* Improve UI styling in Conversation component

Changed the background color and hover effect of the conversation link in Conversation component to make it more visually appealing. The previous background color was '#2A2B32' and now it's 'gray-800'. The 'px-4' class has also been changed to 'hover:pr-4' for better readability.

---------

Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.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

4 participants