This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: Replace the search dialog with a search bar
Type: enhancement Stage: patch review
Components: IDLE Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, markroseman, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2018-10-13 21:02 by taleinat, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 9855 open taleinat, 2018-10-13 21:06
Messages (11)
msg327672 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-13 21:02
Search dialogs are clunky and arguably outdated. Most modern editors, IDEs and browsers use a search bar instead.

I created a search bar for IDLE as an extension years ago, it can be found on PyPI as "SearchBar". I hadn't updated it in recent years and it doesn't work with modern IDLE. I doubt that it has seen much use.

I suggest that having this built into IDLE would be a great benefit to its users.
msg327673 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-13 21:15
See PR GH-9855 for a working implementation based on my old "SearchBar" extension.
msg327718 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-10-14 18:07
+1 on adding this to IDLE

I haven't looked at the code or all the details yet, but just downloading the patch and running code in IDLE, this is a nice change.
msg327741 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-15 10:52
Thanks for giving it a try, Cheryl, I'm glad you like it!
msg378509 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-10-12 17:17
Notepad++, which I use, uses a tabbed dialog for search and replace, which I think I would like to somewhat imitate.  Or just have one search and replace dialog.  I need to experiment.  I don't like the Firefox toolbar and consider it buggy.  In any case, it and browsers in general do not do replace.  Maybe yours is better.
msg378520 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2020-10-12 19:39
The version in the PR is modeled after similar features in IDEs, not browsers. I mentioned browsers since they are very commonly used, and to the best of my knowledge all modern browsers use search bars. Therefore, as a UI element, search bars are now commonplace, unsurprising, and require no training to use.

As for replace, while many IDEs use a bar, many word processors do indeed still use a dialog for search/replace, and I've seen text editors use a bar for search but a dialog for replace.

I first implemented this for my personal use, since I much prefer bars to dialogs. But I can see the argument that they can be harder to use for novice users.

If we decide not to go with this path, I'll try to extract some of the improvements made to the search engine, such as highlighting all matches, into a PR improving the existing search and replace dialogs.
msg378521 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2020-10-12 19:44
I should mention one *major* advantage of using a search/replace bar: Live highlighting of matches *as you type*. It really is a vastly better experience; if you haven't tried it yet, please do.
msg378522 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-10-12 20:24
Notepad++ Find by marks all matches in the current doc as 'found', with a distinct (darker) highlight for the 'selected' found.  Double clicking selects a word, as in IDLE, *and* finds all matches.  One can then either cut/copy/replace the selection, as in IDLE, *or* look at other matches in the file.

Notepad++ also offers options to (in addition) 'Find all' in current doc or all opened docs.  This lists the hits in a separate box, as with IDLE's Find all.  Double clicking on a hit line goes to that line.  (Easier than RtClick/goto.)

I suspect I would find live highlighting annoying.  Why would having all 'a's on a page light up when I type 'a' be a plus?  But I will try your patch when we are ready to focus on search/replace/find.  

I have mentioned elsewhere that I might go for a minimal search box on the status line separate from the dialog(s).
msg379445 - (view) Author: Mark Roseman (markroseman) * Date: 2020-10-23 15:46
Tal, I gave it a try, I think this is great. For "simple" searches (i.e. what people do most of the time), a search bar is a lot less klunky than bringing up a dialog.  

Patch seems to work well, would just need a cosmetic update (ttk widgets etc.).

Things may get a bit complex for users if too many things are stuck in there, and you run out of space real quick when you have a fairly narrow window. 

My suggestion would be to keep it to just a simple search without options, and keep the rest (search with options, replace) in a separate unified dialog that merges the current "Search Dialog" and "Replace Dialog". A button ("...") in the search bar to open that dialog would make for a nice transition between the search bar and the dialog.
msg379473 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2020-10-23 19:55
Thanks Mark, your feedback is greatly appreciated!
msg379474 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2020-10-23 19:58
> Why would having all 'a's on a page light up when I type 'a' be a plus?

The auto-highlighting could be disabled for 1-2 character search queries, or delayed for a bit to allow typing to continue.

I find auto-highlighting very useful when I'm looking for "where is this variable used?", I just Ctrl-f, start typing its name, and get the answer very quickly, even if I haven't typed the whole name.

Also, this PR supports Alt+/ completion in the search bar, which makes the above even more effective.
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79157
2020-10-23 19:58:06taleinatsetmessages: + msg379474
2020-10-23 19:55:26taleinatsetmessages: + msg379473
2020-10-23 15:46:10markrosemansetnosy: + markroseman
messages: + msg379445
2020-10-12 20:24:20terry.reedysetmessages: + msg378522
2020-10-12 19:44:40taleinatsetmessages: + msg378521
2020-10-12 19:39:31taleinatsetmessages: + msg378520
2020-10-12 17:17:17terry.reedysetmessages: + msg378509
2018-12-11 22:28:14terry.reedysetversions: - Python 3.6
2018-10-15 10:52:57taleinatsetmessages: + msg327741
2018-10-14 18:07:08cheryl.sabellasetmessages: + msg327718
2018-10-13 21:15:06taleinatsetmessages: + msg327673
2018-10-13 21:06:01taleinatsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request9224
2018-10-13 21:02:19taleinatcreate