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

Can't load same demo after loading from database #1150

Open
kdahlquist opened this issue Nov 20, 2024 · 6 comments
Open

Can't load same demo after loading from database #1150

kdahlquist opened this issue Nov 20, 2024 · 6 comments
Assignees

Comments

@kdahlquist
Copy link
Collaborator

Do the following actions on beta:

I think this is because Demo #2 is still showing up in the side panel and clicking on it again doesn't do anything. I can load it from the Network menu OK.

@kdahlquist kdahlquist added the bug label Nov 20, 2024
@dondi
Copy link
Owner

dondi commented Nov 20, 2024

This appears to break down into two distinct buggy behaviors:

  • It should be possible to re-load the same demo; this resets the demo network to the original force-graph setup. The Network menu and Demo menu versions of this dropdown behave in this manner; we should find a way to make the sidebar version do the same
  • If a demo is selected but the user then opens something different (e.g., a file or a database network), then the sidebar select element should reflect this by reverting to “Select a demo”

If it becomes necessary to separate these into their own issues, we can do so

@MilkaZek
Copy link
Collaborator

On update-app.js we added a new function to reset the demo dropdown and called it whenever the 'Generate Network' button gets clicked; the bug seems to be fixed. I've attached screenshots of the code snippets we added to update-app.js. We're unsure if we should place this code in the generate-network.js file or keep it here. We also weren't sure if keeping lines 602 & 603 from the screenshot is necessary, for the bug seems to be fixed without them, but the other Network Mode value change listeners include them.

Image Image

@dondi
Copy link
Owner

dondi commented Feb 12, 2025

Go ahead and create a branch then put these changes there, and open pull request. That will let us do a code review and also try the code out live

@dondi
Copy link
Owner

dondi commented Feb 26, 2025

The recommendation for how to proceed here is to start tracing where the incorrect behavior is taking place; I suggest putting a console log there while replicating the unwanted behavior to see when it gets invoked and by whom. Possible issues include:

  • Unintended setting of the demoDropdownValue somewhere during the update sequence
  • Unintended/overlooked setting of a web app element (via the jQuery $ function) somewhere in the sequence

@kdahlquist
Copy link
Collaborator Author

I just poked around at this. The problem only happens when selecting a demo from the side panel. The behavior is correct when using the "network" or "demo" menu to load the demo.

@kdahlquist
Copy link
Collaborator Author

This issue also occurs if you upload a user file in between selecting the demos from the side panel.

Amelie1253 added a commit that referenced this issue Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants