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

feat: record group chevron button #9645

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Jan 15, 2025

This ticket is related to this Discord post https://discord.com/channels/1130383047699738754/1328756649657110559

@magrinj magrinj marked this pull request as ready for review January 15, 2025 15:48
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

Added a new AnimatedLightIconButton component that extends LightIconButton with Framer Motion animations, primarily used for record group chevron buttons.

  • Added packages/twenty-ui/src/input/button/components/AnimatedLightIconButton.tsx with animation support via framer-motion ^11.18.0
  • Duplicate title prop in AnimatedLightIconButtonProps (both explicit and in ComponentProps<'button'>)
  • Missing default case in accent color switch statement could lead to undefined colors
  • Removed outline on focus in AnimatedLightIconButton may impact accessibility
  • Replaced custom motion.span with AnimatedLightIconButton in RecordTableRecordGroupSection while maintaining animation behavior

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

Comment on lines +11 to +23
export type AnimatedLightIconButtonProps = {
className?: string;
testId?: string;
Icon?: IconComponent;
title?: string;
size?: LightIconButtonSize;
accent?: LightIconButtonAccent;
active?: boolean;
disabled?: boolean;
focus?: boolean;
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
} & Pick<ComponentProps<'button'>, 'aria-label' | 'title'> &
Pick<MotionProps, 'animate' | 'transition'>;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: title prop is duplicated - it appears in both the explicit props and ComponentProps<'button'> Pick

Comment on lines +91 to +97
<AnimatedLightIconButton
Icon={IconChevronDown}
size="small"
accent="secondary"
animate={{ rotate: !isRecordGroupTableSectionToggled ? -90 : 0 }}
transition={{ duration: theme.animation.duration.normal }}
style={{
display: 'inline-block',
}}
>
<IconChevronDown size={theme.icon.size.md} />
</motion.span>
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: missing aria-label for accessibility on the button that controls expanding/collapsing the section

Comment on lines 88 to 89
<StyledTrContainer onClick={handleDropdownToggle}>
<td aria-hidden />
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 role='row' to StyledTrContainer for better accessibility

@lucasbordeau lucasbordeau self-assigned this Jan 15, 2025
Copy link
Contributor

@lucasbordeau lucasbordeau left a comment

Choose a reason for hiding this comment

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

LGTM

@magrinj magrinj merged commit f5b0926 into main Jan 16, 2025
37 of 38 checks passed
@magrinj magrinj deleted the feat/record-group-chevron-button branch January 16, 2025 09:03
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.

2 participants