Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/packages/teleterm/src/ui/Search/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ function SearchBar() {
position: relative;
flex: 4;
flex-shrink: 1;
min-width: calc(${props => props.theme.space[7]}px * 2);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems unneeded - the layout is still responsive.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It technically looks better too. It's interesting that without this property, the underlying elements occupy their own minimal space, while if min-width of the parent is specified, they're squeezed inside the parent.

Here's a comparison:

Without min-width With min-width
without min-width with min-width

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Idk why 🤷‍♂️

height: 100%;
border: 1px ${props => props.theme.colors.buttons.border.border} solid;
border-radius: ${props => props.theme.radii[2]}px;
Expand Down Expand Up @@ -185,7 +184,9 @@ function SearchBar() {
const Input = styled.input`
height: 38px;
width: 100%;
min-width: calc(${props => props.theme.space[9]}px * 2);
// min-width causes the filters and the actual input text to be broken into
// two lines when there is no space
min-width: calc(${props => props.theme.space[8]}px * 2);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume this had to be dropped from 9 to 8 to make everything fit?

I remember setting it to a specific width (but I don't remember why because I didn't leave a comment 🙃), probably for both filters to fit on a single line even when the window is at its narrowest. But at the smallest window width, it's probably better to make the top bar usable rather than to keep both filters in the same line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, when the width was 9, the content of the input was a little too wide.

But at the smallest window width, it's probably better to make the top bar usable rather than to keep both filters in the same line.

👍

background: transparent;
color: inherit;
box-sizing: border-box;
Expand Down
1 change: 1 addition & 0 deletions web/packages/teleterm/src/ui/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const CentralContainer = styled(Flex).attrs({ gap: 3 })`
align-items: center;
justify-content: center;
height: 100%;
min-width: 0;
max-width: calc(${props => props.theme.space[10]}px * 9);
`;

Expand Down