owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.76k stars 3.09k forks source link

[FEATURE REQUEST] Open and create .url shortcut files #4420

Closed Aitorbp closed 2 weeks ago

Aitorbp commented 3 weeks ago

Related Issues

App: https://github.com/owncloud/android/issues/4413


QA

Test plan: https://github.com/owncloud/QA/blob/master/Mobile/Android/Executions/Release_4.3/Shortcuts.md

Reports and improvements:

jesmrec commented 2 weeks ago

(1) [FIXED]

This is our current implementation together with iOS and web:

Android iOS Web
Screenshot 2024-06-14 at 12 39 14 Screenshot 2024-06-14 at 12 36 03 Screenshot 2024-06-14 at 12 36 25

Pixel 2, Android11 87d3a1d2

jesmrec commented 2 weeks ago

(2) [IMPROVEMENT] [DONE]

As improvement, i'd be cool to have the file name like in web:

Screenshot 2024-06-14 at 12 44 57

the .url at the end makes clear that the file name is the requested field, and the extension must not be typed by the user.

Pixel 2, Android11 87d3a1d2

jesmrec commented 2 weeks ago

(3) [FIXED]

Tiny detail for long names:

error message is: File name must not be longer than 223 characters

By typing exactly 223 characters, the message is there. It shouldn't or changing the value to 222

Pixel 2, Android11 87d3a1d2

jesmrec commented 2 weeks ago

(4) [FIXED]

About this comment:

I format it by default with http because if the websites do not support https, the websites will say: The site can't be reached. For example this one: http://www.edu4java.com/es/web/web30.html.
On the contrary, if we write a website with http, but it supports https, it will redirect us directly to https.

but, what happens if it supports http and not https? you'll get the error as well. You can check this with a basic oC10 server. The fact of supporting http, https or both is a matter of the hosting server, each one has its own setup and we can not assume an specific behaviour based in only one example.

Both web and iOS use https as default. I'd go for this.

Pixel 2, Android11 87d3a1d2

jesmrec commented 2 weeks ago

(5) [FIXED]

Create a shortcut and submit it

Current:

In the uploads view, the entry does not have a proper icon:

Screenshot 2024-06-14 at 13 51 09

Expected:

Could be used the same icon as in the list of files?

Pixel 2, Android11 87d3a1d2

jesmrec commented 2 weeks ago

(6) [FIXED]

I'm not pretty sure to ellipsize the URL when it is very long. The URL to open is sensible information that is hidden to the user. Let me know if i'm wrong, but it is being ellipsized if the length is longer than 1 line. That means, almost every URL that points to a subfolder/subdomain is going to be ellipsized.

I'd remove that, or expand to a longer size

Pixel 2, Android11 87d3a1d2

Aitorbp commented 2 weeks ago

(6)

I'm not pretty sure to ellipsize the URL when it is very long. The URL to open is sensible information that is hidden to the user. Let me know if i'm wrong, but it is being ellipsized if the length is longer than 1 line. That means, almost every URL that points to a subfolder/subdomain is going to be ellipsized.

I'd remove that, or expand to a longer size

Pixel 2, Android11 87d3a1d2

Regarding the ellipsize of the URL when it is very long, the following occurs: if we want to put a maximum of three lines and set a truncated ellipsize in the middle, it will not work. Android does not have this functionality automatically, it would have to be programmed. Therefore the following options are considered:

@jesmrec @JuancaG05

JuancaG05 commented 2 weeks ago
  • Set a HorizontalScrollLayout so that it scrolls if the text exceeds the maximum of one line. With this component it only detects one line, I understand that it could also be done programmatically so that it detects more lines.

I would discard this option directly. A scroll in a dialog is no good practice.

  • The last option would be to leave it as iOS has it, without any type of restriction and that the URL occupies all it needs.

This is not a good option for me. What if the URL is so so long (not strange case currently) that the dialog gets too big and we cannot see its buttons? We need to set a limit somewhere

Why is it that you can ellipsize at the end a text of more than 1 line but not in the middle?

jesmrec commented 2 weeks ago

This is not a good option for me. What if the URL is so so long (not strange case currently) that the dialog gets too big and we cannot see its buttons? We need to set a limit somewhere

Does not the dialog (including the buttons) expand? i mean, if the text is too long, the buttons are on the bottom in the same way, just the central is expanded.

JuancaG05 commented 2 weeks ago

Does not the dialog (including the buttons) expand? i mean, if the text is too long, the buttons are on the bottom in the same way, just the central is expanded.

Yes, the center will expand, but... what if it expands so much that the buttons get out of the screen?

Aitorbp commented 2 weeks ago

To sum up, to align with iOS behavior, we're going to leave the url unrestricted to the maximum number of lines, but add a scrollview so that when the text takes up more space than the screen, the url element will scroll.

Aitorbp commented 2 weeks ago

All reports are ready to be tested again @jesmrec

jesmrec commented 2 weeks ago

everything is fixed. Now, i will face a 2nd QA round.

jesmrec commented 2 weeks ago

(7) [FIXED]

Minor change

Typing a URL with blanks, the error The URL cannot contain spaces is displayed.

This is correct, but i'd use blanks instead of spaces, since "spaces" has a different meaning... it may lead to confusion

Aitorbp commented 2 weeks ago

Changed report (7), ready to test @jesmrec

jesmrec commented 2 weeks ago

Related https://github.com/owncloud/web/issues/11063

I noticed that the shorcuts created in the web client (oCIS) are not open in mobile clients if they lack of protocol prefix. If i'm not wrong, the current approach in Android app is adding the default protocol prefix (https) when the shortcut is open (not in creation), right @Aitorbp ?

So, we have two options here:

which one do you like the most?

Aitorbp commented 2 weeks ago

Related owncloud/web#11063

I noticed that the shorcuts created in the web client (oCIS) are not open in mobile clients if they lack of protocol prefix. If i'm not wrong, the current approach in Android app is adding the default protocol prefix (https) when the shortcut is open (not in creation), right @Aitorbp ?

So, we have two options here:

  • Getting the current approach as correct for the moment and going ahead. If the prefix default protocol should be added in creation phase as before, it could be changed in a new PR
  • Wait till a solution across the clients is agreed in the web issue mentioned above.

which one do you like the most?

Right we add the default protocol prefix when the shortcut is open. In my opinion, I would go for the current approach, even if the web were to set the protocol, the application would not be affected.

jesmrec commented 2 weeks ago

https://github.com/owncloud/web/issues/11063#issuecomment-2178859637

Aitorbp commented 2 weeks ago

Added back the protocol in shortcut creation.

jesmrec commented 2 weeks ago

That's fixed, now adding the protocol in both creation and opening.

jesmrec commented 2 weeks ago

Approved, ready to go! 💯