twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
GNU Affero General Public License v3.0
15.85k stars 1.75k forks source link

Focused cell is acting weird when scrolling horizontally #5595

Open ijreilly opened 3 months ago

ijreilly commented 3 months ago

https://github.com/twentyhq/twenty/assets/51697796/1cb614ea-b73f-4629-abd8-7341b826dee2

greptile-apps[bot] commented 3 months ago

Disclaimer: This comment was automatically generated with AI. It can give some useful hints as to where to look for, but sometimes it can also give very inaccurate answers so takes this with a pinch of salt :).

To address the issue of the focused cell acting weird when scrolling horizontally, follow these steps:

  1. Locate the relevant component: The issue is likely within the table components handling activities. Check /packages/twenty-front/src/modules/activities/table/components/CellCommentChip.tsx and /packages/twenty-front/src/modules/activities/table/components/CommentChip.tsx.

  2. Check the scrolling behavior: Ensure that the focused cell maintains its state and position correctly during horizontal scrolling. This might involve adjusting the CSS or the component's state management.

  3. Adjust the context if necessary: Review the InlineCellMutationContext and useInlineCell hook in /packages/twenty-front/src/modules/object-record/record-inline-cell to ensure the focused cell's state is managed correctly during scroll events.

  4. Modify the component: If needed, add or adjust event listeners for scroll events to maintain the focus state. Example:

    useEffect(() => {
    const handleScroll = () => {
    // Logic to maintain focus state
    };
    window.addEventListener('scroll', handleScroll);
    return () => window.removeEventListener('scroll', handleScroll);
    }, []);
  5. Test the changes: Ensure the focused cell behaves correctly during horizontal scrolling.

References

/packages/twenty-front/src/modules/activities/table /packages/twenty-front/src/modules/activities/table/components /packages/twenty-front/src/modules/object-record/record-inline-cell

Ask Greptile

its-id commented 3 months ago

looking into it. let me see if this can be fixed.

ijreilly commented 3 months ago

https://github.com/twentyhq/twenty/assets/51697796/aa848bab-e849-4352-aab8-2d7525a673bf

Capture d’écran 2024-06-05 à 12 23 57
Nabhag8848 commented 1 month ago

Working on it 🔥 - P0 priority.

Edit: changing priority to P2, this is tricky then i thought, just z-index won't fix this i believe.

also Question: Also later we will have a behaviour that when cell is focused, table shouldn't be scrollable (left and right) ideally this is what I think behaviour is, tackling both makes at the same time makes more sense to me.

charlesBochet commented 2 weeks ago

Duplicated issue: https://github.com/twentyhq/twenty/issues/6813, let's make sure both are fixed

charlesBochet commented 6 days ago

The issue is still there!