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 checkbox to clear all Variables #666

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

Conversation

sangwoo-joh
Copy link
Contributor

@sangwoo-joh sangwoo-joh commented Apr 13, 2024

This fix is a suggestion that addresses a perhaps personal inconvenience for me. If you have a better solution, I'd love to hear it and hope you'll consider this positively.

The CSV file I use for testing has a lot of columns, not all of which are actually used in the prompt template, but all of which appear as Variable in the viewer. This makes it difficult to keep only the columns I want in Select.
This fix adds a checkbox to either deselect all the Variables at once or select them all. I couldn't figure out the right place for it, so I put it in the same Box as the column Select for now, but if you have a better place, please let me know.

Thanks for the great open source. I always appreciate it!

@typpo
Copy link
Collaborator

typpo commented Apr 15, 2024

Great change! I think my preference here would be to create a dialog that allows for selection of columns, in order to not clutter the top space with many options. What do you think?

@sangwoo-joh
Copy link
Contributor Author

@typpo I hadn't thought of a dialogue, but that sounds like a good idea. I'll give it a try.

@sangwoo-joh
Copy link
Contributor Author

Dear @typpo, I replaced the Select panel of columns with a Dialog and put the "Clear All Variables" button at the top of it. It seemed to work when I tested it locally. I'm not good at designing, so I picked moderate buttons. I'd appreciate it if you could review this!

@sangwoo-joh
Copy link
Contributor Author

I tried to upload some working images and gifs, but they won't upload due to Github's issue...

Copy link
Collaborator

@typpo typpo left a comment

Choose a reason for hiding this comment

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

This is coming together, thanks for setting up the dialog! If it's ok with you, I'll do a pass on the design/layout probably tomorrow. Then I'm happy to merge :)

Comment on lines 312 to 313
<Checkbox checked={selectedColumns.indexOf(column.value) > -1} />
<ListItemText primary={column.label} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm noticing that clicking the checkbox should update the state (right now, you can't actually toggle the checkbox). Let's also connect the label with the checkbox, so that clicking it toggles the state too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've noticed too. I'm trying to fix this now. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@typpo I've restored the original functionality of the checkbox.
Please let me know if I have additional corrections.
Thank you!

@sangwoo-joh
Copy link
Contributor Author

I rebased these commits to the main and then force-pushed them, out of habit. If that's not the policy of this repository, please let me know and next time I'll resolve conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants