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: Minor bug in column scroll in mobile viewport #7448

Merged
merged 5 commits into from
Oct 5, 2024

Conversation

harshit078
Copy link
Contributor

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 pull request addresses a minor bug in column scrolling for mobile viewports. The change reduces the width of a specific table header cell from 35px to 30px.

  • Modified packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeader.tsx to adjust cell width
  • Reduced width of third table header cell from 35px to 30px for mobile viewports
  • Aims to prevent first letter of input from being displayed during column scrolling on mobile
  • Further testing on mobile devices recommended to ensure full resolution of the issue

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@charlesBochet
Copy link
Member

@harshit078 Thanks for the issue AND the PR

I have some feedbacks / questions:

  • Regarding the issue on the RecordTable, your fix works but the ideal fix would be to display the first column chip itself in a "compact mode" where we only see the icon. I would add a prop on top of the AvatarChip (isCompact), add a property to the FieldContext isCompactDisplay and set it to true in the case of isMobile
  • Regarding the other issue on the RightDrawer, I managed to reproduce it but I'm not sure to understand how it's happening (looks like the margin is still applied and mess with the design) but I'm not sure your fix is correct as it might break other behaviors, I'm double checking

@@ -11,7 +11,7 @@ const StyledInlineCellEditModeContainer = styled.div`
display: flex;
height: 24px;

margin-left: -${({ theme }) => theme.spacing(1)};
margin-left: ${({ theme }) => theme.spacing(1)};
Copy link
Member

Choose a reason for hiding this comment

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

changing it might break the alignment for other inline edit input

@charlesBochet
Copy link
Member

Regarding my second point, it's indeed breaking the alignment of the inplace input:
image

(the placeholder of the edit input should be in the exact same spot as the display text)

I think there is something very wrong with the current implementation, I'm making a proposal in your PR

@@ -38,6 +38,6 @@ export const Default: Story = {
await canvas.findByText('Tasks');
await canvas.findByText('People');
await canvas.findByText('Opportunities');
await canvas.findByText('My Customs');
await canvas.findByText('Rockets');
Copy link
Member

Choose a reason for hiding this comment

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

Fixing an unrelated story

@@ -24,15 +24,13 @@ import {
type RecordInlineCellProps = {
readonly?: boolean;
loading?: boolean;
isCentered?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

no need to drilldown props as we already have it from the context

const StyledInlineCellEditModeContainer = styled.div`
align-items: center;

display: flex;
width: 100%;
Copy link
Member

Choose a reason for hiding this comment

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

this is correct and ease positioning

middleware: [
flip(),
offset(
isCentered
? {
mainAxis: -32,
Copy link
Member

Choose a reason for hiding this comment

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

this was non sense :p

@charlesBochet
Copy link
Member

/award 150

Copy link

oss-gg bot commented Oct 5, 2024

Awarding harshit078: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/harshit078

@@ -36,7 +36,7 @@ const meta: Meta<typeof EventRowMainObjectUpdated> = {
},
} as TimelineActivity,
mainObjectMetadataItem: generatedMockObjectMetadataItems.find(
(item) => item.namePlural === 'person',
(item) => item.nameSingular === 'person',
Copy link
Member

Choose a reason for hiding this comment

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

non related too

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

I will actually approve it as it looks not so bad regarding the table too! I still think we could implement something more robust but it still a good step forward

Thank you @harshit078 :)

@charlesBochet charlesBochet merged commit 967e04f into twentyhq:main Oct 5, 2024
11 checks passed
Copy link

github-actions bot commented Oct 5, 2024

Thanks @harshit078 for your contribution!
This marks your 23rd PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

@harshit078
Copy link
Contributor Author

@charlesBochet The whole misalignment of RecordInline cell container started from #6899 where it was decided to reduce the width of container which led to their current looking state.

@harshit078
Copy link
Contributor Author

One more feature to work on would be to improve the overall snap and scroll behaviour for ismobile when scrolling across the table.

Screen.Recording.2024-10-05.at.3.24.01.PM.mov

@charlesBochet
Copy link
Member

@charlesBochet The whole misalignment of RecordInline cell container started from #6899 where it was decided to reduce the width of container which led to their current looking state.

Yes but the issue was that the editModeContainer was a 0px container putted right before the displayMode which made very hard to properly align the floating inplace input. I have changed it to be absolutely positioned on top which give us more control!

Yes the we can do better regarding the snap, maybe some animation?

@harshit078
Copy link
Contributor Author

Yes, I agree to your point on giving position:absolute to gain more control on cell container. Could we do transition- ease-in-out, scroll-behavior- smooth or maybe something in the same direction. Whats your take @charlesBochet ?

harshit078 added a commit to harshit078/twenty that referenced this pull request Oct 14, 2024
> [!Note]
> - This PR fixes twentyhq#7447

---------

Co-authored-by: Charles Bochet <[email protected]>
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.

Minor bug in column scroll in mobile viewport
2 participants