Return editable URL navigator to breadcrumb mode if it has focus and everything is selected and when Ctrl+L is pressed
ClosedPublic

Authored by ngraham on Nov 18 2018, 3:48 PM.

Details

Summary

This patch makes an editable location bar return to breadcrumb mode when Ctrl+L is pressed, but only if the location bar currently has focus and everything is selected. Otherwise, it will simply return focus to it as before.

This provides a slightly easier way to make the location bar return to breadcrumbs mode

Test Plan
  • Compile and deploy and make the location bar be breadcrumbs
  • Hit Ctrl+L twice in a row -> location field turns to being in breadcrumb mode. Focus is correctly returned to the main view.
  • Hit Ctrl+L, move focus elsewhere, then hit Ctrl+L again -> Location bar is editable and focused with everything selected.
  • Hit Ctrl+L, deselect some of the text, then hit Ctrl+L again -> Location bar selects everything.

Diff Detail

Repository
R318 Dolphin
Branch
arcpatch-D16980
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5738
Build 5756: arc lint + arc unit
ngraham created this revision.Nov 18 2018, 3:48 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptNov 18 2018, 3:48 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
ngraham requested review of this revision.Nov 18 2018, 3:48 PM
ngraham edited the test plan for this revision. (Show Details)Nov 18 2018, 3:49 PM

And here's a KIO patch for the open/save dialogs that brings the existing Ctrl+L mode toggling behavior into 100% consistency with what's proposed here: D16981

I am not voting against this feature, but I use CTRL+L also in browsers. There, CTRL+L does two things:

  1. it sets focus to the URL bar
  2. it selects all

In fact, sometimes I already have focus in the URL bar and used the cursors (or similar editing actions), so that the selection is gone. In this specific case, I indeed CTRL+L again to select all. Think of a "restart or reset" of my editing process.

Currently, Dolphin has the same behavior for me, which is consistent to what Firefox. Also ESCape currently turns back to breadcrumb view.

Opinions?

I am not voting against this feature, but I use CTRL+L also in browsers. There, CTRL+L does two things:

  1. it sets focus to the URL bar
  2. it selects all

    In fact, sometimes I already have focus in the URL bar and used the cursors (or similar editing actions), so that the selection is gone. In this specific case, I indeed CTRL+L again to select all. Think of a "restart or reset" of my editing process.

    Currently, Dolphin has the same behavior for me, which is consistent to what Firefox. Also ESCape currently turns back to breadcrumb view.

    Opinions?

That's all true, but the location bar in web browsers isn't multi-mode: it has no equivalent of the breadcrumbs mode. So it's not exactly the same UI. Ctrl+A can also be used to select all if you're already in the location bar, start typing something, and want to select everything, and it isn't any slower than using Ctrl+L.

I do see what you're saying, but consistency is only a virtue when the two things that are rendered consistent with one another are the same thing. Consistency in behavior between dissimilar things can be confusing or inappropriate at times.

This provides a slightly easier way to make the location bar return to breadcrumbs mode

I'm not sure what we are fixing here. Easier than pressing Esc?

Currently, Dolphin has the same behavior for me, which is consistent to what Firefox. Also ESCape currently turns back to breadcrumb view.

Every browser that I know of behaves like this.

In fact, I'd argue the file dialog is the one being incosistent here, since it's the only one that does not select the whole text when the urlbar has focus.

ngraham added a comment.EditedNov 18 2018, 5:58 PM

But Dolphin isn't a web browser, and the KUrlNavigator isn't a web browser-style URL input field. It isn't used to navigate to full URLs, just directory paths. And it has a separate breadcrumbs mode that you can switch to and from that has no analogue in a web browser.

I would totally agree with being consistent with web browsers if the URL navigator behaved identically. But it doesn't, so I would posit that there's nothing to be consistent with since it's not the same control that's found on a web browser. Any similarity is misleading.

I kind of am with @elvisangelaccio here and would argue that the file dialog is inconsistent :-)

But that aside: Is is good usability, if CTRL+L does two different things depending on the context?

Think of CTRL+A in a text editor: If you press CTRL+A once, it selects all, and the second time it deselects all?

My point here is that if an action is context-dependent, it is less deterministic in its behavior. Currently, CTRL+L is entirely deterministic in what it does (which is certainly a good thin usability wise).

Ctrl+L already does multiple things depending on the context:

  1. URL navigator is a breadcrumb bar: Ctrl+L makes it editable, focuses it, and selects everything
  2. URL Navigator is editable but unfocused: Ctrl+L makes it focused and selects everything
  3. URL Navigator is editable and focused, but not everything is selected: Ctrl+L selects everything
  4. URL Navigator is editable and focused and everything is already selected: Ctrl+L does nothing

This patch currently changes 3 and 4 to be "Ctrl+L turns it back into a breadcrumb bar and returns focus to the main view". Perhaps I could tweak the patch so that this only happens for case #4, for which hitting Ctrl+L currently has no effect. Thoughts?

firef awarded a token.Nov 19 2018, 8:08 AM

Hm, isn't it that in all 4 cases Ctrl+L focuses the line edit and selects all? /Independent/ on the context? That's what you just wrote, right? :-)

But in the end, it's up to the Dolphin maintainers to decide.

Any conclusion here? I see that a couple of thumbs-ups have appeared in the meantime. 😛

Ctrl+L already does multiple things depending on the context:

  1. URL navigator is a breadcrumb bar: Ctrl+L makes it editable, focuses it, and selects everything
  2. URL Navigator is editable but unfocused: Ctrl+L makes it focused and selects everything
  3. URL Navigator is editable and focused, but not everything is selected: Ctrl+L selects everything
  4. URL Navigator is editable and focused and everything is already selected: Ctrl+L does nothing

    This patch currently changes 3 and 4 to be "Ctrl+L turns it back into a breadcrumb bar and returns focus to the main view". Perhaps I could tweak the patch so that this only happens for case #4, for which hitting Ctrl+L currently has no effect. Thoughts?

That would be much better, since we wouldn't change behavior for those who rely on #3.

ngraham updated this revision to Diff 46930.Dec 6 2018, 2:40 AM

Only return to breadcrumb mode when entire text is selected

ngraham retitled this revision from Return editable URL navigator to breadcrumb mode when it has focus and Ctrl+L is pressed to Return editable URL navigator to breadcrumb mode if it has focus and everything is selected and when Ctrl+L is pressed.Dec 6 2018, 2:42 AM
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)

I'd be ok with the proposed behavior.

@dhaumann What about you?

This revision is now accepted and ready to land.Dec 16 2018, 1:02 PM
dhaumann accepted this revision.Dec 16 2018, 1:44 PM

I am not 100% convinced of this feature, but my attitude is: let's try this, and if someone complains, we can still change it. So I am fine with the change.

Nate, please go ahead.

Thanks guys! Let's give it a whirl. :)

ngraham updated this revision to Diff 47696.Dec 16 2018, 8:56 PM

Rebase on master, fix trivial merge conflict