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

Add UseEffect to render JoinFormPane when new form is added #2206

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DaleLuce
Copy link
Contributor

@DaleLuce DaleLuce commented Sep 29, 2024

Description

This PR…
is to add feedback when the user adds a new joinForm. Before the form was added to the bottom of the list, possibly out of sight.

I added a useEffect to track joinForms and state to ensure that the form pane is only rendered when a new form is added and not on initial render.

Screenshots

Screenshot 2024-09-29 at 10 24 33 AM Screenshot 2024-09-29 at 10 24 22 AM

Changes

[Add a list of features added/changed, bugs fixed etc]

  • Adds…
    renders joinFormPane when new form is added
  • Changes…
    added state and useEffect to achieve this behavior

Notes to reviewer

navigate to organize/1/people/joinforms and select create join form from top right create button

Related issues

Resolves #2174

Copy link
Member

@richardolsson richardolsson left a comment

Choose a reason for hiding this comment

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

I'm happy to see that you tried using useEffect() for this because that was my idea as well, but I can see here that it doesn't work. There are a couple of bugs that stand out immediately, but there will probably be others as well.

One is that when I browse to the join forms page, it initially opens a join form, which it shouldn't (until I click something). The other is that this doesn't (reliably) work when clicking the Create button from another page (e.g. the duplicates tab).

My suggestion would be to try a completely different approach, similar to what we're doing for folders in the people list browser. For that, we use the store to keep track of the recently created folder. Try to search the codebase for recentlyCreatedFolder to see how that works.

If you want to give it a try, have a go. Otherwise you can close this and unassign the issue and you (or someone else) can come back to it later.

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.

Join forms: No visual feedback when creating a new join form
2 participants