Skip to content

feat(ui): Change assignee selector to use DropdownAutocomplete - #8941

Merged
billyvg merged 14 commits into
masterfrom
feat/ui/new-assignee-selector
Aug 21, 2018
Merged

billyvg merged 14 commits into
masterfrom
feat/ui/new-assignee-selector

Conversation

@billyvg

@billyvg billyvg commented Jul 5, 2018 •

Copy link
Copy Markdown
Member

This also allows for keyboard navigation of the assignee selector.

Old:
image

New:
image

Uses the same component as e.g.:
image

@billyvg
billyvg force-pushed the feat/ui/new-assignee-selector branch 2 times, most recently from e8a3633 to c211a29 Compare August 2, 2018 23:40
)
{menuHeader && <LabelWithPadding>{menuHeader}</LabelWithPadding>}

<StyledItemList maxHeight={maxHeight}>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This makes sure that the Input, Header, and Footer are not scrolled away.

// sensible default.
const StyledBaseAvatar = styled('span')`
flex-shrink: 0;
background-color: ${p => p.theme.whiteDark};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is so that there is a "placeholder" that's light grayish while we load an image avatar.

let alignRight = alignMenu === 'right';

return css`
top: 32px;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is C&P'ed from existing component :o

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

holy moly that's a lot of stuff lol. maybe we can just transform one of our carat svgs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🙃

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's revisit this if we end up using this caret elsewhere

@billyvg billyvg changed the title feat(ui): Change assignee selector to use DropdownAutocomplete [WIP] feat(ui): Change assignee selector to use DropdownAutocomplete Aug 2, 2018
@billyvg
billyvg requested review from Chrissy and lynnagara August 2, 2018 23:49
@billyvg

billyvg commented Aug 2, 2018

Copy link
Copy Markdown
Member Author

@ckj thoughts on the design changes here? (mostly height + dividers)

@ckj

ckj commented Aug 2, 2018

Copy link
Copy Markdown
Member

@billyvg love it. looks better than before

@billyvg
billyvg force-pushed the feat/ui/new-assignee-selector branch from f0d7ab0 to 1a609b4 Compare August 13, 2018 20:22

@Chrissy Chrissy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks really good! I made a handful of idealistic suggestions but for the most part this awesome.


/* stylelint-disable-next-line no-duplicate-selectors */
${StyledMenu} {
right: -14px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This centers the menu under the dropdown caret, open to suggestions

margin: 0;
const IconUser = styled(props => (
<div {...props}>
<span className="icon-user" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sigh one step at a time i suppose

border-bottom: 1px solid rgba(52, 60, 69, 0.06);
`;

const InviteMemberLink = styled(Link)`

This comment was marked as resolved.


const StyledChevron = styled(InlineSvg)`
margin-left: ${space(1)};
font-size: 12px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

better to use width or height here as opposed to font size.

/**
* Max height of dropdown menu
*/
maxHeight: PropTypes.number,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉🎉🎉

* This is when we want to blend the bottom border of the actor button with the dropdown menu
* so that it looks a bit more seamless.
*/
zIndex: PropTypes.number,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

couldn't this just be done at the parent level like:

const StyledDropdownAutocomplete = styled(DropdownAutocomplete)`
  z-index: 9999999
`;

/**
* Padding value for search input (requires the `padding` shortcut value)
*/
searchPadding: PropTypes.string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these two props worry me. Can you explain why we need them? IMO if it just looks weird or too different we should:

A. Make it look better / moar the same everywhere
B. Pass a styled child component
C. Figure out some kind of semantically named state to pass in that controls the way it looks.

Ideally we can avoid passing around individual css lines as props because it enables nearly infinite component states and makes maintenance really challenging.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree. Option A would be ideal but I think it's a bit too idealistic. Option B makes it difficult to re-use the good set of default components we have (and makes it a bit too easy to break design consistency). I think individual css rules as a prop is a good balance between full CSS control (e.g. searchStyle) and customizability.

I do like option C though, maybe *Size?

let alignRight = alignMenu === 'right';

return css`
top: 32px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

holy moly that's a lot of stuff lol. maybe we can just transform one of our carat svgs?

)}
{!loading && (
<DropdownAutoComplete
maxHeight={400}

This comment was marked as resolved.

This comment was marked as resolved.

@billyvg billyvg added the Do Not Merge Don't merge label Aug 14, 2018
@billyvg

billyvg commented Aug 14, 2018

Copy link
Copy Markdown
Member Author

Thanks @Chrissy, added "Do not merge" until I have a chance to go through feedback.

@billyvg
billyvg force-pushed the feat/ui/new-assignee-selector branch 2 times, most recently from 545b371 to 7546892 Compare August 20, 2018 17:51
@billyvg billyvg removed the Do Not Merge Don't merge label Aug 20, 2018
@billyvg
billyvg force-pushed the feat/ui/new-assignee-selector branch from dda2222 to 5c9a920 Compare August 20, 2018 20:34
@billyvg
billyvg merged commit 686b31a into master Aug 21, 2018
@billyvg
billyvg deleted the feat/ui/new-assignee-selector branch August 21, 2018 17:26
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants