-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
feat: spellcheck for text strokes #1269
base: main
Are you sure you want to change the base?
Conversation
If the option to lock spellchecking is not out of scope, the UI could look something like this. Questions about how to implement it, and maybe more importantly, how to avoid this being a footgun for users, remain. The digital dictionaries I've used in the past just played a fairly loud sound when unlocking the options again. That's not really an option here. @LeSnake04 do you have any ideas on how to implement this? Admin passwords (which you suggested in your comment) seem like a big footgun to me - they're either ineffective, or can lock users out of this feature forever until they e.g. delete the app settings. EDIT: I thought about it for a while, and I have an idea that doesn't require passwords. Locking and unlocking would be possible at all times, but a random number would be displayed in the UI that changes whenever you (re-)lock the spellcheck. That way, teachers can assert that the spellcheck was kept locked at all times by writing down and later comparing the random number. And it's not a footgun for regular users/people who tend to forget passwords. If anyone is affected by this, it would be nice to know if this would pass the requirements of your institution. |
77fe6ab
to
96dce63
Compare
I think that there are mainly two options for displaying spellcheck corrections.
Proof of concept for the first option: spellcheck_corrections.mp4The "blinking button" is quite distracting IMO, maybe the sensitivity should always be enabled. Instead of making the button insensitive if there are no suggestions, we could add a hint telling users to move the cursor over a erroneous word. |
More fleshed out version without the button sensitivity changing; I personally like this a lot more. corrections.mp4 |
I wonder if the requirement of not having spellcheck could be done with a compile feature flag |
That would definitely solve it, but this requirement seems to be quite common, so I think we should try our best to make it accessible. The feature flag might still be a good idea for the CLI though, it probably shouldn't depend on enchant and its dependencies. But I'm not sure if it's worth the "bad" code (every single EngineView creation would need that attribute - maybe we should turn those into macros 😄). In addition to that, the CLI also depends on ALSA/audio libraries, as the pen sounds feature isn't optional either (not really an excuse here though). |
4b1ef0c
to
b83d430
Compare
Implements spellcheck for typewriter strokes using the enchant library that wraps around many spellchecking libraries (Hunspell, Aspell, AppleSpell, ...). It is also used by
libspelling
, the official GTK4 spellchecking library. Switching to a different library (like zspell) should be fairly simple.The
enchant
crate for Rust is unfortunately not as good aslibspelling
's (official) bindings.TODO
Things to Discuss
icu
are added to the dependencies, namelyicu_locale
andicu_experimental
. They're used to convert the IETF region tags to display names.icu
as a whole seems quite useful though (for formatting lists, etc.), so we could consider adding the entire meta-crate instead. Either way, the two crates have a lot of dependencies themselves. I couldn't find many alternatives though, apart fromlcid
.