kuzudb / explorer

Browser-based user interface for Kùzu graph database
https://hub.docker.com/r/kuzudb/explorer
MIT License
29 stars 5 forks source link

Autofill fields when there is only one possible option/Disable fields when there is no option #189

Closed semihsalihoglu-uw closed 1 month ago

semihsalihoglu-uw commented 1 month ago

In several scenarios I noticed that in the UI there is a single possible option but the dropdowns are not auto-filled. 2 cases I ran into are: 1) When there is a single node table and we create a new rel table in the Schema view, we can autofill the From and To dropdowns.

Screen Shot 2024-08-14 at 12 41 02 AM

2) When importing a csv/parquet file to a relationship table, on the "file selection" panel, you select "Type" as "Relationship". Then in the file upload panel if you select "Use existing table", then it can autofill the table name if there is a single relationship table (same for importing to a single node table).

Screen Shot 2024-08-14 at 12 41 49 AM

Similarly when there is no option to take certain actions, we should disable those options. For example, if a db does not have a relationship table, you can still select "Relationship" under "Type" in a selected file. There are probably other cases like this but it would be good to stick to these principles when we can.

mewim commented 1 month ago

I do not think this is a good design.

  1. Even if there is only one option, the user should still review and select manually. Especially in the import UI. Maybe the user has multiple files but forgot to select type for some of them. This can lead to successful, but unexpected import.
  2. I think it is confusing that sometimes that a default option is selected and sometimes not. While it is tied to "only 1 option", it is hard to understand this.
semihsalihoglu-uw commented 1 month ago

Hmm, I thought in my simple cases, since there is no other option auto-filling is safe but sure. I'm closing the option for now, if others independently open a similar issue, we can take that as evidence that autofilling such cases is a good idea.