GNOME Bugzilla – Bug 348299
typeahead-find broken in Categories list
Last modified: 2008-12-02 16:42:11 UTC
Open any Contact for editing, click the Categories button. GTK+ typeahead-find is available in this dialog, though broken. Looks to me like the info that is being used for typeahead-find actually is the enabled state. Set the focus to the list, hit the key for the first char of any Categorie. For me, this fails for all chars but 't' and 'f', regardless of a category actually beginning with these chars. 't' always selects the first enabled category, 'f' does the same for the first disabled one.
See bug 348269 for a related issue.
confirming with 2.7.4.
confirming in 2.9/2.10 (this is an awesome bug btw) see also bug #358391 for ideas on how to improve category selection.
Created attachment 122152 [details] [review] Patch for evolution-data-server Procrastinating doing more important work today... :) I wrote a GtkEntryCompletion subclass called ECategoryCompletion. Just create an instance and plug it into any GtkEntry using gtk_entry_set_completion() and you've got category completion. Autocompleting an item in a comma-delimited list is a real pain to get all the details right, but I think I got close. I added a small demonstration program so it can more easily be tested (libedataserverui/test-category-completion).
Created attachment 122153 [details] [review] Patch for evolution Adds category completion to the various editors: events, tasks, memos, and contacts. The other patch adds category completion to the category editor itself. Have I missed any spots?
Created attachment 122154 [details] [review] Corrected patch for evolution-data-server Bah, forgot to include the test program.
Created attachment 122155 [details] Screenshot
can't check that myself now but, does it behave the same as in epiphany ? (just for consistency's sake)
You're referring to the Topics field under Add Bookmark? Epiphany's autocompletion looks a tad more polished than mine. It adds a comma and space after it autocompletes, for one thing. But otherwise it looks about the same, I think. I'll compare their code to mine. Their topics list, however, is lightyears ahead of our categories list in terms of usability. It checkmarks topics as you type! May as well just scrap ours and steal theirs. Also, apologies to Guenther for hijacking his bug. I realize now he was complaining about typeahead not working in the tree view, not the entry. Must not have read carefully. Anyway, I'll see if I can address that along with the autocompletion enhancement.
Created attachment 122163 [details] [review] Improved patch for evolution-data-server Having studied Epiphany's EphyTopicsEntry I was surprised to find my first cut was actually pretty close to what they do. Here's an improved draft that more closely mimics Epiphany, including the "Add category" action as you type. We still lack the integration with the category list, but I think I'd prefer to tackle that separately. It may require API changes.
Srini / Milan - Either of you guys care to test drive this?
I did a basic test and here is what I found: a) there is a difference between choosing old category and creating new one, with old the ", " is appended, but with "create it now" is isn't. b) when choosing "create it now" in categories dialog, the new category isn't shown in the list. c) When moving out of the widget, it would be nice to strip out the last ", ", if any, so it will not try to add an "empty" category. d) 1) New event by double clicking in a day view 2) type something new in the category widget; choose "create it now" 3) close edit window, cancel changes 4) repeat from step 1; Right after step 2 you can see a warning on console: Gtk-CRITICAL **: gtk_entry_completion_set_model: assertion `GTK_IS_ENTRY_COMPLETION (completion)' failed Similar is shown when only doing 1) & 2) and clicking "Categories" button, closing it and doing from 1) again. e) Will you fix the categories dialog as requested in comment #0 too? [ I didn't read the code, I trust you. :) ]
(In reply to comment #12) a) Hmm, weird. The comma is appended in either case for me. b) Yes, the integration there is lacking. I mentioned that in comment #9 and comment #10. I think I'd rather deal with it separately. The categories dialog needs some usability love in other areas anyway. The completion shouldn't have to inform the list about new categories. ECategoriesDialog isn't calling e_categories_register_change_listener() to be notified of category changes. That's a bug. C) I think the code that parses the entry should be smart enough to ignore the trailing comma. A user could just as easily leave one behind while typing. That would be another ECategoriesDialog bug. d) Hmm, can't reproduce this one either. All I see is: (evolution:20333): e-data-server-DEBUG: Saving categories to "/home/mbarnes/.evolution/categories.xml" When I tell it to "create it now", which is expected. e) Yeah, plan to. I'll post a supplementary patch.
I'll wait for the updated patch, retest with it and report back.
Created attachment 123196 [details] [review] Revised patch for evolution-data-server This fixes a few things in the categories dialog: - Listens for category changes now, so adding a new category through the entry box should show up immediately in the category list. - Fixes the typeahead find in the category list that guenther reported. I changed nothing in e-category-completion.[ch], or the test program. I'm still not entirely happy with the dialog. I'd like for list items to be automatically checkmarked as you type in the entry box, like Ephiphany can do in its "Add Bookmark" dialog. And the add/edit category dialog is lame. We should come up with a way to do it directly in the categories dialog. But these are all future enhancements. I still can't reproduce that CRITICAL warning you mentioned...
it crashes to me now: Program received signal SIGSEGV, Segmentation fault.
+ Trace 210175
Thread NaN (LWP 3900)
I only called categories dialog from new Appointment dialog, added new category by "create this", close the categories dialog, close appointment dialog, call new appointment again, writing new category name to the list and clicking "create this" and the warning is there, just after "saving categories..." message. --------------------------------------------------------------------------- e) works fine. f) When checking categories by check boxes, there is no space between category's names and the comma.
Created attachment 123622 [details] [review] Revised patch for evolution-data-server Alright, think I got this finally. Crashed fixed, space added after the comma, and I figured out where that CRITICAL warning was coming. It's a two parter. Half of it was a dumb typo I made in category_completion_finalize()...
Created attachment 123623 [details] [review] Revised patch for evolution The other half was the fact that the category_completion_finalize() was never getting called because CompEditor was leaking references to all its CompEditorPages. This patch fixes the leaks.
It's better, but still has some issues: a) in categories dialog, when writing more than one by autocompletion and then checking/unchecking some of them, it forgets the autocompleted, because they are not checked. I guess we can turn off autocompletion in the Categories dialog. (You mentioned this before too, I think). b) Categories dialog is able to produce list of categories with "..., ,..." c) select list of categories, in categories dialog, close it with "Ok", open it again and see only the first category is checked in the list. When I remove that space after commas, all are checked. I'm wondering whether using spaces there is a good idea. Even the RFC is fine with that ( http://tools.ietf.org/html/rfc2445#section-4.8.1.2 and http://tools.ietf.org/html/rfc2445#section-4.3.11 ), then I guess the evolution code can rely on "without-space" a bit. I'm just mentioning a thought here.
Let's not lose focus here. I don't aim to fix all the category dialog issues under this bug. There's plenty of other issues filed under separate bugs. If we want to make a concerted effort to fix category handling, I've already tagged all the category-related bugs I could find with "evolution[categories]" in the status whiteboard. As for the issues you raised... a) As I mentioned in comment #10, that's an integration issue that I'd prefer to handle separately. The category list should checkmark items as you type, so that its tree model stays synchronized with the entry box contents. Then the problem should go away. I'll file a new bug report for it once the initial autocompletion work is committed. b) Separate issue. I can reproduce that in older Evolution versions by typing something like ", , ," in the entry box of the Categories dialog. The category parser should be made smarter. c) Separate issue. I can reproduce that in older Evolution versions by typing "Anniversary, Birthday" in the Categories field of the Appointment dialog. The category parser should be made smarter.
(In reply to comment #20) > The category parser should be made smarter. Hehe, sure, I'm fine with this, feel free to commit to trunk.
Committed e-d-s patch (revision 9791) and evolution patch (revision 36826). Also bumped evolution's eds_minimum_version to 2.25.3.