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

Introduce the Spell checker for simplicity, extensibility and support for Android, iOS, macOS, and Windows #2246

Open
EchoEllet opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function notice This is a notice or information that may be important for users to be aware of.

Comments

@EchoEllet
Copy link
Collaborator

EchoEllet commented Sep 19, 2024

We plan on introducing a breaking change for SpellCheckerService (from flutter_quill) and using the Flutter SpellCheckerService or extending it instead of having our own custom SpellCheckerService which we discovered that it has some issues:

  • Extensibility: The interface should be more generic and less specific to client-side spell-checking service, it should be focused as a source of checking the spelling itself and not specific to Flutter TextSpan or having some methods such as dispose, setNewLanguageState, updateCustomLanguageIfExist, addCustomLanguage, those methods seem to be helpers for managing a client-side service that is on the app itself, the user may want to use a web API that provides this service (e.g., Grammarly API) or use method channel, it's also not a Future which is expected to be by the user. The service itself should not be responsible for customizing the UI. Take a look at TextField to see how it's done in Flutter (See SpellCheckConfiguration). The service will be activated in the QuillEditorConfiguration instead of having the SpellCheckerServiceProvider.

  • Bundle size: We have introduced a package that has supports for too many languages all at once, we initially wanted to separate each language into its package but this would complicate the process and require more effort when using the package since the user needs the core package and a package for each language which is a common solution is used by VS Code and JetBrains IDEs, in general even when using one language (English) it still increase the bundle size quite significantly, which require us to make this feature completely optional, having our own package that integrates with flutter_quill, the project is currently in the process of changes more frequently than before and there are priorities, we need to fix existing issues before introducing something that leads to more issue reports. Usually, this is a bigger issue on the web.

  • Web Support: Currently experiencing issues on some platforms, so we probably want to make it experimental. See (Failed assertion: line 1394 pos 12: 'container.containsOffset(position.offset)' after link editing  #2196)

  • Not using the native API as default: This will be fixed with platform-specific API using quill_native_bridge (or at least attempt to). We do plan on supporting it on:

    Android: Using android.view.textservice.TextServicesManager
    iOS: Using UITextChecker
    macOS: Using NSSpellChecker. Not supported using Flutter DefaultServiceSpellChecker, needs custom implementation.
    Windows: Using ISpellChecker2 Win32 API. Not supported using Flutter DefaultServiceSpellChecker, needs custom implementation.

Not that we currently already have plans to work on other areas of the project so it will take a bit longer before we move to fix this issue, creating this issue since we're having discussions from different threads (#2164, #2142, #2230).

@EchoEllet EchoEllet added enhancement New feature or request notice This is a notice or information that may be important for users to be aware of. labels Sep 19, 2024
@EchoEllet EchoEllet self-assigned this Sep 19, 2024
@EchoEllet EchoEllet added the minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function label Sep 22, 2024
@kingrupam

This comment was marked as off-topic.

@EchoEllet EchoEllet changed the title Rewrite the SpellCheckerService for simplicity and extensibility and support for Android, iOS and macOS Introduce the Spell checker for simplicity, extensibility and support for Android, iOS, macOS, and Windows Dec 3, 2024
@EchoEllet
Copy link
Collaborator Author

It seems that Windows supports this feature (Win32 Spell Checking API). See ISpellChecker2 in win32 package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function notice This is a notice or information that may be important for users to be aware of.
Projects
None yet
Development

No branches or pull requests

2 participants