Bug 140726 - func keyword entry on Elements pane should insert a function name suggesting user to modify it
Summary: func keyword entry on Elements pane should insert a function name suggesting ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Po-Yen Huang
URL:
Whiteboard: target:7.4.0 target:7.3.0.2
Keywords: difficultyBeginner, easyHack, skillDesign, topicDesign
Depends on:
Blocks:
 
Reported: 2021-03-01 07:16 UTC by Mike Kaganski
Modified: 2022-01-03 09:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
func element in Math (35.45 KB, image/png)
2021-03-01 07:16 UTC, Mike Kaganski
Details
Comparison of selection of proposed placeholders (23.07 KB, image/png)
2021-03-04 09:32 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2021-03-01 07:16:35 UTC
Created attachment 170137 [details]
func element in Math

Currently the 'func' entry in Math' Elements pane (screenshot in the attachment) inserts this formula:

> func func(<?>)

I suppose that for a beginner user, it is not obvious here that the second "func" in the inserted template is meant to be changed (it is not the usual placeholder "<?>").

I suggest either change the insertion into

> func <?>(<?>)

which would make the "<?>" the formula name, but that is no worse than now, and still suggests user to modify it, or alternatively, to something like

> func yourfuncname(<?>)

which would still suggest that the function name is not set in stone (but then the question arises in translatability of this name, because it would only be surely telling to English-speaking audience).

See https://ask.libreoffice.org/en/question/295827/can-i-add-functions-to-math/, where user had hard time finding this in the UI, possibly because of this.
Comment 1 Heiko Tietze 2021-03-02 08:39:14 UTC
If there is no way of translating newfuncname (as proposed on ask.libo) or yourfuncname and something generic like "<abc>" or "<foo>" is odd, the only way to go seems this "<?>". Any other idea?

Code pointer:
starmath/inc/strings.hxx => #define RID_FUNCX               "func func(<?>) "
Comment 2 Heiko Tietze 2021-03-04 09:09:32 UTC
We discussed this topic in the design meeting.

   + func <?>(<?>) is hard to understand
   + func <name>(<?>) is not localizable, but this function is 
     likely used by experts and the terminology is well-known

Code pointer in comment 1.
Comment 3 Mike Kaganski 2021-03-04 09:16:01 UTC
(In reply to Heiko Tietze from comment #2)
>    + func <?>(<?>) is hard to understand
>    + func <name>(<?>) is not localizable, but this function is 
>      likely used by experts and the terminology is well-known

Note that in Math, the "<?>" is *well-known* in the formula text window: it is always inserted wherever any placeholder is needed. This same insertion *already* has it: "func func(<?>)".

The only difference here is that this "<?>" is *usually* shown as a box in the upper "preview" window, and in this case, it would not appear there as the box, but as literal "<?>". However, *for users of Math*, "<?>" would be more likely to be familiar than any other placeholder syntax.
Comment 4 Mike Kaganski 2021-03-04 09:32:40 UTC
Created attachment 170205 [details]
Comparison of selection of proposed placeholders

(In reply to Heiko Tietze from comment #2)

The screenshot shows a combined image of how Math *highlights* the parts of placeholders in the upper panel. In case of "<?>", clicking on it in the upper panel draws the dotted rectangle around the whole placeholder. For "<name>", it is treated as three distinct elements - "function <", text "name", and operator "greater than >". This even makes the opening "<" and closing ">" use different fonts and look inconsustent.
Comment 5 Heiko Tietze 2021-03-04 10:10:06 UTC
(In reply to Mike Kaganski from comment #3)
> Note that in Math, the "<?>" is *well-known*...

Has been taken into account. As always: UX does recommendations. Feel free to go with <?> instead of <name>.
Comment 6 Po-Yen Huang 2021-12-24 02:47:17 UTC
I pushed a possible fix to gerrit: https://gerrit.libreoffice.org/c/core/+/127393
Please review it :-)
Comment 7 Commit Notification 2021-12-24 07:05:49 UTC
Jeff Huang committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/54115790926a5964534472dff7e4661ea34acb28

tdf#140726 Change func func(<?>) to func <?>(<?>) in Math

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2021-12-28 12:37:43 UTC
Jeff Huang committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/b404a6fbbd254c19599b81a3b2f9ee85f0ac8c04

tdf#140726 Change func func(<?>) to func <?>(<?>) in Math

It will be available in 7.3.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.