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

[Desktop] Error when using selection shortcut on Mac #1192

Closed
Andre-lbc opened this issue Apr 26, 2023 · 15 comments · Fixed by #2279
Closed

[Desktop] Error when using selection shortcut on Mac #1192

Andre-lbc opened this issue Apr 26, 2023 · 15 comments · Fixed by #2279
Assignees
Labels
bug Something isn't working in progress This issue or feature is currently being worked on by someone. macOS Issues or feature requests specific to the macOS platform. moderate Issues that are important for improving functionality or user experience. reproducible This bug has been confirmed and can be reliably reproduced.

Comments

@Andre-lbc
Copy link

Hello,
I'm getting the following 2 errors when using command + shift + arrow shortcuts on MacOS:

Error 1:
Unable to find an action for an Intent with type ExpandSelectionToDocumentBoundaryIntent in an Actions widget in the given context.
Triggered by command + shift + arrow up and command + shift + arrow down (Platform shortcut for moving selection from current position to start or end of text)

Error 2:
Unable to find an action for an Intent with type ExpandSelectionToLineBreakIntent in an Actions widget in the given context.
Triggered by command + shift + arrow right and command + shift + arrow left (Platform shortcut for moving selection from current position to start of end of line.)

@hezhong0711
Copy link

+1 facing the same problem

@EchoEllet EchoEllet added the bug Something isn't working label Nov 15, 2023
@tolotrasamuel
Copy link

Any update on this ? It's been about 1 year

@CatHood0
Copy link
Collaborator

@Andre-lbc does this issue still persists?

@EchoEllet EchoEllet added the macOS Issues or feature requests specific to the macOS platform. label Sep 22, 2024
@EchoEllet
Copy link
Collaborator

does this issue still persists?

#1937 Fixed a similar issue on macOS. I remember it was an issue on Linux too.

@Andre-lbc
Copy link
Author

Sorry, I just saw this, I'll check it out and get back to you tomorrow.

@Andre-lbc
Copy link
Author

Hi, I can confirm that I can still reproduce these errors with the latest stable version available to me (flutter_quill: 10.7.5)

Console logs:

════════ Exception caught by services library ══════════════════════════════════
Unable to find an action for an Intent with type ExpandSelectionToLineBreakIntent in an Actions widget in the given context.
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════
Unable to find an action for an Intent with type ExpandSelectionToLineBreakIntent in an Actions widget in the given context.
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════
Unable to find an action for an Intent with type ExpandSelectionToDocumentBoundaryIntent in an Actions widget in the given context.
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════
Unable to find an action for an Intent with type ExpandSelectionToDocumentBoundaryIntent in an Actions widget in the given context.
════════════════════════════════════════════════════════════════════════════════

@EchoEllet
Copy link
Collaborator

Thank you for the input, I was indicating that there was a similar issue (unimplemented intent action) that's also on macOS that's fixed, will fix this issue in a similar way as soon as we can.

@EchoEllet EchoEllet added minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function reproducible This bug has been confirmed and can be reliably reproduced. labels Sep 24, 2024
@EchoEllet EchoEllet self-assigned this Sep 24, 2024
@EchoEllet EchoEllet added the in progress This issue or feature is currently being worked on by someone. label Sep 24, 2024
@EchoEllet
Copy link
Collaborator

EchoEllet commented Sep 24, 2024

The following intents are both missing and need actions that implement them:

This is similar to #1937.

@EchoEllet
Copy link
Collaborator

It seems that ExtendSelectionToNextParagraphBoundaryOrCaretLocationIntent is also not implemented:

The following assertion was thrown during method call TextInputClient.performSelectors:
Unable to find an action for an Intent with type ExtendSelectionToNextParagraphBoundaryOrCaretLocationIntent in an Actions widget in the given context.

Unable to find an action for an Intent with type ExtendSelectionToNextParagraphBoundaryOrCaretLocationIntent in an Actions widget in the given context.

@EchoEllet
Copy link
Collaborator

Fixed in #2279.

Screen.Recording.2024-09-25.at.3.13.22.AM.mov

Will need more time to complete the bug fix, also notice some other related bugs, undocumented actions/intents, inconsistency with the naming, missing tests, some other intents to be implemented, code duplication to achieve a task, and common functionalities being duplicated all over the source code.

Which is why more time needed before releasing an incomplete bug fix.

For now, you can test and see if the issue exist on the branch of #2279:

$ git clone --depth 1 --branch fix/1192 https://github.com/singerdmx/flutter-quill.git
$ (cd example/macos && pod update OrderedSet && pod install --repo-update)
$ (cd example && flutter run -d macos)

@EchoEllet
Copy link
Collaborator

It looks like the new version of flutter_inappwebview is causing build issues on macOS as well:

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0008192914A1801E, name:My Mac }
{ platform:macOS, arch:x86_64, id:00006000-0008192914A1801E, name:My Mac }
~/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.1.0/macos/Classes/InAppWebView/InAppWebView.swift:870:26: error: method does not override any method from its superclass
    public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {
                         ^
    open func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, (any Error)?) -> Void)? = nil)
              ^
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

See related issue #2280.

@EchoEllet
Copy link
Collaborator

EchoEllet commented Oct 23, 2024

@Andre-lbc Can you confirm if this issue is fixed with 10.8.5?

@Andre-lbc
Copy link
Author

Hello @EchoEllet,
Thanks!

Just upgraded to 10.8.5 and ran it on macOS:

command + shift + arrow up and command + shift + arrow down no longer throw exceptions and are showing the expected behavior.

command + shift + arrow left and command + shift + arrow right no longer throw exceptions, but are showing slightly different behavior than their native counterpart: they now expand the selection to the end/beginning of the paragraph, whereas on native they expand until the end/beginning of the line.

@EchoEllet
Copy link
Collaborator

no longer throw exceptions, but are showing slightly different behavior than their native counterpart: they now expand the selection to the end/beginning of the paragraph, whereas on native they expand until the end/beginning of the line.

I'm unsure about the expected native behavior on macOS though the current behavior does what you described, see ExpandSelectionToLineBreakAction.

Can you share an example video of a macOS app that implements this shortcut as expected?

@Andre-lbc
Copy link
Author

Of course, here are some examples:

Native app (Apple Notes)
Screen.Recording.2024-10-24.at.10.10.43.mov
Electron app (Notion)
Screen.Recording.2024-10-24.at.10.18.10.mov
Flutter app + flutter-quill
Screen.Recording.2024-10-24.at.10.12.07.mov

I think this is not dependent on the application level implementation, as all third-party apps I have used so far support this (Firefox, Chrome, Visual Studio Code, Notion, Word, Excel, OneNote, Android Studio, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue or feature is currently being worked on by someone. macOS Issues or feature requests specific to the macOS platform. moderate Issues that are important for improving functionality or user experience. reproducible This bug has been confirmed and can be reliably reproduced.
Projects
None yet
5 participants