TrianguloY / UrlChecker

Android app by TrianguloY: URLCheck
Other
910 stars 53 forks source link

Collapse input text module when the text is too big #388

Open Rigerhit047 opened 3 days ago

Rigerhit047 commented 3 days ago

Describe a related problem (optional)

I have been forced to put the input text module on the drawer, since when there is too much text on the link (like with an auth link, a redirection or a link with preferences) it will take all of the URLChecker window or a big part of it, depending on the URL size, therefore making it unsuitable to have it as a non-collapsable module, since it will make the experience worse having to scroll down a lot if it is in the top which is also its default position.

ResizedImage_2024-10-08_20-28-33_2151

Describe your suggested feature

It should collapse after reaching a certain amount of characters, so that it doesn't take all of the screen or a big part of it, since it is not normally needed to see all of the link, and if you want to see it, the user would just tap it to view it in full, or use the Uri parts module.

So if a link has a certain amount of characters, it should collapse it until you enter edit mode. Like this: ResizedImage_2024-10-08_20-37-22_1701

Describe alternatives you've considered for your suggested feature

Other options would be to only collpase the link if it would take a set % of screen size, or when it has taken a certain amount of lines. Maybe introduced by the user itself if it is not easy to calculate.

There is also the minimalist route of just showing the domain highlighted and some paths like a PC browser, and show the rest of the link if you enter edit mode, although I do not know if that idea would be liked, but it would certainly make the input text more clean to look at and not hinder the rest of the modules.

Other details

No response

Acknowledgements

TrianguloY commented 3 days ago

It's made like that on purpose, because I consider that a long link should be reviewed before accessing it, even if it requires some scrolling.

But I can understand why it's not desired, and it should be easy to allow the user to configure a maximum number of lines to show for example (even if by default it will show all).

In edit mode though I think it would be best to show it in full, although having it in a smaller scrollable list could also be a solution (however a scrollable list inside another scrollable list may have some issues in some cases).

If you could edit the application code to be exactly like you want (no settings required) how would you do it?

PabloOQ commented 2 days ago

Some ideas I have thought of:

Rigerhit047 commented 2 days ago

I agree that a long link should be reviewed, the problem is when you come across long links regularly, highlighting the possible case of links with preferences or redirections appended to them that a user comes across daily. I do agree with PabloOQ's ideas, but I would do it a bit differently:

And I would give it priority based on the order they are in, so that would make the non-ASCII and HTTP pattern have priority over the rest by default, another option is that instead of coloring the whole section, it would display an underline instead, that way there can be multiple underlines for each pattern so they are all visible, that could look a bit weird, though and that is probably not easy to implement either.

Even if the module doesn't turn color-coded, it would be useful to have it act like that. That way, it would make sense to the input text to be scrollable if it is in a text box, it would be easy to exit edit view. You cannot exit edit view currently without hidding the module with the banner or if the link changes when checking its status, unshortening it, or using the history module.

With those changes, the input text module would look clean with colors (or just with the gray and black/white) and be informative, will be able to view and manipulate the link without issues, and would allow the user to be able to customize the app further, if there are actually user variables for colors and text limits or at least for screen sizes.

TrianguloY commented 1 day ago

so many ideas 😵

I think for now it's best to start simple and just have the option to limit the number of displayed lines. Since a scrollable 'inside-view' seems to be mentioned a lot, that would probably be the best setup, both in normal and edit mode.

I really like the 'use color instead of bold for the domain' (or even better: both) because with the new 'visual' mode in the edit module the text is less saturated. I'll probably try to implement this...sometime.

As for using color in the visual module, even if that seems useful (and I'm sure it is) I would like to keep modules independent (as much as possible). In fact when I developed the pattern module for the first time, I tried to make it so that the 'invalid characters' pattern would show those invalid characters in the url. But the code to maintain inter-module communication is hard and becomes a mess pretty fast, so as I said I would like to avoid that if possible. Having a separate configuration in the text module just to highlight regex patterns with colors may be a nice idea though. It's true that you will need to 'duplicate' some patterns, but that would be far easier to implement (In fact it could be really easy...I need to think about it).

Anyway, that you so much for your opinion and ideas! Most probably I won't be able to implement most of them, sorry, but still they are interesting to think about, and I may add some of the easy ones. (also, as usual, prs are welcomed! but please try to keep them short :)