mosaic
mosaic copied to clipboard
Square brakets sometimes take a long time to turn into pointers
From Allison:
Happening again while typing in Answer Candidate on https://mosaic.ought.org/w/8016?e=efcded60-7f33-41f3-9d88-8e1ae677e017 It may be happening when pointers are nested in each other? 30 minutes and still not turning into pointers
(source: https://app.intercom.io/a/apps/gmkvd6s1/inbox/inbox/conversation/23460628738)
Ah, the problem was that there weren't as many opening square brackets as closing ones (see screenshot) (h/t Zachary).
Maybe there should be an error message in that case?
I don't want error messages popping up while I'm in the process of making a pointer; the simplest fix might be just to highlight unmatched brackets in red? You could also have a "compile" button; and return an error message if someone tries to compile their answer with unmatched brackets.
TBC, I would propose the error message just be a red text above the textbox; most definitely not a pop-up. It could appear just if you change the focus to outside of the textbox.
[We can't [know which brackets is missing]. For example, is the last one closing the first or the last in this paragraph? Although maybe we could make some reasonable assumptions.
A 'Compile' button would be one more click; I think fewer clicks would be better:)
We've talked before about doing something like rainbow brackets: https://plugins.jetbrains.com/plugin/10080-rainbow-brackets
as @Mati-Roy pointed out, we can't know which bracket is missing or extra -- rainbow brackets are the best tool I've seen to help someone easily figure out which is missing or extra
Rainbow brackets could also address https://github.com/oughtinc/mosaic/issues/731
Konrad also proposed the rainbow feature