Bug 154831 - Replace string is empty
Summary: Replace string is empty
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2023-04-15 17:34 UTC by maison
Modified: 2023-04-27 11:01 UTC (History)
4 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 maison 2023-04-15 17:34:22 UTC
Description:
When you reopen the Search and Replace popup window, the last search item is proposed again, but the last replace item field is empty.

It is annoying to have to reselect it again, especially since you can’t jump directly to the replace field with the keyboard to reselect the last item; it takes many Tab keys to access it.

I’m surprised to see such behaviour in LO, as no other software that I’m aware of would hide the replace text only.

Steps to Reproduce:
1. Open the Search & Replace popup window and run a replacement (A replaced by B).
2. Close the popup window.
3. Ctrl H again.

Actual Results:
See that A is proposed again for the search.

Expected Results:
See that B is not proposed directly any more as replacement text. You have to reselect it.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 1 V Stuart Foote 2023-04-15 19:03:57 UTC
Sorry, not seeing the need.

On open the dialog, cursor focus is in the Find field

Three <Tabs> (to pass over find configuration check-boxes) to position to the Replace field

Cursor <Down> (or up) to fill items from Replacement stack.

This is functional, both with mouse pointer and with keyboard selection.

Also, it is risk free.  With nothing selected for the replacement string--no inadvertent replacement can occur (necessitation UNDO if caught, or loss of data if not).

I suppose we could refactor to optionally prefill the replace field--but it would need to be off by default and an Expert configuration. Not clear it is worth the effort or risk to the "Benjamin" users.

IMHO => WF
Comment 2 maison 2023-04-15 19:12:45 UTC
(In reply to V Stuart Foote from comment #1)
> Sorry, not seeing the need.
> 
> On open the dialog, cursor focus is in the Find field
> 
> Three <Tabs> (to pass over find configuration check-boxes) to position to
> the Replace field
> 
> Cursor <Down> (or up) to fill items from Replacement stack.

Maybe because you use Writer. I mostly use Calc, which has more (too many) Tabs to press until you reach that box, then press another key, which is enough to interrupt the workflow.

Even today it’s risk free as the first assigned button is Search for next and not Replace as you suggest.

But that statement is also not true, as with the replace field empty you can still delete your data if you inadvertently click the Replace all button.

Anyway, as I said, it’s an interface quirkiness that no other software that I’m aware of chose.
Comment 3 Heiko Tietze 2023-04-17 08:05:21 UTC
I wonder what workflow requires to repeat search / replace operations. Neither it's a "quirkiness" to me (haven't checked Microsoft apps). Do you have a real life example to support the enhancement need?
Comment 4 maison 2023-04-17 19:38:28 UTC
(In reply to Heiko Tietze from comment #3)
> I wonder what workflow requires to repeat search / replace operations.
> Neither it's a "quirkiness" to me (haven't checked Microsoft apps). Do you
> have a real life example to support the enhancement need?

Or see it in the opposite way, what workflow example there is where you want to search for the same thing, but this time delete your text rather than replace it with what was previously set? Deleting your search text (which happens when you don’t have a replacement text set) is a very strong assumption, which is very unlikely that it is what the user wants the second time.
Or why set the search text again & all the other options in the popup window, but not the replace text?

It makes no sense to me (and indeed Microsoft Office users are not used to having some of their setting disappear). Also let’s speak about several software as diverse as advanced text editors, Calibre, Directory Opus, Abbyy FineReader… I can hardly find something that deletes half of the Search & Replace settings.

Anyway as an easy to understand workflow, you search and replace a few things, then you realise that you need more attention for this place, so you close the window to work on it properly, then you want to resume your search, and now you have to press Tab Tab Tab Tab Tab… (don’t press too automatically or you have to start over!)
Comment 5 Eyal Rozenberg 2023-04-18 18:38:39 UTC
Points in favor:

* I find benefit in having the same replace-string again (see below).
* All sorts of other apps have this, e.g. CLion IDE, gedit, Geany IDE
* It's annoying to re-select the replace term in calc

Points against:

* It's easy to re-select the search term if you're actively using the mouse
* It not difficult to re-select the replace term in Writer
* Some apps don't have this feature e.g. Thunderbird
* User might accidentally replace with a term they did not intend to use

(In reply to Heiko Tietze from comment #3)
> I wonder what workflow requires to repeat search / replace operations.

Oh, come on, that's obvious!

1. You replace "somethingfoo" with "anotherfoo"; then you want to replace "somethingbar" with "anotherbar". So you start with "anotherbar" and edit just the suffix.
2. You replace some complex regexp with another complex pattern using matched subexpressions. But then you notice that first search pattern only captures some of the cases, so you modify it, while still replacing with the exact same pattern
3. You're replacing with a term like "N/A" or "0"; and there are multiple kinds of things you want to "reset to default" that way.
Comment 6 Heiko Tietze 2023-04-19 07:46:58 UTC
(In reply to Eyal Rozenberg from comment #5)
> * It's easy to re-select the search term if you're actively using the mouse
Or the alt+P mnemonic (depending on the localization) 

> 1. You replace "somethingfoo" with "anotherfoo"...
All good example. We need to balance the benefit from _preselecting_ the last replacement with the odds of doing so. And I tend to disagree with the importance of the repeated replacement workflow.
Comment 7 maison 2023-04-19 19:52:07 UTC Comment hidden (off-topic)
Comment 8 Heiko Tietze 2023-04-20 07:28:06 UTC Comment hidden (off-topic)
Comment 9 maison 2023-04-20 10:30:50 UTC Comment hidden (off-topic)
Comment 10 Heiko Tietze 2023-04-27 08:42:33 UTC
We discussed the topic in the design meeting and decided to resolve WF.

It might be a common use case to search for different content and replace it by the same value. But it is definitely not the most relevant. It is easy to select the last used item, and we should protect potentially destructive actions (with the preselection wit risk accidental replacing).
Comment 11 maison 2023-04-27 11:01:05 UTC
Thanks for the update, but having the empty field is not les destructive than having it populated with any other value, as you can still replace your data with an empty string if you accidentally click the Replace buttons. If you want to avoid potential damage (if someone can’t undo), then it should be the search string to be reset, not the replace string.

It’ll be a peculiarity for LO compared to other software.