microsoft / microsoft/PowerToys
[PowerRename] Ambiguous/incomplete Settings label 'Show recently used strings' (controls PersistState: restore last-used values & flags on launch)
- Dominant language
- C
- Stars
- 139k
- Forks
- 8.6k
- PR merge metrics
- PR metrics pending
Description
## Summary
In **PowerToys Settings → PowerRename → Auto-complete**, the toggle **"Show recently used strings"** has an **ambiguous and incomplete label**. It is bound to `PersistState`, whose actual behavior is: **on launch, restore the last-used Search text, Replace text, and option flags** (and persist them on close).
The label isn't outright nonsensical — it can be read charitably as *"show recently used strings [on launch]"*. But it's imprecise enough to be confusing, especially because it sits directly under the toggle that provides the *actual* recently-used-strings list (auto-complete / MRU).
This is a **label clarity issue** — the underlying feature works correctly; only the wording could be improved.
## Why the label is ambiguous / incomplete
1. **It omits the timing ("on launch").** The reader has to mentally supply "on launch" for the label to make sense — a sign it's under-specified.
2. **Plural "strings" implies a list/history.** `PersistState` restores exactly the **single** last Search + last Replace value, not a set of recent strings. The feature that genuinely deals with *multiple* recently-used strings is the **MRU/auto-complete** toggle right above it ("Enable auto-complete for the search & replace fields" → `MRUEnabled`), so "strings" pulls the reader toward that neighbor.
3. **It restores flags too, not just strings.** On launch it also re-applies the last regex / match-all / case-sensitive / scope / case-mode options — which "strings" doesn't convey at all. So even the charitable reading is incomplete.
4. **Adjacency amplifies the confusion.** The "Auto-complete" group then contains two toggles where one *is* the recently-used-strings list and the other is *named* "recently used strings".
## Evidence (label → binding → engine behavior)
**Label** (`src/settings-ui/Settings.UI/Strings/en-us/Resources.resw`, present since commit `eb2ef7070be`, 2021-08-23):
```xml
Show recently used strings
```
**XAML binds it to `RestoreFlagsOnLaunch`** — `src/settings-ui/Settings.UI/SettingsXAML/Views/PowerRenamePage.xaml:90-97`:
```xml
```
**`RestoreFlagsOnLaunch` sets `PersistState`** — `src/settings-ui/Settings.UI/ViewModels/PowerRenameViewModel.cs:209-225`.
**`PersistState` restores text + flags on launch** — `src/modules/PowerRename/PowerRenameUILib/PowerRenameXAML/MainWindow.xaml.cpp:924-945`:
```cpp
bool persistState{ CSettingsInstance().GetPersistState() };
...
if (persistState) {
flags = CSettingsInstance().GetFlags(); // restores option flags
textBox_search().Text(LastRunSettingsInstance().GetSearchText().c_str()); // restores last search text
textBox_replace().Text(LastRunSettingsInstance().GetReplaceText().c_str());// restores last replace text
}
```
The separate MRU/auto-complete path is gated by `GetMRUEnabled()` (same file, ~L962/L974), driven by the *other* toggle.
## Steps to reproduce
1. Settings → PowerRename → Auto-complete → turn **on** "Show recently used strings".
2. Rename with PowerRename: Search=`PERSISTME`, Replace=`DONEZO`, enable "Use regular expressions", Apply.
3. Re-open PowerRename on any file → the Search/Replace fields **and** the regex flag are pre-filled from the last run (`power-rename-last-run-data.json` = `{"SearchText":"PERSISTME","ReplaceText":"DONEZO",...}`).
## Suggested fix (wording only — no code/binding change)
This is a resource-string *value* improvement, not a key swap (the keys/bindings are correct, and there is no orphaned "correct" string to re-point to). Rewrite one entry in `src/settings-ui/Settings.UI/Strings/en-us/Resources.resw`:
```xml
Restore last-used search & replace values on launch
```
Optionally add a `.Description` ("Pre-fills the Search/Replace fields and option flags with the values from the previous run."). en-us is the source of truth; localized resw files are regenerated by the loc pipeline.
**Optional UX nicety:** move the toggle from the "Auto-complete" group to the "Behavior" group (next to "Use Boost library"), since it isn't an auto-complete feature.
## Environment
- PowerToys version: **0.100.1.0** · Windows 11
- Found during PowerRename release-checklist verification (item: *"Enable/disable Show values from last use"*).
> Related: closed issue #28135 ("Disabling PowerRename's 'show recently used strings'…") shows users already conflate this toggle's name with the MRU feature.
Contributor guide
Research direction
Open src/settings-ui/Settings.UI/Strings/en-us/Resources.resw and find PowerRename_Toggle_RestoreFlagsOnLaunch.Header; compare it with the binding in SettingsXAML/Views/PowerRenamePage.xaml. Update the resource value to describe restoring the last-used search and replace values on launch, optionally adding the described explanation, while leaving the key and binding unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, xml
- Domain
- content, desktop
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100