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

Reordering Transcription/Metadata fields broken after lines are deleted #3605

Closed
benwbrum opened this issue Apr 6, 2023 · 2 comments · Fixed by #3762
Closed

Reordering Transcription/Metadata fields broken after lines are deleted #3605

benwbrum opened this issue Apr 6, 2023 · 2 comments · Fixed by #3762
Assignees

Comments

@benwbrum
Copy link
Owner

benwbrum commented Apr 6, 2023

If a project owner has a field-based project (or metadata description project), they are not able to correctly drag fields from one line to another if they have deleted all the fields from a preceding line.

@benwbrum
Copy link
Owner Author

benwbrum commented Apr 6, 2023

To reproduce:
Video

@benwbrum
Copy link
Owner Author

benwbrum commented Apr 6, 2023

The underlying problem seems to be that we store the field position in transcription_field.line_number in absolute form, but the drag-and-drop code calculates the drop target's line number based on its relative position. If all fields from line 1 (position 0) have been deleted, the underlying data for line 2 and 3 remains 2 and 3, but the drop targets for those lines will be position 0 and 1. (Positions are zero-indexed while lines are 1-indexed.)

One approach might be to make the controller re-number the fields in the underlying data after any field deletions (or emptying a line by dragging fields out of it). Another approach might be to make the view aware of the line_number values somehow.

@benwbrum benwbrum linked a pull request Aug 27, 2023 that will close this issue
benwbrum added a commit that referenced this issue Aug 30, 2023
…ields

#3605 Fixed issue related to broken fields after reordering
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 a pull request may close this issue.

2 participants