-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 mobile table styling outside record table (#10407) #10663
base: main
Are you sure you want to change the base?
Fix mobile table styling outside record table (#10407) #10663
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 refactors mobile table styling by removing data-testid-based styles and introducing a new label visibility system for chip fields in mobile views.
- Added new
useIsChipFieldDisplayLabelHidden
hook in/packages/twenty-front/src/modules/object-record/record-field/meta-types/display/hooks/useIsChipFieldDisplayLabelHidden.ts
to manage label visibility based on mobile context - Removed mobile-specific styling from
RecordTableBody
that was using data-testid selectors - Added
isLabelHidden
prop propagation throughChipFieldDisplay
->RecordChip
->LinkAvatarChip
->Chip
component chain - Modified
RecordTableCellSoftFocusMode
to hide first column button on mobile devices - Fixed
ChipFieldDisplay
error when used outside record table context with fallback instanceId
8 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
...ules/object-record/record-field/meta-types/display/hooks/useIsChipFieldDisplayLabelHidden.ts
Show resolved
Hide resolved
packages/twenty-ui/src/display/avatar-chip/components/LinkAvatarChip.tsx
Show resolved
Hide resolved
|
||
const isRecordTableScrolledLeft = useRecoilComponentValueV2( | ||
isRecordTableScrolledLeftComponentState, | ||
instanceStateContext?.instanceId || 'EMPTY', // TODO: Ugly, find a better way to avoid throwing when instance state context is not found |
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.
This has to be changed before merging.
This EMPTY
placeholder is here to make useAvailableComponentInstanceIdOrThrow
inside useRecoilComponentValueV2
not throw if instance state context is not found.
One option could be to add a parameter like throwOnMissingInstanceStateContext
to useRecoilComponentValueV2
.
What do you think @lucasbordeau, would that be a good solution?
Fix to issue #10407 now including a fix to
ChipFieldDisplay
throwing an error outside a record table.This works now, but refactoring is needed before merging.