[GNC-dev] Register text selection

Geert Janssens geert.gnucash at kobaltwit.be
Tue May 22 05:41:04 EDT 2018


Op maandag 21 mei 2018 17:33:25 CEST schreef Robert Fewell:
> Sorry I did not explain the third option very well, have a transaction
> between say "Checking Account" and "Cash in Wallet" with both registers
> open.
> Position the cursor on a transaction somewhere in the "Checking Account",
> go back to the "Cash in Wallet" and edit a transaction between the two and
> commit it.
> If you go back to the "Checking Account" you will find the text highlighted
> where the cursor was.
> 
I don't know if I see the same as you do:
I have opened my checking account and a credit card account side by side.
I click in the description field of the same transaction in both windows. So 
the text cursor (the vertical "caret") is visible in both.
I now choose either window to make a change to the description field (one 
character or complete text makes no difference). After committing the change 
the description in the other window updates as well and the text caret ends up 
at the end of the new description.

So far this looks like expected behavior to me.

On the other hand while digging deeper into something I've hit some kind of a 
race condition: starting from the setup above
- I change the description field text in one window, but don't commit yet
- Then I change the description field text in the other window (to something 
different from the first window) and commit.
=> The description field in the first window remains as I set it in the first 
step while the field in the second window gets updated.
- then I commit the change in the first window
=> The description field in both windows now updates to the value I set in the 
first window.

This has been duly reported by David Carlson in the past:
https://bugzilla.gnome.org/show_bug.cgi?id=686052

While in itself this is correct behavior it can be very confusing if one of 
the changes happened accidentally. I don't know how hard it would be to catch 
such a situation and warn the user about it. I thought it worth pointing out 
though.

> I had a look at the "Edit Account Dialog" and the "Edit Customer Dialog",
> both do not preselect the first entry when opened and the cursor is at the
> beginning of that entry. When you tab to the next entry it is preselected
> but with the cursor hidden. If you type a letter, the cursor becomes
> visible as usual or if you left arrow it shows at the start or right arrow
> it shows at the end of the text.
> 
I see what you mean. And apparently I didn't fully grasp your original 
question. My replies were based on navigation in general, not what the initial 
state should be when opening a register.

I still believe we should have the selected field highlighted completely when 
first opening. The reasoning behind this is the register is our main data 
entry element so it should be optimized for efficient data entry.

Compare this for example with libreoffice calc. When you open a sheet you can 
start typing immediately. There is an active cell and whatever was in there 
will be replaced. The experience doesn't match 100% with the gnucash register 
because calc uses a dedicated field on top of the page for cell entry in 
addition to direct cell editing and they don't highlight the active cell when 
tabbing into it. I think that's less clear though and I see many new users of 
a spreadsheet getting confused on that. But the point I'm trying to make is 
that in both cases typing your first key will replace the full contents of the 
selected cell. This model is different when using mouse navigation.

While we're on this subject anyway I came across a request not so long ago to 
also save our register cursor when closing gnucash in addition to the tabs and 
windows that are open. I can't find it immediately but I think that's also a 
valid improvement.

> I think I will close my PR and start again if required after you have made
> your changes.

Ok.

Geert




More information about the gnucash-devel mailing list