Qalculate / qalculate-gtk

Qalculate! GTK+ UI
https://qalculate.github.io/
GNU General Public License v2.0
953 stars 71 forks source link

After clearing history, expression_history items are still present in qalculate-gtk.cfg #359

Open Gitoffthelawn opened 2 years ago

Gitoffthelawn commented 2 years ago

After manually clearing the history, expression_history items (with values) are still present in qalculate-gtk.cfg.

Tested on Qalculate v4.0.0

hanna-kn commented 2 years ago

Manually clearing the history (using the history context menu) does not affect the history of the expression entry.

Gitoffthelawn commented 2 years ago

Manually clearing the history (using the history context menu) does not affect the history of the expression entry.

I understand how the regular history is used, but I don't understand how/when expression history is used. What does it do?

Adding an option to clear it from the expression area context menu would be good (just like for history).

Gitoffthelawn commented 1 year ago

@hanna-kn When/where is the expression history used? How does one clear it (besides manually editing qalculate-gtk.cfg)?

hanna-kn commented 1 year ago

When/where is the expression history used?

It is used in the expression field, when Up/Down or PageUp/PageDown keys, or the upper left button in the right keypad, is pressed.

How does one clear it (besides manually editing qalculate-gtk.cfg)?

Use "Clear History" in the context menu of the expression field. (It is also affected by the "Clear history on exit" option.)

Gitoffthelawn commented 1 year ago

Thanks so much for your reply (and for Qalculate) Hanna.

When/where is the expression history used?

It is used in the expression field, when Up/Down or PageUp/PageDown keys, or the upper left button in the right keypad, is pressed.

Thanks. Just for anyone else reading this, when @hanna-kn wrote "the right keypad", she is referring to the right on screen keypad within Qalculate, not your keyboard's keypad.

How does one clear it (besides manually editing qalculate-gtk.cfg)?

Use "Clear History" in the context menu of the expression field. (It is also affected by the "Clear history on exit" option.)

Ah, thanks.

I tried this, and it basically works, but has 2 issues:

  1. It doesn't perform an immediate write of qalculate-gtk.cfg, so the data in the file isn't removed right away. I'm not sure if this is intentional or an oversight.
  2. One set of history items is still maintained in qalculate-gtk.cfg even after the clear function is performed and a write operation is forced by exiting Qalculate. For example:
    history_expression=12/16
    history_parse=12 ∕ 16
    history_result=0.75
hanna-kn commented 1 year ago

It doesn't perform an immediate write of qalculate-gtk.cfg, so the data in the file isn't removed right away. I'm not sure if this is intentional or an oversight.

This is intentional. qalculate-gtk.cfg is never written before exit.

One set of history items is still maintained in qalculate-gtk.cfg even after the clear function is performed and a write operation is forced by exiting Qalculate.

I'm unable to reproduce this. Is no history item visible before exit?

Gitoffthelawn commented 1 year ago

It doesn't perform an immediate write of qalculate-gtk.cfg, so the data in the file isn't removed right away. I'm not sure if this is intentional or an oversight.

This is intentional. qalculate-gtk.cfg is never written before exit.

Got it. Thanks.

One set of history items is still maintained in qalculate-gtk.cfg even after the clear function is performed and a write operation is forced by exiting Qalculate.

I'm unable to reproduce this. Is no history item visible before exit?

No history items are visible, but after exit, 1 set of items (as in example provided above) are still present in qalculate-gtk.cfg.

Gitoffthelawn commented 1 year ago

Hmmm... I performed additional testing, and now, performing the clear function in the expression input field does clear the expression history within Qalculate, but history data is still present in qalculate-gtk.cfg.

IOW, the first time, it removed all history except 1 set from that file, and now no history is removed.

I exit Qalculate each time after performing the clear function.

Gitoffthelawn commented 1 year ago

Oh wait, hold the door... update coming...

Gitoffthelawn commented 1 year ago

I think I see what's going on... it's a UI/UX fiasco. There are 2 types of history being saved, with 2 similar menuitems to clear the 2 different types of history. Each menuitem is only accessible by right-clicking on a different region of the Qalculate window. Yikes.

Perhaps we can work together to improve the UI/UX. Let's take a step back and think about what the user may want:

  1. The option to clear all types of history every time Qalculate is closed. I think there is a pref for this, and although I haven't tested it personally, let's assume it deletes all history. If I'm mistaken, let's get that nice and tidy.
  2. The option to clear all history within the current Qalculate session. This is the functionality that is missing and is spread across 2 different menuitems, each accessible only by clicking on different areas of the window. Could this UX be improved by adding single menuitem or button to perform this function?
hanna-kn commented 1 year ago

Note that it is possible to add a keyboard shortcut or custom button which clears both types of history.