Changing "Paste Without Formatting" in Notes applet to "Paste"
AcceptedPublic

Authored by yerilov on Sep 24 2019, 2:47 AM.

Details

Reviewers
ngraham
Summary

Since this action is the default for Ctrl+V shortcut it should be named just "Paste". Hence the other option has to be renamed to "Paste With Formatting" accordingly.

Test Plan

build'n'test this Notes applet's context menu

Diff Detail

Repository
R114 Plasma Addons
Branch
notes-applet-tuning (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16950
Build 16968: arc lint + arc unit
yerilov created this revision.Sep 24 2019, 2:47 AM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 24 2019, 2:47 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
yerilov requested review of this revision.Sep 24 2019, 2:47 AM
ngraham accepted this revision.Sep 24 2019, 2:59 AM
This revision is now accepted and ready to land.Sep 24 2019, 2:59 AM

Thanks for the patch! May it be the first of many. :)

Localization team, I'd like to request a string freeze exception and land this on the Plasma/5.17 stable branch so we can avoid having the text of these menu items reverse in Plasma 5.18.

Thanks Nate :)
Actually it's rational to change documentHandler.pasteWithoutFormatting() handler as well, but I'm afraid I'm not good at coding to make such amendments.

Out of curiosity: doesn't usually the default Paste action (ctrl-V) paste with formatting? Shouldn't the shortcut be changed instead?

Out of curiosity: doesn't usually the default Paste action (ctrl-V) paste with formatting? Shouldn't the shortcut be changed instead?

Yeah, normally Ctrl+Shift+V pastes without formatting.

I have no objections regarding default action, be it paste with or w/o formatting, it's rather a common sense fix: name what we use for Ctrl+V as "Paste", but and another action should get more detailed description. It also looks good in menu:

_____________________________________
|                                   |
| Paste                      Ctrl+V |
|                                   |
| Paste With Formatting             |
|                                   |
-------------------------------------

What changes is the patch needed. If we agree that Paste means "paste with formatting", then the string don't need to be changed, just the shortcut.

Out of curiosity: doesn't usually the default Paste action (ctrl-V) paste with formatting? Shouldn't the shortcut be changed instead?

Yeah, normally Ctrl+Shift+V pastes without formatting.

That's true, but we decided to make the default paste action strip formatting for this applet because that was a better default action. It's not necessarily a bad default for other apps so we didn't change it universally. Thus I think this patch makes sense, but if you disagree we can keep discussing it.

I think that this requires a bit more of discussion; "Paste" has a specific and well expected meaning.

huftis added a subscriber: huftis.Sep 25 2019, 9:37 PM

I find ‘Ctrl + V’ doing a ‘paste without formatting’ (with or without the renaming) confusing, and it goes against the principle of least surprise, which is in general a bad idea. In all(?) other applications, ‘Ctrl + V’ does a normal paste, i.e. with formatting (if possible). IMHO, the best solution would be:

Ctrl + V: Paste
Ctrl + Shift + V: Paste Without Formatting

Then things will work the way the user’s used to (from other applications). And if both actions are shown in the context menu, the (useful) ‘Paste Without Formatting’ option is easy to discover.

The reason we decided to make this change was because users were complaining that pasting text into the Notes widget preserved formatting. See https://bugs.kde.org/show_bug.cgi?id=396507. So clearly not everyone expected that.

It's the classic conflict between "the same behavior everywhere" vs "contextually appropriate behavior". There is no real objectively correct answer here; it's a judgment call. And I agree with the judgment call that pasting without formatting is a better default for the Notes widget.

If this behavior is considered objectionable and people hate it (personally I like it), perhaps an alternative approach would be to add a UI to toggle individual notes between rich text and plain text, with plain text being the default? See https://bugs.kde.org/show_bug.cgi?id=406906

If this behavior is considered objectionable and people hate it (personally I like it), perhaps an alternative approach would be to add a UI to toggle individual notes between rich text and plain text, with plain text being the default? See https://bugs.kde.org/show_bug.cgi?id=406906

That would be way better. The backend of the notes applet was written with the intention of being able to sync data. There's even a file watcher if someone else modifies the notes on disk - but the stupid formatting markup always made using that a problem.

That's somewhat orthogonal to this discussion unless you're saying this replaces paste with/without formatting.

If this behavior is considered objectionable and people hate it (personally I like it), perhaps an alternative approach would be to add a UI to toggle individual notes between rich text and plain text, with plain text being the default? See https://bugs.kde.org/show_bug.cgi?id=406906

That would be way better. The backend of the notes applet was written with the intention of being able to sync data. There's even a file watcher if someone else modifies the notes on disk - but the stupid formatting markup always made using that a problem.

That's somewhat orthogonal to this discussion unless you're saying this replaces paste with/without formatting.

The proposed toggle would supplement being able to paste with or without formatting (obviously when it's plain-text only it would always paste without formatting). I'm proposing this as a way forward since otherwise I suspect we'll be endlessly stuck in debate about which behavior is better for the default paste action.

@huftis
Having thought about this I guess I have my attitude towards the default Ctlr+V 'Paste' action: it should be without formatting. I can explain why. Notes applet is not an application. The reason it exists is to contain quick notes and tasks, memos, etc. Such text objects may come from various sources with heavy formatting, but Notes is not a web page or document processor, it shouldn't default to display potentially hard to read text (given the size of the applet) as a result of Ctrl+C - Ctrl+V pasting. Being not an application means it can behave differently in some aspects, that's why I find the comparison between this applet and other applications irrelevant.
But not only that. Open Kate pls and try to find "Paste with Formatting" there. Try to paste some text from this page there. You'll see there's no formatting. But Kate is an application, quite powerful one. And no formatting.
From the other side, having an way to paste formatted text is quite a neat option, that's why I guess it's better to have it untouched (I mean no reason to remove it).

least surprise.

Well, try to Ctrl+V your own comment to Notes on 5.16.5 (it defaults to Paste with formatting here). What I see immediately is an ugly white-on-yellow text background which comes w/o no doubt from this page formatting. This is actual surprise for anyone who wants to make memos.

Funny thing: I stopped using Notes due to this formatting thing so long ago that I cannot remember when exactly. There's a plaintext Kate file on my desktop instead.

I think that the Kate use case is different, as it provides only one paste action. Whenever else there are two paste actions available, it's always "paste" (with formatting) associated to ctrl-V and "paste without formatting" to ctrl-shift-V. So maybe you are talking about pasting with the mouse? If it's through right click, both action are clearly visible. If it's through middle click, uhm, maybe we can talk about that. But the meaning of the variants of paste and their shortcuts has been very stable cross-platforms for a long while.

Talking about cross-platform: Windows Notes app pastes text with no formatting, as Gnome Sticky Notes do, even Android apps do not use pasting with formatting by default.
Yep, I understand expecting pasting with formatting for Office apps, but for Notes widget it is more of an additional option.
I don't know how to explain it more clearly. Just suggest to copy some part of, say, Manjaro Linux forum main page and paste it with formatting no Notes. That's hardly a thing any user would expect to see in any notes applet on any platform.

Do those applications provide the paste-with-formatting action too?

When you talk about "pastes text", "paste it", etc, which way do you mean? Shortcut, right click + "Paste" entry, middle menu click, all of them, some of them?

Do those applications provide the paste-with-formatting action too?

No they don't. So it is one more thing that actually makes Plasma more feature-rich DE.

When you talk about "pastes text", "paste it", etc, which way do you mean?

Well, we're running in circles here. Until everyone here understands which paste options Notes applet has now and had before any discussion is useless.

One last time, to clarify how it was, how it is, and how it was proposed to be:

  1. Until https://phabricator.kde.org/D22774 Notes default paste option was "paste with formatting", which was named "Paste" in menu and invoked by Ctrl+V. This is how it was.
  2. https://phabricator.kde.org/D22774 changed the default paste option to "paste without formatting" and renamed it to "Paste without Formatting", making Ctrl+V to paste without formatting. This is how it is as of 5.16.80.
  3. What I propose is to simply rename the menu option introduced by https://phabricator.kde.org/D22774, "Paste without Formatting" to "Paste" again, but preserve the actual action and Ctrl+V shortcut, and rename another (next) option from "Paste" to "Paste With Formatting" in order to make a clear difference between the two options in menu. This is how is suggested to be. Cosmetic but looks better and in accordance with the expectations of the end user (broadly speaking).

Arguing about another applications is irrelevant due to the nature of the Notes applet: it is not an application like MS Word, it serves another purpose. Needless to say that we all know now that there are some KDE apps like Kate or KWrite or KolourPaint (more than one) which have no Paste with formatting option at all, this is why any try to argue like "all other KDE application have this behavior by default" would contradict the reality.

I don't see how using the "running in circles" argument can solve the problem. I totally understand how notes works, thanks.
The situation is how I described above: applications with just paste may have non-formatting option; applications which have both options default to pasting with formatting.
Nothing here convinces me that there is enough reasons to diverge from the common patterns. It's not a matter of being richer and with more features.

Please also note that the notes applications is a rich text editor by default (like the buttons shows). So I would vote for a revert of D22774.

Please ignore the last part of my last comment. My question on the way a paste happens is still relevant, so please answer it: if users use the right click, they will surely distiguish "paste" and "paste without formatting". If they use the shortcut, they can learn to use the the proper shortcut for that action (which, in applications which provides rich text support, is not ctrl-V).

Please ignore the last part of my last comment. My question on the way a paste happens is still relevant, so please answer it: if users use the right click, they will surely distiguish "paste" and "paste without formatting".

Right, the problem is when using the keyboard shortcut, because ctrl+v previously included formatting by default. Now it doesn't. I don't know why we're arguing over something already committed. I'm against reverting it.

If they use the shortcut, they can learn to use the the proper shortcut for that action

I don't think that's realistic here. What we would prefer the user to do or learn and what the average user in all practicality is going to be able to do or learn are not always the same things. Sometimes improving the user experience for the common case pushes us in the direction of breaking a convention, and that's why we did it. Consistency is good when it improves the user experience, but when it hinders it, we should be willing to be flexible.

yerilov added a comment.EditedSep 26 2019, 3:05 PM

@ltoscano D22774 added the ability to choose between paste with and without formatting in the context menu, so yes, no problem with distinguishing.
Adding another shortcut like Ctrl+Shift+V is also a viable solution but these kinds (any kinds) of complex shortcuts have more chance to conflict with various things like input method switching (fcitx, ibus invoke or IM switch). One more reason to revive D14796 which was undeservingly abandoned btw. In fact, it won't (I've checked with fcitx/kimpanel) but that's another story.

Seems like I gonna stick with my txt file on the desktop, okay, I had to try anyway.

@ngraham Let's make it configurable, but not change the default then. I disagree that changing this default on an application which support rich text by default helps making the life of everyone better.

@yerilov, as you can see, I didn't request a change, because in the end everything I'm writing will be ignored. So don't worry. But just for the sake of completeness, there are other solutions: see the previous suggestions about making this configurable.

@ngraham Let's make it configurable, but not change the default then. I disagree that changing this default on an application which support rich text by default helps making the life of everyone better.

What do you think about my proposal to make the notes applet itself be configurable between plain text and rich text? In this case, we could have it paste in plain text in plain text mode, and rich text in rich text mode, with a "paste without formatting" option for (the probably somewhat uncommon case of) people who do want to use rich text but don't want to paste rich text.

@ngraham yeah this is the best way to go as it seems to me. What I did was just drawing attention to this problem since I cannot code and it's hard to understand how everything works for a non-coder.
@ltoscano I'd vote for any solution which makes Notes more configurable with respect to pasting of formatted text.

Also keep in mind that Qt 5.14 supposedly supports markdown editing, which I would love in the notes applet, which would be preferred over "rich text" imho.