Bug 160847 - [EDITING] function syntax bubble only triggered on backspace when AutoInput disabled
Summary: [EDITING] function syntax bubble only triggered on backspace when AutoInput d...
Status: RESOLVED DUPLICATE of bug 144860
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2 all versions
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks:
 
Reported: 2024-04-28 09:42 UTC by symbioma.trix
Modified: 2024-05-14 11:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Demonstration of autoinput backspace bug. (1.69 MB, video/mp4)
2024-04-28 21:38 UTC, symbioma.trix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description symbioma.trix 2024-04-28 09:42:26 UTC
Description:
When autoinput is disabled, it still gets activated (shows functions and inserts them on enter) after pressing backspace.
This issue has been around since at least 11/2016, as mentioned in an offhand comment here (https://bugs.documentfoundation.org/show_bug.cgi?id=104185#c3). Should be at least version 5.2, I haven't verified how far back it goes or whether it's been fixed in version 24 (but I see nothing in the release notes about it at least).

Steps to Reproduce:
1. Tools -> Turn off AutoInput.
2. Type "=cc" in any cell.
3. Press backspace.
4. Press enter; the function replaces is added to the cell as if autoinput is enabled.

Actual Results:
On pressing backspace, the autoinput menu will pop up with functions corresponding to the remaining letter c (ceiling, ceiling.math, ceiling.precise and 56 more);
on pressing enter, cell content is changed to "=CEILING()".

Expected Results:
Cell contents remain "=C", cursor goes to cell below.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.3.7.2 (x64) / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 12; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: en-US (en_IL); UI: en-US
Calc: CL
Comment 1 ady 2024-04-28 18:01:53 UTC
Is this happening in a specific worksheet?

I would suggest closing LO completely, open Calc anew with an empty new spreadsheet, review the AutoInput setting to set it OFF and retest in such condition, with nothing else in the worksheet.

Perhaps it would be also worth testing with LO's safe mode and/or resetting the profile.

FWIW, I was not able to replicate the behavior using several versions of LO from 7.2 to 7.6.
Comment 2 symbioma.trix 2024-04-28 18:47:29 UTC
I did some more testing:
- If I open a new sheet with autoinput having been turned off beforehand, then it will *not* exhibit the backspace anomaly, as you say. Meanwhile, other open sheets still do.
- In this new sheet, if I turn autoinput on, type something which triggers autoinput, then turn autoinput off, then it will once again exhibit the backspace anomaly.
- The same is true for an older installation that I have, 6.4.7.2, 

So it appears to be some sort of global flag for the sheet, set once on init, and by usage, if I were to take a wild guess.

In any case, that's good enough for me, as I intend to leave it off. Thanks.
Comment 3 ady 2024-04-28 19:12:43 UTC
So let's make this explicit.

STR:

1. Start with AutoInput set to ON.
2. On an empty cell, type:
=cc

3. While still in cell's edit mode, set AutoInput to OFF by using the mouse on menu Tools > AutoInput.

4. Press the backspace key, so the content of the cell is now:
=c

5. Press [ENTER] > Calc reacts as if AutoInput was still ON.


Since AutoInput is now OFF, this behavior will not happen again, until and unless the same starting conditions and steps are reproduced again.

This issue is also avoided by turning AutoInput OFF before starting the edition of the cell.

IMHO, this is a very minor issue, happening only under very specific steps, and it is "solved" by itself.
Comment 4 symbioma.trix 2024-04-28 21:38:04 UTC
Not exactly. The case you described is much more specific. What matters is, to have had autoinput fire off once whilst ON within the sheet. If it has fired off once in the open sheet, I always get suggestions on backspace until reopening (in fact, you can even reopen with autoinput=ON, just turn it off before the first event and you're good).

I'll attach a demonstration, that should make it easier to understand.
Comment 5 symbioma.trix 2024-04-28 21:38:57 UTC
Created attachment 193885 [details]
Demonstration of autoinput backspace bug.
Comment 6 m_a_riosv 2024-04-28 23:23:34 UTC
Perhaps the interpretation of what Autoinput does is not correct.

https://help.libreoffice.org/24.8/en-US/text/scalc/01/06130000.html?&DbPAR=CALC&System=WIN
Comment 7 ady 2024-04-29 00:31:18 UTC
(In reply to symbioma.trix from comment #4)
> Not exactly.

So, if AutoInput was ON at any time since the specific spreadsheet was opened, then even after setting it OFF, the backspace will trigger it again, for that specific cell edition.

Setting AutoInput to OFF (permanently), saving the spreadsheet and reloading it will avoid the trigger when using backspace.

FWIW, I can see one advantage with the current behavior: when I set AutoInput to OFF in a specific session, normally Calc will not trigger the function's suggestions, unless I made some typo (so I use backspace). Some users would consider this behavior useful, whether it is intentional or not; some kind of middle choice between ON vs OFF.

For users permanently setting AutoInput to OFF, this will not be an issue.

IMHO, I still see this behavior as a minor issue, FWIW.
Comment 8 ady 2024-04-29 00:33:26 UTC
(In reply to ady from comment #7)
> (In reply to symbioma.trix from comment #4)
> > Not exactly.
> 
> So, if AutoInput was ON at any time since the specific spreadsheet was
> opened, then even after setting it OFF, the backspace will trigger it again,
> for that specific cell edition.

Sorry, not "that specific cell edition" but rather for "that specific session on that spreadsheet".
Comment 9 symbioma.trix 2024-04-29 13:41:20 UTC
From your description, I take it that cleared things up, I'm glad.

Well, I can speak on behalf of no other users but myself and own experience. As a long time (hobbyist) programmer, I've got hard wired "muscle memory" for enter = newline, tab = autocomplete, so that role reversal in libre has been quite a hindrance for years, when attempting to type some complex cell formulae and ending up repeatedly having to change back whatever rogue function just overrode the $D I was trying to change to $E (because autocorrect changes happen to kill the in-cell undo stack, mind). Finally got fed up and found a way to disable the feature altogether on the docs, only to see it was still happening, filed a bug report as such. I did have a glimpse at the code, and whilst autoinput only shows up in ~4 places in sc, everything around it seems to be really tangled up (understandably), not really for me.

We are in agreement about this being a minor issue, that's why I set it as such in the first place. Perhaps even trivial now, since the workaround of reopening the sheet and leaving the setting off (at least since libre 7+) is relatively simple.
Comment 10 Stéphane Guillou (stragu) 2024-05-13 11:54:49 UTC
(In reply to m_a_riosv from comment #6)
> Perhaps the interpretation of what Autoinput does is not correct.
> 
> https://help.libreoffice.org/24.8/en-US/text/scalc/01/06130000.
> html?&DbPAR=CALC&System=WIN
Agreed, AutoInput is distinct to function syntax suggestion/autocompletion, or at least _should_ be.
Such buggy overlap is already tracked in bug 144860, let's mark as duplicate.

*** This bug has been marked as a duplicate of bug 144860 ***
Comment 11 ady 2024-05-13 17:21:21 UTC
(In reply to Stéphane Guillou (stragu) from comment #10)

@Stéphane,

FWIW, you modified the Summary field, from:
[EDITING] Autoinput triggered when disabled on backspace

to:
[EDITING] function syntax bubble only triggered on backspace when AutoInput disabled

IMHO, the new wording is slightly confusing.

I think that the original report is that, as of the current "double function" of the AutoInput setting, when the setting is OFF then the backspace key should not trigger the bubble tooltip auto-completion of functions, just as any other key does not trigger the auto-completion.

The new wording might be interpreted as "only the backspace key is working correctly, and other cases/keys should behave in the same way", which is somewhat the opposite of this request, IIUC. The request in this tdf#160847 seems to be that the backspace key should not trigger the auto-completion of functions (just as any other key does not trigger the auto-completion either) when AutoInput is OFF.

Moreover, some users might think of the actual auto-completion as a separate feature than the bubble: the bubble may suggest (only) but not necessarily imply auto-complete the content as well.
Comment 12 Stéphane Guillou (stragu) 2024-05-14 10:37:07 UTC
(In reply to ady from comment #11)
> (In reply to Stéphane Guillou (stragu) from comment #10)
> IMHO, the new wording is slightly confusing.
The original wording confused two features, using "AutoInput" to describe what I call "function syntax tooltip". I renamed it to be more precise while sill describing the original observation, but changing the expectation to _always_ having the function help tooltip on, regardless of AutoInput.

> I think that the original report is that, as of the current "double
> function" of the AutoInput setting, when the setting is OFF then the
> backspace key should not trigger the bubble tooltip auto-completion of
> functions, just as any other key does not trigger the auto-completion.
Fair enough, it does seem like an inconsistency.

> The new wording might be interpreted as "only the backspace key is working
> correctly, and other cases/keys should behave in the same way", which is
> somewhat the opposite of this request, IIUC. The request in this tdf#160847
> seems to be that the backspace key should not trigger the auto-completion of
> functions (just as any other key does not trigger the auto-completion
> either) when AutoInput is OFF.
I understood the original request to be a band-aid solution that consolidates the confusion between the two features -  even if it makes things more consistent. what should really happen is that the AutoInput switch shouldn't influence the function syntax tooltip feature at all, a request that should be centralised into bug 144860.

> Moreover, some users might think of the actual auto-completion as a separate
> feature than the bubble: the bubble may suggest (only) but not necessarily
> imply auto-complete the content as well.
The difference is: AutoInput helps autocomplete based on _previous, user-entered_ data, whereas the function syntax tooltip helps understand and autocomplete formulas based on function syntax.

But of course, all of the above is based on my understanding of what the features are, and I might be missing something.

For good measure, I looked at where the behaviour started exactly.
Bibisected with linux-64-5.2 repo to build [2f139c1caf425a18bca2e36611c5aaddc0cbc7e0] which points to:

commit b2a82d9bb256516ac589350579b90f43b68bd452
author	Keigo Kawamura 	Mon Nov 16 20:39:06 2015 +0900
committer	Eike Rathke 	Mon Jan 18 17:42:20 2016 +0000
tdf#95878 made more useful function suggestion system in formula editing
Reviewed-on: https://gerrit.libreoffice.org/20035

Before that commit, turning off AutoInput would turn off the (simple) function tooltip. After the commit, we have the inconsistency.

Keigo is not active anymore, but Eike helped out with the patch and had follow-up commits.
Eike, what do you think about:
- this inconsistency in particular?
- how the two features mix? (AutoInput vs "function syntax help tooltip")
In my opinion, the two should be kept separate, and the users should be able to turn off AutoInput without turning off the function syntax tooltip.
Comment 13 ady 2024-05-14 11:23:53 UTC
(In reply to Stéphane Guillou (stragu) from comment #12)

>  I renamed it to be more precise while
> sill describing the original observation, but changing the expectation to
> _always_ having the function help tooltip on, regardless of AutoInput.

There are several different issues:

* Two seemingly independent features that are currently entangled (AutoInput, and functions' tooltip+suggestions+potential autocompletion of functions), and your point is that they should be separated (with 2 independent settings).

* Not every user wants the function's tooltip "always" ON (e.g. in this report), which triggers the functions' suggestions and potential autocompletion.

* Having the tooltip available (shown/displayed) with the functions' suggestions and the potential autocompletion of functions could also be separated flags each.