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

fix: [M3-7002] Topbar Search fixes #9534

Merged
merged 7 commits into from
Aug 14, 2023

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Aug 11, 2023

Description 📝

This PR addresses a few issues with the top search bar and the search landing page. Some (the circular dependency for instance) seem to be newer degradations while the others may have never been addressed or prioritized.

The task involves improvements to the basic search (not the dropdown search results who remained untouched).

Notably, the improvements made to the UX are related to the state of the search field value while interacting with the search field and navigating the application.

Please see the self review for details about the fixes

Before After
Screenshot 2023-08-11 at 23 09 45 Screenshot 2023-08-11 at 23 10 04

How to test 🧪

  1. Pull code locally and test the search bar with various search terms, making sure to either click the first "View search results page for {term}" or click enter after typing the search term

@abailly-akamai abailly-akamai self-assigned this Aug 11, 2023
@@ -13,6 +13,7 @@ export const SelectPlaceholder = (props: Props) => {
data-qa-multi-select={
props.isMulti ? props.selectProps.placeholder : false
}
className="select-placeholder"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improvement: in order to target the placeholder opacity on active search (on focus).

@@ -34,9 +35,11 @@ export const Tag = (props: TagProps) => {
// If maxLength is set, truncate display to that length.
const _label = maxLength ? truncateEnd(label, maxLength) : label;

const tagProps = omit(props, ['asSuggestion', 'closeMenu']);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to prevent forwarding two props responsible for console errors

@@ -20,6 +20,9 @@ const useStyles = makeStyles((theme: Theme) => ({
width: '100%',
},
labelCell: {
'& a': {
display: 'inline-block',
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Styling the search row label link so it's not 100% with in the table cell. One should click on the title as expected to access the entity. this fix can help preventing clicking on en entity unexpectedly.

paddingBottom: 2,
paddingTop: 2,
},
paddingBottom: '2px !important',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding a tiny bit of room to the table cell while reducing the description for a better feel when having a lot of search results especially.

@@ -231,7 +231,7 @@ export const SearchLanding: React.FC<CombinedProps> = (props) => {
_privateImages,
regions,
nodebalancers,
searchableLinodes,
linodes,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was creating the circular dep. linodes is preferable to be used as dependency here.

'& .select-placeholder': {
opacity: 0.5,
},
},
Copy link
Contributor Author

@abailly-akamai abailly-akamai Aug 11, 2023

Choose a reason for hiding this comment

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

trying to improve slightly the experience by reducing the opacity of the placeholder on focus - this placeholder is a bit different having more contrast and it feels a bit like a value so I think this makes it more obvious since there's more contrast with the cursor when focusing on the field now

Before After
Screenshot 2023-08-11 at 23 11 16 Screenshot 2023-08-11 at 23 11 34

setValue({ label: q, value: q });
}
}, [history.location]);

Copy link
Contributor Author

@abailly-akamai abailly-akamai Aug 11, 2023

Choose a reason for hiding this comment

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

Fixing the search field value not being reset after a successful search and navigating away from the search results page

Screenshot 2023-08-11 at 23 14 28

@@ -333,6 +345,7 @@ export const SearchBar = (props: CombinedProps) => {
openMenuOnFocus={false}
options={finalOptions}
styles={selectStyles}
value={value}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Controlling to the field to be able to display and clear the value as needed

overflow: 'visible',
},
fontSize: '0.875rem',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

matching placeholder & field value font sizes, which was a bit odd when starting typing

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Aug 14, 2023
@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Aug 14, 2023
@bnussman-akamai bnussman-akamai merged commit a567d02 into linode:develop Aug 14, 2023
corya-akamai pushed a commit to corya-akamai/manager that referenced this pull request Sep 6, 2023
* fix: [M3-7002] fix circular dep

* fix: [M3-7002] focus behavior

* fix: [M3-7002] styling improvements

* fix: [M3-7002] styling improvements 2

* fix: [M3-7002] cleanup

* fix: [M3-7002] moar cleanup

* Added changeset: Issues with circular dependency and blur bhaviors on main search field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants