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] slash-menu-height-fix #8327

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

Hitarthsheth07
Copy link
Contributor

FIX #8326

I've used the height: fit-content property just for customSlashMenu but I think it will work for all dropdown menu's.
I tested it for a few and works fine, but not sure for edge cases.

Let me know if the height should be changed to fir-content

image

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR modifies the DropdownMenu component to fix excessive vertical spacing in the slash menu by introducing height control through an isCustomSlashMenu prop.

  • Added isCustomSlashMenu boolean prop to DropdownMenu in /packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenu.tsx to toggle between fit-content and 100% height
  • Implemented prop usage in /packages/twenty-front/src/modules/ui/input/editor/components/CustomSlashMenu.tsx by setting isCustomSlashMenu={true}
  • Consider refactoring to use a more generic height control prop rather than slash-menu specific implementation for better maintainability

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -24,7 +24,7 @@ const StyledSlashMenu = styled.div`
export const CustomSlashMenu = (props: CustomSlashMenuProps) => {
return (
<StyledSlashMenu>
<DropdownMenu style={{ zIndex: 2001 }}>
<DropdownMenu style={{ zIndex: 2001 }} isCustomSlashMenu={true}>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider adding a maxHeight prop to handle cases where the content might exceed the viewport height

Comment on lines 26 to 27
height: ${({ isCustomSlashMenu }) =>
isCustomSlashMenu ? 'fit-content' : '100%'};
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider using a more generic prop name like fitContent instead of isCustomSlashMenu to make this feature reusable for other dropdown cases

box-shadow: ${({ theme }) => theme.boxShadow.strong};

display: flex;

height: 100%;
height: ${({ isCustomSlashMenu }) =>
isCustomSlashMenu ? 'fit-content' : '100%'};
Copy link
Member

Choose a reason for hiding this comment

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

@Hitarthsheth07 fit-content was not working everywhere?

Copy link
Contributor Author

@Hitarthsheth07 Hitarthsheth07 Nov 5, 2024

Choose a reason for hiding this comment

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

It does work everywhere, should I change it to fit-content

Copy link
Member

Choose a reason for hiding this comment

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

If it works everywhere yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ob it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@lucasbordeau lucasbordeau enabled auto-merge (squash) November 8, 2024 16:09
@lucasbordeau lucasbordeau merged commit 6ec8a5b into twentyhq:main Nov 8, 2024
16 checks passed
Copy link

github-actions bot commented Nov 8, 2024

Thanks @Hitarthsheth07 for your contribution!
This marks your 4th PR on the repo. You're top 8% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

Slash Menu has more height than it's content
3 participants