-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add object names to favorites #8593
Conversation
There was a problem hiding this 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 adds object names to favorites in the navigation drawer, with a text overflow issue where long object names are being clipped instead of showing ellipsis.
- Added
StyledItemLabelWithObjectName
inNavigationDrawerItem.tsx
but text-overflow styling not working correctly - Added
isFavorite
andobjectName
props to bothNavigationDrawerItem
andNavigationDrawerSubItem
components - Implemented
CreateLabelWithObjectName
utility for proper object name formatting with capitalization - Added separator dots between favorite label and object name with proper spacing
4 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
const StyledItemLabelWithObjectName = styled.span` | ||
color: ${({ theme }) => theme.font.color.light}; | ||
font-weight: ${({ theme }) => theme.font.weight.regular}; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing overflow property and max-width constraint needed for text-overflow: ellipsis to work. Add overflow: hidden and max-width.
favorite.labelIdentifier + | ||
' . ' + | ||
String(favorite.objectNameSingular?.charAt(0).toUpperCase()) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Inconsistent separator - using ' . ' (space-dot-space) here but ' · ' (space-middot-space) in the component render. Should use the same separator consistently.
@@ -36,6 +37,8 @@ export const NavigationDrawerSubItem = ({ | |||
keyboard={keyboard} | |||
rightOptions={rightOptions} | |||
isDraggable={isDraggable} | |||
isFavorite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Setting isFavorite to true by default may be too restrictive - consider making this configurable via props like the other properties
Hey @Bonapara, can you review this please? |
Closes #8549
The favorites tab now also displays the object names.
There seems to be a text overflow error with the code as it is. It is not truncating automatically leading to a "clip" behavior instead of an "ellipsis". I tried fixing that, but could not. The Object name should get truncated. Hope someone can guide me on this