Replacing some text in the whole session can be accidentally clicked too easily and the result might not want the user wanted to do. So ask for confirmation *before* potentially all files in the session will be modified. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3033
-- Commit Summary --
* Add a confirmation dialog on search & replace for the whole session
-- File Changes --
M src/search.c (9)
-- Patch Links --
https://github.com/geany/geany/pull/3033.patch https://github.com/geany/geany/pull/3033.diff
Another pop up to deal with? Can this be put behind a preference guard (`interface.warn_on_replace_in_session` in various)?
* Do people *really* "accidentally" click the button, or is it intentional and they change their minds? A new popup won't necessarily change the outcome of intentional actions. * Popups like that just train people to click accept/press return twice/etc. So may not even help true accidents. * The change is saved in the undo buffer, so easy to back out.
@eht16 Agree with adding the dialog - the "in document" and "in selection" are easy to undo but doing it for the whole session may be really annoying. And "In Selection" and "In Session" look very similar visually so they are easy to confuse.
"In Selection" and "In Session" look very similar visually so they are easy to confuse.
Only if you're mindlessly clicking buttons. In that case, a popup isn't going to help.
Another pop up to deal with? Can this be put behind a preference guard (`interface.warn_on_replace_in_session` in various)?
* Do people _really_ "accidentally" click the button, or is it intentional and they change their minds? A new popup won't necessarily change the outcome of intentional actions.
Yes, happened for me twice. The last time it took me an hour or so to clean up my session again (I had to review each single file).
* The "in session" button is hidden by default, so new users don't see it on first use.
Geany remembers the fold state of the extra buttons and for me, they are always expanded because I need 'in document' and 'in selection' quite often.
* Popups like that just train people to click accept/press return twice/etc.
In some situations yes. Here it is rather a stopper in case you already realised you clicked the wrong button shortly after you clicked it.
* The change is saved in the undo buffer, so easy to back out. * Could undo be expanded so that the "in session" action can be undone, rather than the "replace all" in each file? * Or add a "reload all" command to reset to the last saved state.
Both variants only work if there are no othher unsaved changes in session files. Might not always be the case.
The main purpose of this confirmation is to make it harder to perform this heavy, very influential operation accidentally. Other than 'in document' and 'in selection', 'in session' can be hard and time consuming to revert.
"In Selection" and "In Session" look very similar visually so they are easy to confuse.
Only when people are mindlessly clicking buttons. In that case, a popup isn't going to help.
See above.
Yes, happened for me twice. The last time it took me an hour or so to clean up my session again (I had to review each single file).
So... Can this be put behind a preference guard `interface.warn_on_replace_in_session` (default to true)?
So... Can this be put behind a preference guard `interface.warn_on_replace_in_session` (default to true)?
Not completely against it but do you think so many people use 'in session' regularly so often that they are annoyed by the dialog?
So... Can this be put behind a preference guard interface.warn_on_replace_in_session (default to true)?
No, we definitely don't want a preference for every single dialog there is in Geany.
Not completely against it but do you think so many people use 'in session' regularly so often that they are annoyed by the dialog?
I don't know how many people even use the replace dialog to begin with. (We need sp... surreptitious user data collection...) But why should some people's occasional mistakes inconvenience everyone always?
I'm generally against adding more popups. If there's truly no better way to solve the problem, at least the popup can be put behind a preference guard. Various preferences are easy to add. Maintenance would be low because it would control one specific thing. They don't interfere with the current incarnation of the config/session split, and any future transition would occur when the stash system is updated.
After making the mistake twice, aren't you going to be more careful going forward? If there were a dialog "protecting" you, you might not be as careful, get into the habit of mindlessly accepting, then ... have the same thing happen, except instead of realizing after you clicked the "in session" button, you realize the mistake after accepting the confirmation dialog. Then what? A second confirmation popup?
@xiota I don't want to be rude but what you started doing in various pull requests and issue reports is just pure spam. Learn your role. You are a new contributor to Geany who appeared out of nowhere 3 months ago, who we know nothing about (including your real name and email address) whose new toy project seems to be Geany development but whose github profile from the time before 3 months is basically empty and about whom we don't know whether he stays or leaves in another 3 months. Despite that, you are approving/rejecting people's pull request with the authority as if you were the creator of Geany.
For reference, @eht16 is the creator of Geany - not you. Behave accordingly.
For reference, @eht16 is the creator of Geany
Geany has been around at least since 2005. So it's 16 years for him to make this mistake without the popup. Does the popup really solve the problem?
So it's 16 years for him to make this mistake without the popup.
Snide remarks are rude and unprofessional, please do not continue that.
As I posted on https://github.com/geany/geany/pull/2947#issuecomment-981076461 Geany volunteers are PART TIME, all 16 years indicates is that there were too many other things to do, and "spam" posting as @techee called it, just makes it worse.
Whilst I generally agree that serial popups are annoying, protective popups are worthwhile, they are the only method of slowing users down if something is risky. That a user with over 16 years experience can make the mistake shows its reasonable to guard session changes, especially as undo requires you to manually check every file, see for example #1631.
In addition (at least the size the replace popup that shows by default here) there is space to the left of the "In Session" button, maybe it can be stacked left to keep it separate from "In Document" and "In Selection" and move it in tab order to be after them.
I'm generally against adding more popups. If there's truly no better way to solve the problem, at least
Noted, actually already before. But this doesn't mean adding a new popup to inform the user or request a confirmation is generally a bad idea. As I do accept, that popups might annoy some users, it would be nice if you could also accept that it is still a valid UX option for interaction, even if you personally do not like it.
After making the mistake twice, aren't you going to be more careful going forward? If there were a dialog "protecting" you, you might not be as careful, get into the habit of mindlessly accepting, then ...
I disagree. Some confirmation dialogs might increase a habit of just clicking them away. But this case is different as it is more of a guard to a potential harmful feature if not used explicitly. This is the whole intention of this change.
And regarding the referenced mistake: it's not like that I chose "in session" and then wondered what I had done. It is rather that the buttons are quite close and so it's not that unlikely, at least for some people, to accidentally chose the wrong button. I personally am much more aware now which button to choose but my intention also is to prevent other users from the misfortune I did. Obviously, all of this will never happen for you. Noted.
@elextr
In addition (at least the size the replace popup that shows by default here) there is space to the left of the "In Session" button, maybe it can be stacked left to keep it separate from "In Document" and "In
No space here with my GTK theme with a default config: ![geany_sar_dialog](https://user-images.githubusercontent.com/617017/143880626-9ffeb3ce-fd80-400...)
It might be an option to redesign the dialog to visually separate the 'In Session' more from the other ones but this would most likely make the dialog bigger at all. And regarding that presumably this feature is not often used (I anticipate even without the elsewhere request user tracking analytics), I think it's appropriate to use a popup for confirmation.
it would be nice if you could also accept that it is still a valid UX option for interaction, even if you personally do not like it.
I am not against adding the popup when the option to hide it is available. Providing that option is common to some extent across nearly every modern program. (Have you *never* hidden even a single warning dialog?) The default would be to show the popup. Users change it at their own peril.
There are also other ways to prevent the mistake. Adding the popup makes it feel like the problem is solved so that other options aren't fully explored. Here are a few possibilities:
* Make the buttons smaller and separate "in session" from the others. * Rename the options to make them easier to distinguish (like, "In Entire Session", "In Current Document", "In Selection Only"). * Highlight the "in session" button with red, orange, or some other warning color when the cursor hovers over it. * Showing a tooltip with a warning (currently only in selection has a tooltip).
Even with the popup, the mistake could still occur under circumstances different from yours. To address this, backing out of the mistake could be made easier.
* Enable undo to be able to backout of replace all for all documents simultaneously. * Make "reload all" more visible by adding it to the menu. (Guard it with a popup when activated from the menu. The keybinding would still reload without popup.)
Obviously, all of this will never happen for you.
I've made this mistake. Based on available info, your rate is about 1-2 per decade. My rate is at least double that. But for me, the benefit of the popup is far less than the cost of the mistake. I probably use "in session" more than you do. That would explain why my mistake rate (vs time) is higher than yours and also why the popup would be more bothersome. It does *not* take me an hour to back out though. I save the documents that I definitely want to keep the change. Then kill and reopen Geany.
A simple confirmation popup is fine by me @xiota, as @eht16 said, please accept the decision.
@eht16
No space here with my GTK theme with a default config:
Yeah, differing themes, oh well it was a thought.
As you say, its dangerous, so its likely to only be used rarely. Note neither Eclipse nor Vscode (yes I added it to my menagerie) have a replace in session or equivalent, so its not like users coming from some other editors are going to expect it.
Therefore a simple popup is fine and lets get on with important work.
@eht16 is this going anywhere?
IMO this PR can be merged.
Ok by me.
Merged #3033 into master.
github-comments@lists.geany.org