Add option to reverse URL hint numbering
ClosedPublic

Authored by achkts on Sep 8 2018, 11:23 PM.

Details

Summary

Adds option to reverse the order of URL hints such that the last URL
(the bottom-most one) has the number 1 and the numbers increase from
bottom to top.

This becomes particularly useful when watching a log or buffer, or in terminal
chat applications. Very often, the most useful URL is the most recent one and
if there are many (> 10) URLs on the screen, the desired one will not get a
hint. Reversing the numbering makes the most recent URL hint take the number 1,
while the oldest will have the highest number or no number at all.

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
achkts created this revision.Sep 8 2018, 11:23 PM
Restricted Application added a project: Konsole. · View Herald TranscriptSep 8 2018, 11:23 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
achkts requested review of this revision.Sep 8 2018, 11:23 PM
ngraham added a subscriber: ngraham.Sep 9 2018, 4:28 AM

Not being aware that this feature even existed, I'm afraid your explanations and screenshots don't really help me understand what the feature is, or why this option would be desirable for some people, but not all. The new option would therefore be pretty confusing.

Can you help me understand all of this a bit?

The URL hints feature is enabled by setting a modifier key combination. In the second screenshot (Advanced tab of the Profile settings: konsole-hints-rev-option), it's set to Control+Alt. When the configured key combination is held, any URLs in the current view of the Konsole window are highlighted and numbered, starting with 1 for the topmost URL down to 9. If there are more than 9 URLs, the bottom-most ones are not numbered (as seen in the first screenshot: konsole-hints-before). Pressing a number while the hints are highlighted opens the corresponding URL in the default web browser.

The purpose of the URL hints feature is the opening of URLs that appear in a terminal window without the use of the mouse.

A very common use case for URLs appearing in the terminal is in chat applications, or watching log files, or when working in the terminal and URLs appear as the output of commands (e.g., starting a server, or uploading a document to a pastebin service and getting its URL as output). In such cases, the most important URL at any given time is often the most recent one. If 10 or more URLs are on screen however, the most recent URL will not get a number. Furthermore, having the most recent URL take the number 1 is arguably more convenient and straightforward when thinking about lines on the screen in this temporal way.

The patch I submitted adds an option labelled Reverse URL hint numbering that changes the numbering of the URLs to bottom-to-top, to make it more convenient to work with the use cases outlined above, as seen in the third screenshot (konsole-hints-after).

Examples

The following two examples show some use cases and how they appear with the default numbering.

In the following screenshot, multiple files are uploaded to gist.github.com from the terminal. Holding the Control+Alt displays the URL hints, numbering them top-to-bottom. If the workflow involves uploading a file and immediately opening it, having the most recent one be labelled with the number 1 is arguably more convenient.

The next screenshot shows an example of URL hints in IRC (WeeChat). There, the most recent URL is labelled with the number 8, whereas the URLs numbered 1-7 are from earlier messages or the channel topic. Again, having the most recent URL be labelled with 1 is more convenient. If I were to return to the channel to find newer URLs from channel users, I would be more likely to want to open those newer ones, rather than the ones at the top of the buffer.

I don't have any strong objections

src/EditProfileDialog.ui
1238

can you add a tooltip like most of the others have?

achkts added inline comments.Sep 17 2018, 1:26 PM
src/EditProfileDialog.ui
1238

On it. Should I add a second commit or squash it into the first one?

hindenburg added inline comments.Sep 17 2018, 2:25 PM
src/EditProfileDialog.ui
1238

squash it if that's easier for you - not a big deal either way

achkts updated this revision to Diff 41847.Sep 17 2018, 2:54 PM

Add tooltip for new option

hindenburg accepted this revision.Sep 18 2018, 1:32 PM

thanks

This revision is now accepted and ready to land.Sep 18 2018, 1:32 PM
This revision was automatically updated to reflect the committed changes.