Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Bugs introduced by #1070 #1073

Closed susanodd closed 1 month ago

susanodd commented 1 year ago

There are quite a few formatting bugs with the senses when multiple datasets are chosen and senses are missing for languages. This is in Gloss List View. gloss-list-view-misaligned-handshape-1-under-norwegian-sense

There is a column shift and the Gloss fields appear under the Senses fields where the translations are missing.

This is because the lookup (generation of the gloss rows) is done over a "list" rather than a "language indexed dictionary".

susanodd commented 1 year ago

The relations view is also messed up by this function.

It's changes made in #1070

susanodd commented 1 year ago

I resolved this on the streamline branch (#1071 )

susanodd commented 1 year ago

This has been repaired and deployed.

Jetske commented 1 year ago

The changes I made were to make the senses line up such that 2 is not right next to 3 if it's missing in a language. The only thing it did, I think, was add a newline if the sensetranslation for the language was empty.

Now this happens:

image

I'll try to look at it again

Jetske commented 1 year ago

From the screenshot I can't really tell where the bugs are, can you show them more specifically?

susanodd commented 1 year ago

I fixed this on Friday. It was getting run-time errors for an empty dictionary value. I fixed this.

susanodd commented 1 year ago

The example above shows that the columns are not aligned with the header. I fixed that. The other error was a run-time error on a NoneType. (Empty dictionary.)

https://github.com/Signbank/Global-signbank/blob/9477776f856d6ca361ccf4d0ea6b7aad8fd0bb2f/signbank/dictionary/templatetags/annotation_idgloss_translation.py#L204-L217

I guess maybe return a string with <br> if it's empty?

This function had a problem. It didn't fix the runtime error except for relations view.

susanodd commented 1 year ago

relations-view-spacing-senses

Jetske commented 1 year ago

Yes that looks good! I also see the problem now with the columns

Then it's only in the gloss list view that they don't line up: image

susanodd commented 1 year ago

I'll try to repair the list view, unless you want to. I was working on the context variables in #1071 (those are deployed) That's when I came across the bug. Probably I made something undone for the format. It looks like I just replaced the code in GlossListView (gloss_row.html template).

But in the gloss list view, there can be more columns for other languages. In the Relations view there are only columns for the dataset of the gloss.

I think the bug had something to do with the languages not existing in the dictionary. It didn't want to loop over sensetranslations.items

susanodd commented 1 year ago

Maybe if keys (orders) are skipped the code doesn't work properly?

https://github.com/Signbank/Global-signbank/blob/9477776f856d6ca361ccf4d0ea6b7aad8fd0bb2f/signbank/dictionary/templatetags/annotation_idgloss_translation.py#L204-L217

This code assumes that all the order numbers exist? I don't know. It didn't want to iterate over the key, value in items, so I changed it to iterate over the keys.

susanodd commented 1 year ago

https://github.com/Signbank/Global-signbank/blob/9477776f856d6ca361ccf4d0ea6b7aad8fd0bb2f/signbank/dictionary/templates/dictionary/gloss_row.html#L59-L72

susanodd commented 1 year ago

new_dictionary[key] = "<br>"

susanodd commented 1 year ago

I got it so that it has an empty row.

However, because of line wrapping in the columns, and that the languages are in separate columns, it is not known whether there is line-wrap or not.

horizontal-vertical-sense-order-gloss-list

susanodd commented 1 year ago

Probably it needs a table inside the display for senses so the order is on a separate row and the line wrap forces the rows to align.

Jetske commented 1 year ago

Yes, I thought that as well.. Although I think for most senses they will probably line up ok if not too many translations are given and it's a big screen. It's not ideal though either way.