ponder-lab / Imperative-DL-Study-Web-App

0 stars 0 forks source link

Add the option to either use an existing category or add a new categories in categorization insertion #30

Closed khatchad closed 3 years ago

khatchad commented 3 years ago

For example, in https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations/add=00a33f7e060caa6616c15003bdac95b7926b76ae, it seems that I am only able to choose existing categories. How can I create new ones?

tatianacv commented 3 years ago

You can input which ever category you would like and if it is in the table it inserts it to categorizations, if not it creates the category and then inserts the categorization.

khatchad commented 3 years ago

@mZneit, could you please verify that this is working correctly?

khatchad commented 3 years ago

I am wondering if we should allow categorizers to use existing categories, i.e., easily give them the option of using an existing one or create a new one. I think if that it's (equally or close to equally) easy to create a new category, this won't bias the categorizer. What do you think? Something like this (preview), perhaps?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>Categorization Form</title>
</head>
<body>
  <form>
    <table summary="Categorization layout.">
      <tr>
        <td>Category: 
    <select name="category_select">
          <option>
      <!-- Is this first "blank" option is selected, create a new category from the text field. -->
          </option>
          <option>
            option1
          </option>
          <option>
            option2
          </option>
          <option>
            option3
          </option>
        </select></td>
    <td>Or, create new: <input name="category_text" type="text"/></td>
      </tr>
    </table>
  </form>
</body>
</html>
khatchad commented 3 years ago

The categories would be populated from the DB:

select category from problem_categories

... for other categories.

mZneit commented 3 years ago

@mZneit, could you please verify that this is working correctly?

It is working correctly. I just added a new problem category in the add categorization form and it showed up in the categorizations.

khatchad commented 3 years ago

@mZneit I thought you said that there were some integers?

mZneit commented 3 years ago

Yes. It's assigning large integer values to the newly added problem category.

khatchad commented 3 years ago

Can you give us an example?

mZneit commented 3 years ago

I added random problem categories. For example, "problem1", "problem2".. and they were assigned the integers 314, 324, 334... the increment is on the tens value.

tatianacv commented 3 years ago

Sounds good!

khatchad commented 3 years ago

The categories would be populated from the DB:

select category from problem_categories

... for other categories.

I had the wrong SQL for this. I updated it.

khatchad commented 3 years ago

@tatianacv is working on the choice.

tatianacv commented 3 years ago

I have updated. Now there is a blank space while you are writing it gives you options of previous categories (for the others as well) and can choose, or can write your own. Commits that reflect this changes are: d690063dab847d810621ff82e24fdaedf3caf268 e99a471fe126d2289e99ae1d5388ac70adf11a2c bedb642faa95cd98e238aca5f59959a8c5d0fa5d db35ee562f3f26945c8759578ea602450067de62

khatchad commented 3 years ago

Sorry, I forgot to mention the category description!

khatchad commented 3 years ago

Also, what is the significance of the line at the last category?

khatchad commented 3 years ago

Also, I received a server error (500) after inserting a categorization via https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations/add%3Fcommit=1d16fc105951f7b99930a0caa870de4f99eda176.

tatianacv commented 3 years ago

How would you like the description to be added to the form? Always there as an option?

tatianacv commented 3 years ago

What do you mean with "Also, what is the significance of the line at the last category?" ?

tatianacv commented 3 years ago

Reply to: "Also, I received a server error (500) after inserting a categorization via https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations/add%3Fcommit=1d16fc105951f7b99930a0caa870de4f99eda176."

May I ask what you were trying to insert? and how you did it? I tried it in various scenarios and all worked, I just want to see if there was a case I overlooked?

tatianacv commented 3 years ago

I see that you inserted a few categorizations when I checked the database, which was the one that failed?

khatchad commented 3 years ago

How would you like the description to be added to the form? Always there as an option?

There could be another textbox, but this is just an idea:

<form>
    <table summary="Categorization layout.">
      <tr>
        <td>Category: 
    <select name="category_select">
          <option>
      <!-- Is this first "blank" option is selected, create a new category from the text field. -->
          </option>
          <option>
            option1
          </option>
          <option>
            option2
          </option>
          <option>
            option3
          </option>
        </select></td>
    <td>Or, create new: <input name="category_text" type="text"/>  <input name="category_desc" type="text"/></td>
      </tr>
    </table>
  </form>
khatchad commented 3 years ago

I see that you inserted a few categorizations when I checked the database, which was the one that failed?

Can you check the logs? Otherwise, here's a PDF. PONDER.pdf

khatchad commented 3 years ago

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

image

khatchad commented 3 years ago

I am at d690063dab847d810621ff82e24fdaedf3caf268.

tatianacv commented 3 years ago

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

That is because that is something you previously wrote on the field but is not an actual option. This is because I deleted the tests from the table so we do not have so much data.

khatchad commented 3 years ago

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

That is because that is something you previously wrote on the field but is not an actual option. This is because I deleted the tests from the table so we do not have so much data.

So, I can select an option that doesn't actually exist?

khatchad commented 3 years ago

How would you like the description to be added to the form? Always there as an option?

I guess another suggestion would be to have a popup to create new category. The popup would have whatever fields are required for the category.

Alternative, we could have a way to alter the category descriptions later. In any case, I filed #48.

tatianacv commented 3 years ago

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

That is because that is something you previously wrote on the field but is not an actual option. This is because I deleted the tests from the table so we do not have so much data.

So, I can select an option that doesn't actually exist?

It will just insert it if is not in the table.

tatianacv commented 3 years ago

You can write your category and it will insert, or choose from the registered categories.

khatchad commented 3 years ago

You can write your category and it will insert, or choose from the registered categories.

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

That is because that is something you previously wrote on the field but is not an actual option. This is because I deleted the tests from the table so we do not have so much data.

So, I can select an option that doesn't actually exist?

It will just insert it if is not in the table.

OK, understood. But, I think this UI is confusing, right? I cannot tell the difference between what I entered previously into the textbox and the existing categories in the DB.

tatianacv commented 3 years ago

You can write your category and it will insert, or choose from the registered categories.

What do you mean with "Also, what is the significance of the line at the last category?" ?

See the line right before the last category?

That is because that is something you previously wrote on the field but is not an actual option. This is because I deleted the tests from the table so we do not have so much data.

So, I can select an option that doesn't actually exist?

It will just insert it if is not in the table.

OK, understood. But, I think this UI is confusing, right? I cannot tell the difference between what I entered previously into the textbox and the existing categories in the DB.

I understand. I think that line is what tells the user the difference. I liked this approach better than having a separate field because this (in my mind) even further helps reduce the bias because the appear as you write so categories (for example) will show up depending on you wanted to write in the first place.

For example: If I see a commit and I think there is some kind of misuse I could write "misuse" and "API Misuse" would show up and I could decide if that was what I meant/related to the commit category or just write my own category for what I would categorize it.

But, if you feel this is not good, would you like me to change this design?

khatchad commented 3 years ago

Understood. But, how to deal with #48?

tatianacv commented 3 years ago

I see that you inserted a few categorizations when I checked the database, which was the one that failed?

Can you check the logs? Otherwise, here's a PDF. PONDER.pdf

I deleted the problem issues (category,cause, fix, etc) that were new (Stuff, Red, etc), to replicate the issue and I had no problem inserting the categorization.

tatianacv commented 3 years ago

Understood. But, how to deal with #48?

Add another field for the description?

tatianacv commented 3 years ago

@khatchad Is this issue classified as done? I know we are considering the description but there are other issues for that issue, correct?

khatchad commented 3 years ago

Actually, this probably needs some more testing. @y3pio, can you try to break this form?

khatchad commented 3 years ago

Actually, I just broke it at https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations/add%3Fcommit=00a33f7e060caa6616c15003bdac95b7926b76ae.

I entered false for whether the commit represented a tf.function bug fix. I got the following error:

Request Method: POST
https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations/add%3Fcommit%3D00a33f7e060caa6616c15003bdac95b7926b76ae
3.1.7
ValueError
Field 'should_discuss' expected a number but got ''.
/app/.heroku/python/lib/python3.7/site-packages/django/db/models/fields/__init__.py, line 1778, in get_prep_value
/app/.heroku/python/bin/python
3.7.8
['/app/.heroku/python/bin',  '/app',  '/app/.heroku/python/lib/python37.zip',  '/app/.heroku/python/lib/python3.7',  '/app/.heroku/python/lib/python3.7/lib-dynload',  '/app/.heroku/python/lib/python3.7/site-packages']
Mon, 08 Mar 2021 16:06:18 +0000
tatianacv commented 3 years ago

Fixed in d7ace4805d5f0f55999102b51626d342b98e19da

khatchad commented 3 years ago

This looks done to me.