Bug 162753 - Problem with ctrl-k and Insert/Hyperlink
Summary: Problem with ctrl-k and Insert/Hyperlink
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Hyperlink-Dialog
  Show dependency treegraph
 
Reported: 2024-09-02 18:15 UTC by Ola Smith
Modified: 2024-09-06 06:47 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ola Smith 2024-09-02 18:15:24 UTC
Description:
When I have selected a string as a hypertext link and do either ctrl-k or Insert/Hyperlink the URL is immediately filled in with whatever shit that happens to be on top of my clipboard. I think this is rather a bug than a feature ....



Steps to Reproduce:
1.write and select "text"
2.clic ctrl-k
3.look at URL in the pop-up

Actual Results:
The URL contains shit from the clipboard

Expected Results:
A clean URL


Reproducible: Always


User Profile Reset: No

Additional Info:
This is what I got with the new Ubuntu LTS 22 -> 24 upgrade
Comment 1 Regina Henschel 2024-09-02 18:28:32 UTC
I see advantages in current behavior. If I copy a link from a web page to paste it into a document, the link is in the right place without the need to paste. If I want to enter a link by hand instead, that's no problem either. Because the entry is already selected, I can start writing directly without having to click into the input line.

I do not want this behavior to be changed.
Comment 2 Ola Smith 2024-09-03 12:22:26 UTC
The problem becomes obvious when trying to make an intradocument link to a bookmark.
Comment 3 Regina Henschel 2024-09-03 14:58:23 UTC
(In reply to Ola Smith from comment #2)
> The problem becomes obvious when trying to make an intradocument link to a
> bookmark.

I agree, that could be improved. When you press Ctrl+K and then in that dialog click on "Document", then field "Path" has to be empty as default, because the to be used document is the current document in most cases.

But for the option "Internet" the solution from bug 146576 should be kept.

My suggestion would be to use the clipboard content only as default for the options "Internet" and "Mail" and leave the field blank in the "Document" and "New Document" case. The option "Document" has the button "Open File" and the option "New Document" has the button "Select Path" to generate a proper entry in the "Path" or "File" field, respectively. For them a clipboard content as default is not helpful.
Comment 4 Ola Smith 2024-09-05 09:34:44 UTC
There is yet another problem:

If I ctrl-k an existing link, the original URL will be lost and replaced with whatever there is in the clipboard.

Annoying!
Comment 5 Regina Henschel 2024-09-05 10:14:02 UTC
(In reply to Ola Smith from comment #4)
> There is yet another problem:
> 
> If I ctrl-k an existing link, the original URL will be lost and replaced
> with whatever there is in the clipboard.
> 
> Annoying!

Use "Edit Hyperlink" (.uno:EditHyperlink) from the context menu of the hyperlink. It has no default short cut.
Comment 6 Regina Henschel 2024-09-05 12:05:49 UTC
I think, we need a UX decision about the behavior of the Hyperlink-dialog. Known problems are:

If Ctrl-K is used on a existing hyperlink, it sets the current clipboard content into the URL in Writer, but not in Calc.

When a cell in Calc contains only a hyperlink, then Ctrl+Click on the cell executes the hyperlink and Ctrl+K opens the hyperlink dialog. But command .uno:EditHyperlink does not work and "Edit Hyperlink" is not available from the context menu of the cell.

Similar in Impress, when the mouse hovers over textual hyperlink, then Ctrl+Click executes the hyperlink and Ctrl+K opens it but looses the URL. Command .uno:EditHyperlink does not work.

When the user switches from "Internet" to "Document" in the Hyperlink dialog, an existing URL entry is used as Path. Also other workflow produce wrong Path entry, see bug 159722. The use case "Document" has more problems: bug 90679 and bug 158439

A search for "hyperlink dialog" in Bugzilla including "Wontfix" and "Duplicate" shows that users have problems with this dialog.
Comment 7 Adalbert Hanßen 2024-09-05 17:06:49 UTC
1. Use the clipboard content to preset a target only if it is syntactically a valid hyperlink target. Don't preset from the clipboard, if this is syntactically no hyperlink target.
2. Preset at most once after the current instance of the dialog is invoked.
3. Don't preset it, if the dialog is invoked for an existing hyperlink: then come up as if this is what might be edited/altered by the user.

If this would have been done in the duplicates #146576 and #159722, all would beclome happy.
Comment 8 Heiko Tietze 2024-09-06 06:47:27 UTC
(In reply to Regina Henschel from comment #6)
> When a cell in Calc contains only a hyperlink, then Ctrl+Click on the cell
> executes the hyperlink and Ctrl+K opens the hyperlink dialog. But command
> .uno:EditHyperlink does not work and "Edit Hyperlink" is not available from
> the context menu of the cell.
Aren't these questions different from whether the dialog accepts clipboard content? I vaguely remember a ticket/patch about link execution.

(In reply to Adalbert Hanßen from comment #7)
> 1. Use the clipboard content to preset a target only if it is syntactically
> a valid hyperlink target. Don't preset from the clipboard, if this is
> syntactically no hyperlink target.
+1
> 2. Preset at most once after the current instance of the dialog is invoked.
This might be tricky. And also hard to understand by users.
> 3. Don't preset it, if the dialog is invoked for an existing hyperlink: then
> come up as if this is what might be edited/altered by the user.
+1

> If this would have been done in the duplicates #146576 and #159722, all
> would beclome happy.
Rather make this ticket a duplicate then.