After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 348299 - typeahead-find broken in Categories list
typeahead-find broken in Categories list
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.6.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
evolution[categories]
Depends on:
Blocks:
 
 
Reported: 2006-07-21 21:38 UTC by Karsten Bräckelmann
Modified: 2008-12-02 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for evolution-data-server (13.51 KB, patch)
2008-11-06 21:24 UTC, Matthew Barnes
none Details | Review
Patch for evolution (4.08 KB, patch)
2008-11-06 21:28 UTC, Matthew Barnes
reviewed Details | Review
Corrected patch for evolution-data-server (15.36 KB, patch)
2008-11-06 21:31 UTC, Matthew Barnes
none Details | Review
Screenshot (69.01 KB, image/png)
2008-11-06 21:38 UTC, Matthew Barnes
  Details
Improved patch for evolution-data-server (19.96 KB, patch)
2008-11-07 04:18 UTC, Matthew Barnes
reviewed Details | Review
Revised patch for evolution-data-server (25.56 KB, patch)
2008-11-21 21:10 UTC, Matthew Barnes
needs-work Details | Review
Revised patch for evolution-data-server (25.85 KB, patch)
2008-11-28 18:48 UTC, Matthew Barnes
committed Details | Review
Revised patch for evolution (6.58 KB, patch)
2008-11-28 18:52 UTC, Matthew Barnes
committed Details | Review

Description Karsten Bräckelmann 2006-07-21 21:38:40 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.
Comment 1 Karsten Bräckelmann 2006-07-21 21:47:55 UTC
See bug 348269 for a related issue.
Comment 2 André Klapper 2006-07-25 10:54:05 UTC
confirming with 2.7.4.
Comment 3 Gilles Dartiguelongue 2007-03-31 15:08:02 UTC
confirming in 2.9/2.10 (this is an awesome bug btw)

see also bug #358391 for ideas on how to improve category selection.
Comment 4 Matthew Barnes 2008-11-06 21:24:55 UTC
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).
Comment 5 Matthew Barnes 2008-11-06 21:28:11 UTC
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?
Comment 6 Matthew Barnes 2008-11-06 21:31:25 UTC
Created attachment 122154 [details] [review]
Corrected patch for evolution-data-server

Bah, forgot to include the test program.
Comment 7 Matthew Barnes 2008-11-06 21:38:41 UTC
Created attachment 122155 [details]
Screenshot
Comment 8 Gilles Dartiguelongue 2008-11-06 23:59:12 UTC
can't check that myself now but, does it behave the same as in epiphany ? (just for consistency's sake)
Comment 9 Matthew Barnes 2008-11-07 00:32:04 UTC
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.
Comment 10 Matthew Barnes 2008-11-07 04:18:31 UTC
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.
Comment 11 Matthew Barnes 2008-11-15 18:45:05 UTC
Srini / Milan - Either of you guys care to test drive this?
Comment 12 Milan Crha 2008-11-19 16:04:35 UTC
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. :) ]
Comment 13 Matthew Barnes 2008-11-20 22:11:38 UTC
(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.
Comment 14 Milan Crha 2008-11-21 09:32:44 UTC
I'll wait for the updated patch, retest with it and report back.
Comment 15 Matthew Barnes 2008-11-21 21:10:44 UTC
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...
Comment 16 Milan Crha 2008-11-24 10:25:43 UTC
it crashes to me now:
Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 3900)

  • #0 g_data_set_internal
    at gdataset.c line 216
  • #1 IA__g_datalist_id_set_data_full
    at gdataset.c line 362
  • #2 g_object_real_dispose
    at gobject.c line 736
  • #3 gtk_object_dispose
    at gtkobject.c line 422
  • #4 gtk_widget_dispose
    at gtkwidget.c line 7829
  • #5 gtk_window_dispose
    at gtkwindow.c line 1972
  • #6 e_categories_dialog_dispose
    at e-categories-dialog.c line 192
  • #7 IA__g_object_unref
    at gobject.c line 2389
  • #8 e_categories_dialog_init
    at e-categories-dialog.c line 505
  • #0 IA__g_logv
    at gmessages.c line 395
  • #1 IA__g_log
    at gmessages.c line 517
  • #2 IA__g_return_if_fail_warning
  • #3 IA__gtk_entry_completion_set_model
    at gtkentrycompletion.c line 1027
  • #4 category_completion_build_model
    at e-category-completion.c line 94
  • #5 category_completion_categories_changed_cb
    at e-category-completion.c line 101
  • #6 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #7 IA__g_closure_invoke
    at gclosure.c line 767
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3244
  • #9 IA__g_signal_emit_valist
    at gsignal.c line 2977
  • #10 IA__g_signal_emit_by_name
    at gsignal.c line 3071
  • #11 idle_saver_cb
    at e-categories.c line 229
  • #12 g_idle_dispatch
    at gmain.c line 3924
  • #13 g_main_dispatch
    at gmain.c line 1814

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.
Comment 17 Matthew Barnes 2008-11-28 18:48:58 UTC
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()...
Comment 18 Matthew Barnes 2008-11-28 18:52:52 UTC
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.
Comment 19 Milan Crha 2008-12-01 10:46:32 UTC
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.
Comment 20 Matthew Barnes 2008-12-01 19:30:15 UTC
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.
Comment 21 Milan Crha 2008-12-02 08:56:14 UTC
(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.
Comment 22 Matthew Barnes 2008-12-02 16:42:11 UTC
Committed e-d-s patch (revision 9791) and evolution patch (revision 36826).

Also bumped evolution's eds_minimum_version to 2.25.3.