Improve link text selection

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
jumba

Improve link text selection

Unread post by jumba » 2015-08-29, 12:48

When performing a link drag operation, the whole link is dragged. For my own workflow this is not what I want to do. I don't recall when I would have needed to drag whole links, but many times I need to select the text of the link or part of it.

My suggestion is to change the behavior so that the text of the link is selected by default instead of dragging the whole link. Then the whole links could be dragged the same way as with dragging normal text: select the text of the link and then drag it. Or by using a modifier key (like the ALT-key now for text selection) to toggle the drag behavior.

But I think I'm missing something important why the default behavior is what it is? Maybe a preference could be added to control the behavior.

On bugzilla I found this related bug: bug #378775

It is about implementing the same behavior that was in the old Opera which was a compromise between the two operations:
vertical drag = drag whole link
horizontal drag = select text of the link

I think this is too complicated and causes confusion.

Safaris text selection was also described in this comment (it is not used for links):
https://bugzilla.mozilla.org/show_bug.cgi?id=378775#c10
if you hold down the mouse button over a text selection and drag right away, it will start a new text selection; if you hold down the button and wait a bit, it will drag the selection.
Last edited by jumba on 2015-08-29, 16:50, edited 2 times in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Select link text by default

Unread post by Moonchild » 2015-08-29, 13:04

jumba wrote:My suggestion is to change the behavior so that the text of the link is selected by default instead of dragging the whole link.
It's not that simple -- many links don't have selectable text.
jumba wrote:I think this is too complicated and causes confusion.
What, exactly, causes confusion? I'm not sure what you mean with "this" here.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

jumba

Re: Select link text by default

Unread post by jumba » 2015-08-29, 13:14

Moonchild wrote:What, exactly, causes confusion? I'm not sure what you mean with "this" here.
The way how old opera handles the link dragging/ link text selection.

New Tobin Paradigm

Re: Select link text by default

Unread post by New Tobin Paradigm » 2015-08-29, 13:18

Pale Moon is not nor ever has been Opera.

jumba

Re: Select link text by default

Unread post by jumba » 2015-08-29, 13:50

Matt A Tobin wrote:Pale Moon is not nor ever has been Opera.
And? The old Opera isn't doing exactly as I'm suggesting. And I think even the Safari's way (if used for links) would be less confusing than the old Opera's way which is based on the direction of the drag operation. Those are just ideas how the link text selection could be improved.

But wouldn't it be better to just select the text of the links by default? Why is this not the default behavior for links?

SvenG

Re: Select link text by default

Unread post by SvenG » 2015-08-29, 14:19

jumba wrote:Why is this not the default behavior for links?
That's a good question, on Linux (at least on Ubuntu with Unity desktop) the behavior is totally borked cause there is no really suitable way to select the text inside a link (except for using an extension), at least none that I know of (Alt, Shift, Super, CTRL and all kinds of combinations thereof do nothing that would be of use). What is the purpose of dragging links at all (other than doing something that is accessible in various other ways)? Serious question, in more than 15 years of Internet use, I have never ever seen anybody dragging a link on purpose. So I really don't know.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Select link text by default

Unread post by Moonchild » 2015-08-29, 14:27

jumba wrote:But wouldn't it be better to just select the text of the links by default? Why is this not the default behavior for links?
Because it is a useful feature! I wouldn't want to remove this feature and replace it with plain text selection as if it was no link at all...

Want to open a new tab with the link? Drag the link to the tab bar.
Want to bookmark a link? Drag it to the bookmarks toolbar or (classic menu) bookmarks menu and drop it exactly where you want it.
Want to create a shortcut to a page? Drag the link to the desktop or any folder.
Want to paste a link address in a different application? Drag&drop!
etc.

Tobin, I'm not exactly dismissing the proposed "Opera-alike" feature here - I actually think it would be a good compromise, since there isn't an easy way to do this otherwise - the current Alt+drag option works but is probably rather clumsy on anything but a kb&mouse combination. I also don't think it would be confusing, but it needs a clear release note to inform users of this expected behavior.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Select link text by default

Unread post by ketmar » 2015-08-29, 14:30

there is Select like a Boss addon, which allows to both select text in link (moving your mouse horizontally), and to drag the link itself (moving your mouse vertically).

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Select link text by default

Unread post by Moonchild » 2015-08-29, 14:35

ketmar wrote:there is Select like a Boss addon, which allows to both select text in link (moving your mouse horizontally), and to drag the link itself (moving your mouse vertically).
This is the opera-alike behavior pointed out above ;)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

jumba

Re: Select link text by default

Unread post by jumba » 2015-08-29, 14:36

To list all the different ways:

Pale Moon:
to drag link: mouse down and move (normal way)
to select text of the link: ALT-key down and move (who knows this?) (might also conflict with window managers that use it to move windows)

Old Opera:
to drag link: drag vertically
to select text of the link: drag horizontally

Safari's way to select/drag text:
to drag text: hold down for a certain threshold
to select text of the link: normal way

My suggestion:
to drag link: perform the standard selection first and then doing the drag operation or using a modifier key
to select text of the link: normal way

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Select link text by default

Unread post by ketmar » 2015-08-29, 14:40

Off-topic:
Moonchild wrote:This is the opera-alike behavior pointed out above ;)
i know. ;-) i was trying to make a joke, sounding bot-like.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Select link text by default

Unread post by Moonchild » 2015-08-29, 14:51

Current method: not easily discoverable, so yes, that could be improved -- but it works once you know it!

Safari method: very unintuitive unless immediate visual feedback is given on the duration which is a PITA to implement and needlessly complicated, and will not allow one to perform the desired task immediately. I've never been a fan of that kind of (touchscreen- and single-button-mouse-focused) behavior in programs.
jumba wrote:My suggestion:
to drag link: perform the standard selection first and then doing the drag operation or using a modifier key
to select text of the link: normal way
No, sorry. Dragging a link should never require precise selection of the link text before dragging. If you're suggesting a partial selection would suffice: it won't, because then people won't be able to partially select a link text.
Modifier key? I'd rather not flip the behavior around.

EDIT: Also, even if you select the entire link and then drag... what is Pale Moon supposed to do? Lift the selected text (like it does now) or lift the underlying link?...

So as said, of the options implemented in other browsers to improve discoverability, the old Opera method is a good compromise, IMHO, to allow selection of text within a link while not destroying link-dragging usability.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

SvenG

Re: Select link text by default

Unread post by SvenG » 2015-08-29, 14:52

Moonchild wrote:Current method: not easily discoverable, so yes, that could be improved -- but it works once you know it!
But not on every OS.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Select link text by default

Unread post by Moonchild » 2015-08-29, 15:20

SvenG wrote:
Moonchild wrote:Current method: not easily discoverable, so yes, that could be improved -- but it works once you know it!
But not on every OS.
Only if the WM takes priority of input combinations over applications that have focus... Nothing really I can do anything about.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
somdcomputerguy
Lunatic
Lunatic
Posts: 384
Joined: 2014-02-23, 17:25
Location: Greenbrier County, West Virginia
Contact:

Re: Select link text by default

Unread post by somdcomputerguy » 2015-08-29, 15:27

I use this add-on - Born Geek » Copy Link Text (CoLT). If a link is right-clicked on, the link text, link URL, or both can be clipboard copied. If a page is right-clicked on, the title and page URL can be clipboarded as text, html (customizable) text, BBCODE, and Rich-Text.
Last edited by somdcomputerguy on 2015-08-29, 22:52, edited 1 time in total.
:cool: -bruce /* somdcomputerguy.com */
'If you change the way you look at things, the things you look at change.'

SvenG

Re: Select link text by default

Unread post by SvenG » 2015-08-29, 16:20

Moonchild wrote:
SvenG wrote:
Moonchild wrote:Current method: not easily discoverable, so yes, that could be improved -- but it works once you know it!
But not on every OS.
Only if the WM takes priority of input combinations over applications that have focus... Nothing really I can do anything about.
Which leads to the point that on some platforms it is impossible to natively being able to select text inside a link but instead being able to do lots of things via drag and drop that you can do in multiple other ways (using MMB, modifier+click or context menu). While the first being a pretty basic task, I guess everybody tries to do that from time to time, the use of the latter one depends a lot on workflow and personal style and is at worst totally useless. That is not really a smart solution, it should at least be switchable, so in case you do not use drag and drop or in case the modifier doesn't work as intended you can get at least a way to select text inside a link. The Opera way would also do, using aforementioned extension for a while and it works pretty well.

sIDcORK

Re: Select link text by default

Unread post by sIDcORK » 2015-08-29, 16:38

Isn't the Windows way to Left-click under the link at the place you want to select from, hold and drag to select and copy any way you like? No idea about Linux but it works in all sorts of Windows stuff.

SvenG

Re: Improve link text selection

Unread post by SvenG » 2015-08-29, 16:59

sIDcORK wrote:Isn't the Windows way to Left-click under the link at the place you want to select from, hold and drag to select and copy any way you like? No idea about Linux but it works in all sorts of Windows stuff.
There are a few of these workarounds but none of them is really particle and lead to a good result. Sometimes it works, sometimes it doesn't, sometimes you select half the page. That's pretty useless (not even sure if they were ever intended to be useful).

jumba

Re: Improve link text selection

Unread post by jumba » 2015-08-29, 17:02

Moonchild wrote: No, sorry. Dragging a link should never require precise selection of the link text before dragging. If you're suggesting a partial selection would suffice: it won't, because then people won't be able to partially select a link text.
Modifier key? I'd rather not flip the behavior around.
ok, I see. I changed the topic title to "Improve link text selection ". The old opera's way could be intuitive for touch screens too.
Moonchild wrote:EDIT: Also, even if you select the entire link and then drag... what is Pale Moon supposed to do? Lift the selected text (like it does now) or lift the underlying link?...
I think it should make a drag copy operation, and should copy the underlying html, therefore the entire link. It should behave the same when doing a partial drag copy of the link, only the text inside the link isn't fully copied.
sIDcORK wrote:Isn't the Windows way to Left-click under the link at the place you want to select from, hold and drag to select and copy any way you like? No idea about Linux but it works in all sorts of Windows stuff.
You learn something new everyday :) Edit: doesn't work for me in linux.

sIDcORK

Re: Improve link text selection

Unread post by sIDcORK » 2015-08-29, 18:22

To clarify, the selection requires that you watch how the cursor changes, as soon as you move the cursor changes from whatever it is while hovering over a link to anything else while moving vertically down the left click should work. In my experience this has worked since XP. I have no idea quite how precise you need to be for this but it works for me with some very standard kit and very old wrists.

Locked