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

Integrate URLCheck within text selection context menu #191

Open
3 tasks done
pressRtowin opened this issue Feb 24, 2023 · 13 comments
Open
3 tasks done

Integrate URLCheck within text selection context menu #191

pressRtowin opened this issue Feb 24, 2023 · 13 comments
Labels
enhancement New feature or request

Comments

@pressRtowin
Copy link

pressRtowin commented Feb 24, 2023

Describe a related problem (optional)

No response

Describe your suggested feature

Continuing the theme of "quicker/easier ways to summon URLCheck", this would allow skipping the Share or Open dialogs (which both introduce a small delay as well) entirely and going straight to URLCheck from selected links.

OpenLinkWith appears to implement this in two ways. I'm not sure what exactly determines which method is used, but selecting a URL in a text box within the browser yields this:
Screenshot_20230223_180922_Samsung Internet
which when tapped on, yields this:
Screenshot_20230223_180942_Open Link With

On the other hand. Selecting the URL within the URL bar gives a slightly different option:
Screenshot_20230223_181159_Samsung Internet
but tapping on it brings you to the same menu. I'm not sure why two different texts are used here, or if that's relevant to implementing this in any way, but I thought I'd include it for completion.

Describe alternatives you've considered for your suggested feature

No response

Other details

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@pressRtowin pressRtowin added the enhancement New feature or request label Feb 24, 2023
@PabloOQ
Copy link
Collaborator

PabloOQ commented Feb 24, 2023

To add to this, a button/module that is only shown when accesed this way, this button would replace said URL.

@pressRtowin
Copy link
Author

What do you mean by replace?

@TrianguloY
Copy link
Owner

When you use the shortcut to open the selected text, the app knows if the text comes from an editable view or not. And if it is editable, you can change it.

I guess what Pablo is suggesting is to add a module that will be shown only when opening this way from an editable text, with a button to replace the content and go back to the app.

The user steps would be:

  • select any url on an editable text
  • press the edit option to open URLCheck
  • modify the url as desired
  • press the new module "apply" (or whatever) button
  • URLCheck closes and the selected url is now automatically replaced with the new one

@Ilithy
Copy link
Collaborator

Ilithy commented Feb 24, 2023

Hi,
If I may, I think @pressRtowin is asking if it was possible to copy the behavior of "openlinkwith" to a point, implement an option that directly adds URLCheck to the floating text selection menu, so that it calls URLCheck directly, or maybe to call the second floating menu for selecting applications, contacts etc...

@pressRtowin
Copy link
Author

Ah I see. A module to re-enter the URLCheck modified URL into an editable field was not what I was originally getting at, but would be a nice addition. Although this adds yet another "end action" to the open/share cluster. 😅

But yes, as @Ilithy said, my original idea was just to have URLCheck in its current form able to open URLs directly from selected text.

@pressRtowin
Copy link
Author

The "Apply" feature would definitely eliminate a lot of repetitive copy/pasting from my life, such as when sending links to friends within blocks of text where it wasn't convenient to use the "Share" function directly.

@TrianguloY
Copy link
Owner

Just to confirm: if you select an url, the first button in the small popup should open the first available app that can handle it. If URLCheck is configured as a default browser it will most probably be the one. On android 12 that first button has the app icon and name of the app, on Android 13 it just says "open" (thanks google).
In any case a dedicated option to ensure it is opened is not a bad idea, even if the share menu is also available.

@pressRtowin
Copy link
Author

Just to confirm: if you select an url, the first button in the small popup should open the first available app that can handle it. If URLCheck is configured as a default browser it will most probably be the one. On android 12 that first button has the app icon and name of the app, on Android 13 it just says "open" (thanks google). In any case a dedicated option to ensure it is opened is not a bad idea, even if the share menu is also available.

Also for people like me who avoid setting any defaults when possible 🙂

@pressRtowin
Copy link
Author

Also, any clue how the order of that menu is determined and if URLCheck has any control over it? It's clearly not alphabetical.

@Ilithy
Copy link
Collaborator

Ilithy commented Feb 24, 2023

Just to confirm: if you select an url, the first button in the small popup should open the first available app that can handle it. If URLCheck is configured as a default browser it will most probably be the one. On android 12 that first button has the app icon and name of the app, on Android 13 it just says "open" (thanks google).

Unfortunately some applications modify this behavior, by modifying this floating menu, removing the direct opening function for example (as it does on my phone Vanadium for example, which removes this button to open "directly", it sulks not to be the default browser)

Maybe this could help: https://medium.com/androiddevelopers/custom-text-selection-actions-with-action-process-text-191f792d2999

@pressRtowin
Copy link
Author

Interesting that they say this in that documentation:

Q: Can I trigger it only for certain types of text?

A: Nope. Your option will appear every time anyone selects text. Of course, chances are users won’t select an option to ‘Translate’ unless they want to translate, etc., but I’d be careful to code defensively as you cannot be sure what type of text context you’ll receive.

But I'm definitely seeing a different set of options when I open the menu from the URL bar vs from a standard text field. So there must be some way to control where/when it appears.

@KorigamiK
Copy link

Yup great feature, upvote

@TrianguloY
Copy link
Owner

I added a first support to open text from the long tap menu (doesn't always work, still not sure why, probably apps can disable this?)

This version also comes with a sync feature (can be disabled) that will automatically replace the selected text with the edited url. There is no new module for now, this was a first implementation to see if this is something useful or not, I'll keep this issue open for review and maybe add an actual module in the future if needed.

So, now, you can do this:

  • Long tap a url in an editable input (for example in a message box on a social media app)
  • Press the URLCheck entry that hopefully should appear
  • Edit the url using the modules or manually
  • Close the app (no need to open the url, just clicking outside the popup is enough)
  • The url will be replaced with the edited one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants