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

Warn people about saving texts outside of protocol #1674

Open
annamorphism opened this issue Oct 21, 2024 · 13 comments
Open

Warn people about saving texts outside of protocol #1674

annamorphism opened this issue Oct 21, 2024 · 13 comments

Comments

@annamorphism
Copy link

Slight problem created by the solution of #1417 is that chants with asterisks don't save. These are used to indicate incipits, so we want them to be valid. (Noticed while trying to change something unrelated on a previously-published chant with an asterisk!)

@annamorphism
Copy link
Author

Square brackets turn out to have the same problem (these are used for incomplete texts in the standardized spelling field).

@annamorphism annamorphism changed the title asterisk treated as invalid character asterisk and square brackets treated as invalid characters Oct 21, 2024
@annamorphism
Copy link
Author

actually this bug is preventing a lot of editing and proofreading on extant entries. giving it a high priority label.

@dchiller
Copy link
Contributor

dchiller commented Oct 22, 2024

Temporarily turning off text validation in #1677 until this can be better addressed.

The asterisk thing makes sense -- it was an oversight because the syllabification validation follows the full text protocols, where asterisks aren't allowed [edited: they were always allowed 🤦]. But since now incipits are just drawn from the full text fields, they should be allowed! So definitely we need to change the validation for that!

As I wrote in an email re: square brackets:

For square brackets, these will be allowed if they are entered according to the text entry protocols. So my guess is someone is trying to enter them "incorrectly" — probably because some convention is being/has been developed that has not made it to the protocols? If you have an example we can pinpoint.

dchiller added a commit to dchiller/CantusDB that referenced this issue Oct 22, 2024
dchiller added a commit to dchiller/CantusDB that referenced this issue Oct 22, 2024
@annamorphism
Copy link
Author

I was making a change to the image link on an already published chant (https://cantusdatabase.org/chant/693728) and not touching the text field.

I didn't have the forethought to get a screen shot the error message, but I do remember it was a closing bracket, so it's one or the other of these:
Screenshot 2024-10-22 at 9 52 43 AM
Screenshot 2024-10-22 at 9 55 09 AM

@dchiller
Copy link
Contributor

So I guess first: is this a valid text entry? imho no.

Second, I was chatting with @lucasmarchd01 just now and the situation in which you encountered this -- there's already a bad text, you go in to change another field, should you be forced to fix the text before we allow you to save? -- came up. Instead, Lucas suggested that maybe we just show a warning, but still let you save what you came to the chant to edit.

@annamorphism
Copy link
Author

This text seems valid to me? If not there are a lot of other texts like it...

I like @lucasmarchd01 idea to flag previously existing stuff. The reason we made this was originally to prevent stuff that would break on saving, not to flag other possibly-problematic things.

@dchiller
Copy link
Contributor

This text seems valid to me? If not there are a lot of other texts like it...

That may be...as I say it could be that this is an unrecorded convention. So what's in the square brackets is text that is illegible in the source or missing from the source but that is interpolated based on a standard chant text? Basically equivalent to the curly braces in the source spelling field?

I'll modify the syllabifier to accord with whatever it is.

The reason we made this

Oops. Not totally sure what the "this" is here? Made what? The aforementioned use of square brackets?

@dchiller
Copy link
Contributor

as I say it could be that this is an unrecorded convention.

So, it looks like (and this is ringing a bell now but I can't find documentation of where this was previously discussed) square brackets are allowed in that field according to the fragment entry protocols but not the text entry protocols.

@dchiller
Copy link
Contributor

So what's in the square brackets is text that is illegible in the source or missing from the source but that is interpolated based on a standard chant text? Basically equivalent to the curly braces in the source spelling field?

Email from Debra confirms this, so I made DDMAL/volpiano-display-utilities#54 to implement the fix!

@dchiller
Copy link
Contributor

Opened #1681 for a more permanent fix to the validation error point.

@annamorphism
Copy link
Author

Oops. Not totally sure what the "this" is here? Made what? The aforementioned use of square brackets?

I meant, the problem originally being solved was to prevent people from creating unfixable chants by mistake. Square brackets and asterisks etc might be incorrectly used, but they don't create weird pathological objects when they are--so it's maybe not necessary to prevent people from using them incorrectly.

@dchiller
Copy link
Contributor

I meant, the problem originally being solved was to prevent people from creating unfixable chants by mistake.

I see, thanks for the clarification. I think this is one problem and definitely the most urgent one.

I created #1312 a while back though too, and I think generally we shouldn't let people create bad chant texts. My assumption (perhaps incorrect) is that when people enter bad texts they aren't doing it maliciously or because the protocols can't handle the specific case, but because of unintentional mistakes (legitimately forgetting to close a bracket, for example) and so the validation can serve as a kind of "spell check". Perhaps not letting someone save a text is a bridge too far (what if they are just putting in a placeholder and will come back to correct?); in that case, maybe a pop-up that says "we've detected X in your chant text, which may cause syllabification and alignment problems/doesn't conform to the expected format. Are you sure you want to save?"

@annamorphism
Copy link
Author

Right, I think we're in agreement.

@dchiller dchiller changed the title asterisk and square brackets treated as invalid characters Warn people about saving texts outside of protocol Oct 25, 2024
@dchiller dchiller removed bug Something isn't working priority: high labels Oct 25, 2024
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

No branches or pull requests

2 participants