PhonologicalCorpusTools / SLPAA

5 stars 0 forks source link

Provide 'copy module' and 'copy sign' options #191

Open kvesik opened 1 year ago

kvesik commented 1 year ago

More generally, we’ll want a ‘copy module’ option (and a ‘copy sign’ option). This is particularly relevant because of the relation module, though, because I realize that my thoughts about having a single relation module being associated to two separate location modules (e.g. for the fingertips in ADULT being the relevant non-contacting handpart at two subsequent locations, at the chin and top of head) didn’t take into account the necessity of a module having timing specified. We don’t actually want it to be a single relation module, in that e.g. the chin location shouldn’t be tied to a relation at the end of the sign — that’s meaningless. But it would be good if the specifications for the relation module for the chin location could be easily copied over for the specifications for the relation module of the top of head location. We should talk about this. (It might also be helpful to be able to copy the timing from one module to another, even across module types — for a complicated sign, it’s annoying to have to re-specify the same timing points multiple times.)

Originally posted by @kchall in https://github.com/PhonologicalCorpusTools/SLPAA/issues/100#issuecomment-1675437965

see also issue #14

kvesik commented 1 year ago

@kchall How should the 'copy module' and 'copy sign' (and potentially 'copy timing' )functionality be accessed?

For 'copy module' I could see any or all of the following:

For 'copy sign' I could see any or all of the following:

For 'copy timing' I could see any or all of the following (this one's a bit trickier to figure out a good solution for...):

Feedback on any of these possibilities? Or any additional ones?

kvesik commented 1 year ago

Notes from 20231030 meeting...

Copying a module

Copying timing info

Copying a sign

Option 1:

Option 2:

Note that copying signs is also connected to importing a whole or partial corpus (see issue #14 )

It was also pointed out that it would be useful to be able to select more than one module in the summary window and copy several at once. This could be facilitated by changing our click system to one more like the kind that a file explorer uses, where a single click highlights a module (or hold ctrl/cmd down to click and select several) and a double-click opens it for editing. We could/should then also implement the same behaviour for signs in the corpus list.

kchall commented 9 months ago

Note that copying a sign should be the first priority in terms of building functionality; then copying a module; then copying timing information.

kvesik commented 3 months ago

@kchall I have a few questions about pasting a copied sign.

Scenario 1

Suppose the user copies a sign and goes to paste it right back into the same corpus.

  1. Should I automatically open the Sign-Level Information dialog populated with the existing info and ask the user to confirm and/or change the glosses, lemma, and ID-gloss as necessary?
  2. And then once saved, the pasted sign will get the next available EntryID counter?

Scenario 2

Suppose the user copies a sign from Corpus A, then opens Corpus B and pastes the sign.

  1. Should the pasted sign get the next available EntryID counter in Corpus B, or should I try to keep the original counter if possible?
  2. If the sign already exists in Corpus B, should the Sign-Level Information dialog be opened as above in question (1)?
  3. What does it mean for a sign to already exist in Corpus B? Matching ID-glosses? Matching glosses+lemma+IDglosses? Matching all sign content and modules?
kchall commented 3 months ago

Thanks, @kvesik!

  1. Yes, that sounds great.
  2. Yes, again, sounds great.
  3. I think next available EntryId is fine.
  4. Yes, sounds great.
  5. It's probably safest if it can do this check if any of gloss, lemma, or ID-gloss are the same if that's an option.
kchall commented 3 months ago

@kvesik I just tried opening the sample corpus, copying BEER, pasting it back into the sample corpus with a new gloss and ID-gloss, and it shows up totally empty instead of with its original content:

Original:

image

Copy:

image

Same thing happens with other signs, or when I paste into a different corpus that also has the same basic sign(s) already in it (e.g. BEER), and I'm not getting any background error messages.

However, it does work correctly (copies a non-blank version) if I create a brand new corpus and paste into that, or open a corpus that doesn't have the same sign in it.

kvesik commented 3 months ago
kchall commented 3 months ago

@kvesik Sorry, I'm a total dolt and clearly should stop working for the night. I was just on the wrong branch.

kchall commented 3 months ago

@kvesik Okay, but this time it's a real comment. 😅

If I copy a sign and paste it back into the original corpus, and tell SLP-AA to auto-update the ID-Gloss (e.g. GLOSS), it literally just adds "1" to the original ID-Gloss (e.g. GLOSS1). This is fine for the first copy, but leads to two problems:

  1. If I paste it a second time, I get GLOSS1 again, so now I actually do have duplicated ID-Glosses, which shouldn't happen. Presumably the number should iterate each time I paste.

  2. If I copy the copy and paste that in, then I get another "1", e.g. GLOSS11. This does follow the basic logic of just adding '1' to the ID-Gloss, but is confusing. Is there some way to separate out the name and the number and actually iterate the number? or is it going to be impossible to do that given that the original ID-gloss is a free-text field by the user? could the auto-update actually be something like "-1" and have whatever comes after the dash be iterable?

kvesik commented 3 months ago

@kchall Thanks for those comments. I've been pondering the same thing myself in parallel to working on the other outstanding elements of this issue. I had spent some time trying to figure out how to auto-iterate the tag, but things got a bit weird (yes, partly because the ID-gloss is completely up to the user). I like the idea of the auto-update having a special format; that might make things a bit easier.

kvesik commented 2 months ago

Still need to implement the copy-module portion of this issue.

kvesik commented 3 weeks ago

@kchall please fetch/pull branch 191 and try out the copy-module functionality so far. You should be able to:

Notes:

kchall commented 3 weeks ago

Thanks, @kvesik ! From what I can tell, the copying / pasting functionality seems to be working as expected -- yay! I have tried copying and pasting into the same sign, different signs, and a new corpus. I have tried editing the copy or the original and confirmed that the other is not affected. I can copy both single modules and multiples, of both the same and different types.

The double-clicking I think is basically fine, but I keep forgetting that we need to do that, so it keeps taking me by surprise when single-clicking doesn't do anything. We'll have to be very clear when we communicate changes to the coders!

Notes:

  • pasting a signtype module into a new sign will overwrite any existing signtype info in that sign-- should we warn the user about this?
  • Currently the only way to access the right-click menu is to click on one of the module rectangles or ellipses. I'd like to eventually set it up so that you could also right-click anywhere in the sign summary (eg blank background space) to access the paste option (but not copy or delete). Does this make sense to you or would you prefer a different way to interact with the menus?
kvesik commented 1 week ago

@kchall here is a summary of module copy-paste behaviour when there are linked modules (eg, movement or location with associated relation). Sorry it's a bit messy/small. The full column titles are:

Please let me know if any of this doesn't seem logical to you.

20241105 copy-paste module behaviour

Also fyi there are a few issues with copy/pasting signs that I've noticed as I'm working on modules.

I implemented the check for mismatched x-slots (from your comments above). If the user chooses to proceed, all pasted modules have their timing set to "whole sign" in the background. Questions:

And finally, with respect to menu access when right-clicking on the background instead of specifically on a module button:

One more note from 20241108 meeting:

kchall commented 1 day ago

@kvesik Just confirming that the summary behaviour all makes sense to me. Thanks!