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

Notes flash after note update/creation #5444

Closed
Bonapara opened this issue May 16, 2024 · 4 comments
Closed

Notes flash after note update/creation #5444

Bonapara opened this issue May 16, 2024 · 4 comments
Labels
good for experienced contributor scope: front Issues that are affecting the frontend side only type: bug Something isn't working

Comments

@Bonapara
Copy link
Member

Description

Notes are flashing when creating or updating a note

CleanShot.2024-05-16.at.15.40.51-converted.mp4

Where

Twenty (demo) workspace

How to reproduce

Go to a record page with existing notes and try to create a new one.

@Bonapara Bonapara added type: bug Something isn't working scope: front Issues that are affecting the frontend side only good for experienced contributor labels May 16, 2024
Copy link

greptile-apps bot commented May 16, 2024

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 resolve the issue of notes flashing after update/creation, follow these steps:

  1. Investigate useNotes Hook:

    • File: src/hooks/useNotes.js
    • Check the logic for fetching and updating notes. Ensure that state updates are batched correctly to prevent unnecessary re-renders.
  2. Review Notes Component:

    • File: src/components/Notes.js
    • Look for the rendering logic and see if there are any forced re-renders or state changes that could cause the flashing.
  3. Optimize State Management:

    • Ensure that the state is updated in a way that minimizes re-renders. Consider using React.memo or useCallback to optimize the component rendering.
  4. Example Code Fix:

    // src/hooks/useNotes.js
    const updateNote = async (note) => {
      // Existing update logic
      // Add batching or debounce logic here if necessary
    };
    // src/components/Notes.js
    const Notes = React.memo(({ notes }) => {
      // Existing rendering logic
      // Ensure that the component only re-renders when necessary
    });

References

@H0onnn
Copy link
Contributor

H0onnn commented May 21, 2024

Hello, @Bonapara ! Please check PR #5469 :)

@Bonapara
Copy link
Member Author

Hi @H0onnn, I'm not technical myself, but the tech team will look into it soon. Thanks!

lucasbordeau added a commit to H0onnn/twenty that referenced this issue May 30, 2024
@lucasbordeau
Copy link
Contributor

Can't reproduce on main closing for now, don't hesitate to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good for experienced contributor scope: front Issues that are affecting the frontend side only type: bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants