Skip to content

[Web] Fix scrolling in Node list in web terminal#26622

Merged
rudream merged 1 commit intomasterfrom
yassine/ui-fixes
May 25, 2023
Merged

[Web] Fix scrolling in Node list in web terminal#26622
rudream merged 1 commit intomasterfrom
yassine/ui-fixes

Conversation

@rudream
Copy link
Copy Markdown
Contributor

@rudream rudream commented May 19, 2023

Purpose

This PR resolves #26604

Fixes the scrolling on the Nodes list in the web terminal.

Also, for active sessions, makes it so the participant mode menu closes after joining a session rather than staying open.

@rudream rudream requested a review from zmb3 May 19, 2023 17:39
@github-actions github-actions Bot requested review from kimlisa and ravicious May 19, 2023 17:39
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

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

It fixes the problem but I think we should pursue the solution with removing overflow: hidden if possible. Doing so will make it harder to reintroduce this problem in the future.

display: flex;
flex: 1;
max-width: 1024px;
height: fit-content;
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.

Do you remember why overflow: hidden was added to StyledTableWrapper? If it's possible to get rid of it then I think long-term it might be a better fix than adding height: fit-content here.

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.

The reasoning was for all our different tables (paginated, searchable, simple, etc.) to have rounded corners. Wrapping all tables with it and having it round the corners with a borderRadius made it so we didn't have to always manually add a border radius for every table individually.

Comment thread web/packages/teleport/src/Sessions/SessionList/SessionList.tsx
participantModes: ParticipantMode[];
showCTA: boolean;
}) => {
const [anchorEl, setAnchorEl] = useState<HTMLElement>(null);
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.

A feedback for the future as this pattern wasn't introduced by this PR specifically, but I don't think it's a good practice to store HTML elements in the state – you might end up storing an element in the state that's no longer in DOM. Was this done as a workaround for some other problem?

Looking at the previous version of JoinMenu, I think a more idiomatic solution would be to create a new ref with useRef, pass it as the ref prop to <ButtonBorder>. Then to control whether <Menu> is supposed to be open or not, we could have const [isOpen, setIsOpen] = useState(false) and on the button click we could flip it to true.

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.

MenuLogin does it this way already. It looks like the prop has to be named setRef for the button components, I'm not exactly sure why it's done like this.

const Button = ({ children, setRef, ...props }) => {
return (
<StyledButton {...props} ref={setRef}>

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.

Agreed, I'll keep track of this and we can come back and refactor all our popover menu components at some point.

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from kimlisa May 22, 2023 14:48
@rudream rudream added this pull request to the merge queue May 25, 2023
Merged via the queue into master with commit d19f2ff May 25, 2023
@rudream rudream deleted the yassine/ui-fixes branch May 25, 2023 15:46
@r0mant r0mant mentioned this pull request Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There's no more rolling on session screen

3 participants