[GNC-dev] Ideas for account type-ahead modification

John Ralls jralls at ceridwen.us
Fri Mar 27 13:13:45 EDT 2020



> On Mar 27, 2020, at 8:16 AM, jean <ripngo at gmail.com> wrote:
> 
> I gave that a shot. See
> https://github.com/jeanlaroche/gnucash.git
> eea20a8da..d0ee8a161  fix_autocompletion_master
> But see comments below:
> 
>> Imagine we have the following account tree:
> >
>> Assets:Cash
>> Assets:Bank
>> Income:Salary
>> Expenses:Bets
>> Expenses:Bets:Blue
>> Typing 'et' will filter the list of accounts to show to
>> Assets:Cash
>> Assets:Bank
>> Expenses:Bets
>> Expenses:Bets:Blue
>> Subsequently typing ":" will autocomplete 'et' to 'ets:' and reduce the list to >
>> Assets:Cash
>> Assets:Bank
>> Expenses:Bets:Blue
> 
> I haven't implemented the autocomplete because in most cases I"m not sure what to do:
> 
> What if you have:
> 
> Assets:Cash
> Expenses:Bets
> Forgeta:Foo
> 
> All three match "et" but what do we do if the user type ":" ? In which situation can we autocomplete? In the current search, ":" autocompletes the current match (i.e., it moves the cursor to the next :). But in the mixed search, it's not clear what it should do.
> Should I treat ":" as .*: (non greedy) in regexp? I think that would be pretty cool and it would be consistent with the legacy behavior.
> 
> In any case, the merging of the two searches actually does work currently and is fairly intuitive. So if you guys like this solution then I could remove the option, which would be really good!
> 

That's pretty cool, better than the preference.

As for typing et: I think the separator (note that it can be set with a preference, ':' is only the default) would act as a barrier so at that point only accounts that have children would match so Expenses:Bets would drop out.

Regards,
John Ralls




More information about the gnucash-devel mailing list