Bug 150494 - missing default value for LanguageTool "Base URL"
Summary: missing default value for LanguageTool "Base URL"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Rafael Lima
URL:
Whiteboard: target:7.5.0 target:24.2.0 target:7.6...
Keywords: difficultyMedium, easyHack, skillDesign, topicUI
Depends on:
Blocks:
 
Reported: 2022-08-19 09:25 UTC by Daniel Naber
Modified: 2023-06-14 20:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of empty settings for LanguageTool (20.33 KB, image/png)
2022-08-19 09:26 UTC, Daniel Naber
Details
server settings as used in the LT browser add-on (22.25 KB, image/png)
2022-08-19 14:35 UTC, Daniel Naber
Details
Screenshot of the patched dialog (83.28 KB, image/png)
2022-11-03 12:56 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Naber 2022-08-19 09:25:26 UTC
Description:
There's no good default for the LanguageTool "Base URL" setting, and users don't know what to add there.

Steps to Reproduce:
1. Got to Tools -> Options -> Language Settings -> LanguageTool Server Settings. 
2. Click "Enable LanguageTool". 

Actual Results:
There's no useful default for the "Base URL", and users don't know what to add there.

Expected Results:
"https://api.languagetool.org/v2" would be a good default.



Reproducible: Always


User Profile Reset: No



Additional Info:
n/a
Comment 1 Daniel Naber 2022-08-19 09:26:10 UTC
Created attachment 181881 [details]
screenshot of empty settings for LanguageTool
Comment 2 Rafael Lima 2022-08-19 13:09:25 UTC
I am not sure we could recommend some specific tool in the UI itself.

However, more information can be provided in the Help page, which today is missing. Clicking the Help button in the dialog you mentioned will land in [1] which has not been written yet.

[1] https://help.libreoffice.org/7.4/en-US/text/shared/05/err_html.html?System=UNIX&DbPAR=WRITER&HID=cui/ui/langtoolconfigpage/OptLangToolPage

We could possibly list a few options and provide more information in the help page.
Comment 3 Daniel Naber 2022-08-19 14:34:48 UTC
I don't think a feature that requires the user to read the help pages and copy configuration values from there has a good usability.

If you're not happy with one specific default, you could change the UI to let the user choose between a server on the internet and a local server, like our browser add-on does. I'll attach a screenshot of that.
Comment 4 Daniel Naber 2022-08-19 14:35:25 UTC
Created attachment 181886 [details]
server settings as used in the LT browser add-on
Comment 5 Rafael Lima 2022-08-19 19:07:01 UTC
@Heiko, how do you think we should deal with this issue in the new LanguageTool feature?

The help page surely needs to be written, but should we also provide a default in the UI ?
Comment 6 Heiko Tietze 2022-08-22 08:54:11 UTC
If there is no sane alternative for now to what Daniel proposes I think setting this default is convenient. Alternatively we could insert it as hint text, although many users might not understand the difference between the truly entered value and the grayed out tip. So my take is to follow Daniels proposal.
Comment 7 Heiko Tietze 2022-08-25 14:55:40 UTC
We discussed this topic at the ESC. Using the default URL is a convenience feature and we should follow Daniel's suggestion. Furthermore, I recommend to add to URL and API key a placeholder text like "Leave this field empty to access the free version".

Code pointer:
* cui/uiconfig/ui/langtoolconfigpage.ui
* cui/source/options/optlanguagetool.cxx, set_placeholder_text()
Comment 8 Rafael Lima 2022-11-03 12:56:25 UTC
Created attachment 183389 [details]
Screenshot of the patched dialog

I created a patch to set the placeholder text in this dialog (see attached image).

Let me know if this is OK.

The patch is available for review at:

https://gerrit.libreoffice.org/c/core/+/142197
Comment 9 Rafael Lima 2022-11-03 12:58:09 UTC
BTW just now I noticed that I added the URL as "placeholder" text as well.

Let me know if I should change it to regular text.
Comment 10 Heiko Tietze 2022-11-03 13:24:08 UTC
(In reply to Rafael Lima from comment #9)
> BTW just now I noticed that I added the URL as "placeholder" text as well.

I like it visually but the text is actually empty and get_text() will not return the placeholder. Could be easily solved by "if isEmpty()". Or maybe I'm wrong. Have you check the functionality?
Comment 11 Rafael Lima 2022-11-03 16:29:34 UTC
(In reply to Heiko Tietze from comment #10)
> I like it visually but the text is actually empty and get_text() will not
> return the placeholder. Could be easily solved by "if isEmpty()". Or maybe
> I'm wrong. Have you check the functionality?

I changed the design a bit. Now the dialog works as follows:

1) The first time the user enables the tool via the checkbox, the default URL is added as real text (not as placeholder text)

2) If the user deletes the URL, a placeholder text says "Leave this field empty to use the default URL"; Hence, if no URL is set the default URL is used

3) If a different URL is defined, then it is the one saved and used by the tool
Comment 12 Commit Notification 2022-11-09 15:06:51 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2c8a760a18501acaa6e4ff2a2dee76b0bad275f1

tdf#150494 LanguageTool: Add placeholder text with default value info

It will be available in 7.5.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 13 Commit Notification 2023-06-14 18:59:41 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7c6c58197a84cf22789ca3dc97e863390c31a2f9

Related: tdf#150494 add placeholder text to the REST protocol field

It will be available in 24.2.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 14 Commit Notification 2023-06-14 20:20:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

Related: tdf#150494 add placeholder text to the REST protocol field

It will be available in 7.6.0.0.beta2.

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.