constellation-app / constellation

A graph-focused data visualisation and interactive analysis application.
https://constellation-app.com
Apache License 2.0
385 stars 59 forks source link

Stop the Welcome View from Opening the Same Graph Multiple Times #2183

Open Delphinus8821 opened 1 month ago

Delphinus8821 commented 1 month ago

Prerequisites

Description of the Change

The Welcome View currently allows you to open the graphs stored in the Recent Graphs as many times as you want and this can sometimes cause exceptions. This change stops users from clicking the graph in Recent Graphs multiple times and having the graph open multiple times, instead it will swap to the tab with the already open graph.

This change still allows for multiple graphs of the same name to be opened as they would have to be saved in different locations.

Alternate Designs

Why Should This Be In Core?

Bugfix to stop an exception from occurring in Core.

Benefits

Possible Drawbacks

Verification Process

  1. Have a graph saved in the Recent graphs on the Welcome View
  2. Open the graph
  3. Attempt to open the graph again, Constellation should swap tabs to the already open graph
  4. Attempt to open a graph with the same name which has been saved in a different location. It should still open.
sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
4.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Delphinus8821 commented 1 month ago

Can still get multiple copies of the same graph opened. When you first start Constellation, the first graph you try to open takes some time before it opens. During that time if you keep clicking on the Recent Files entry on the Welcome Page it will queue up more instances to open the same file.

I think the only way to stop this from occurring would be to only allow one graph to be opened from the Recent Graphs at a time. So you wouldn't be able to open multiple different graphs at the same time which I think could be more annoying