Bug 126389 - "New" in Basic IDE does not create a new macro
Summary: "New" in Basic IDE does not create a new macro
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillDesign, topicUI
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2019-07-14 19:20 UTC by Konstantin Kharlamov
Modified: 2023-08-28 09:16 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kharlamov 2019-07-14 19:20:13 UTC
# Steps to reproduce

1. Open `lowriter` or `localc` (reproducible in either)
2. Go to Tools → Macros → Edit Macros
3. Now, a macros editing window should appear. There, click the button that says "New" on it.

## Expected

A new empty macro should get created (probably should ask first about the language a user wants to use)

## Actual

An empty "lowriter" window gets opened (it works the same even if you followed the steps in "localc")
Comment 1 Oliver Brinzing 2019-07-15 17:06:04 UTC
(In reply to Konstantin Kharlamov from comment #0)
> ## Actual
> 
> An empty "lowriter" window gets opened (it works the same even if you
> followed the steps in "localc")

i can not confirm this with:

Version: 6.2.5.2 (x64)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: 

opens a macro editing window with

- My Macros & Dialogs
  - Standard
    - Module1
        Sub Main
        End Sub
Comment 2 Konstantin Kharlamov 2019-07-15 21:32:15 UTC
(In reply to Oliver Brinzing from comment #1)
> (In reply to Konstantin Kharlamov from comment #0)
> > ## Actual
> > 
> > An empty "lowriter" window gets opened (it works the same even if you
> > followed the steps in "localc")
> 
> i can not confirm this with:
> 
> Version: 6.2.5.2 (x64)
> Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
> CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
> Locale: de-DE (de_DE); UI-Language: en-US
> Calc: 
> 
> opens a macro editing window with
> 
> - My Macros & Dialogs
>   - Standard
>     - Module1
>         Sub Main
>         End Sub

Are you sure you followed the steps correctly? I recorded a video over here https://youtu.be/m11cwKqgftc is it not what you see? (P.S.: nvm the broken panel it just glitched out. I'm on my way fixing a local KDE installation)
Comment 3 Oliver Brinzing 2019-07-16 17:13:48 UTC
(In reply to Konstantin Kharlamov from comment #2)

> Are you sure you followed the steps correctly? I recorded a video over here
> https://youtu.be/m11cwKqgftc is it not what you see?

the "New" icon is for creating new documuments, not form macro libs/modules

if you want to add a new basic module:

- create a new document
- Menu Tools/Macros/Organize Macros/Libreoffice Basic...
- select "Untitled 1"
- press [New] button
- enter module name
- press [OK]
Comment 4 Konstantin Kharlamov 2019-07-16 17:17:57 UTC
(In reply to Oliver Brinzing from comment #3)
> (In reply to Konstantin Kharlamov from comment #2)
> 
> > Are you sure you followed the steps correctly? I recorded a video over here
> > https://youtu.be/m11cwKqgftc is it not what you see?
> 
> the "New" icon is for creating new documuments, not form macro libs/modules
> 
> if you want to add a new basic module:
> 
> - create a new document
> - Menu Tools/Macros/Organize Macros/Libreoffice Basic...
> - select "Untitled 1"
> - press [New] button
> - enter module name
> - press [OK]

I understand that this button does not create a new macro. And this is the gist of the report: it's a window specifically for working with macros, and this button either shouldn't be here, or (which would better) it should create a new macro.

Otherwise, why would it open an lowriter window? Why not, for example, localc?
Comment 5 Xisco Faulí 2020-01-20 16:05:25 UTC
Hello Konstantin Kharlamov,
A new major release of LibreOffice is available since this bug was reported.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 Konstantin Kharlamov 2020-01-25 20:12:34 UTC
(In reply to Xisco Faulí from comment #5)
> Hello Konstantin Kharlamov,
> A new major release of LibreOffice is available since this bug was reported.
> Could you please try to reproduce it with the latest version of LibreOffice
> from https://www.libreoffice.org/download/libreoffice-fresh/ ?
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the latest version.

Still reproducible in 6.3.4.2. Text from "about" window:

    Version: 6.3.4.2.0+
    Build ID: 6.3.4-2
    CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3;
    Locale: ru-RU (ru_RU.UTF-8); UI-Language: en-US
    Calc: threaded
Comment 7 Regina Henschel 2020-01-25 21:39:25 UTC
(In reply to Konstantin Kharlamov from comment #0)
> # Steps to reproduce
> 
> 1. Open `lowriter` or `localc` (reproducible in either)
> 2. Go to Tools → Macros → Edit Macros
> 3. Now, a macros editing window should appear. There, click the button that
> says "New" on it.
> 
> ## Expected
> 
> A new empty macro should get created (probably should ask first about the
> language a user wants to use)

That is the general tool for new documents. That exists in all modules. You see it too in the Math-Editor and in the Chart-Editor. It behaves the same in all places. Simple click uses the current preselected kind of action, for other actions open the list by clicking on the triangle and select the action.

BTW: It is a BASIC IDE, you cannot use it for other programming languages than BASIC.

For to get a new "macro", you simple write it. For getting a new module right-click the tabbar and choose item Insert > Basic-Module.
Comment 8 Konstantin Kharlamov 2020-01-25 21:54:15 UTC
(In reply to Regina Henschel from comment #7)
> (In reply to Konstantin Kharlamov from comment #0)
> > # Steps to reproduce
> > 
> > 1. Open `lowriter` or `localc` (reproducible in either)
> > 2. Go to Tools → Macros → Edit Macros
> > 3. Now, a macros editing window should appear. There, click the button that
> > says "New" on it.
> > 
> > ## Expected
> > 
> > A new empty macro should get created (probably should ask first about the
> > language a user wants to use)
> 
> That is the general tool for new documents. That exists in all modules. You
> see it too in the Math-Editor and in the Chart-Editor. It behaves the same
> in all places. Simple click uses the current preselected kind of action, for
> other actions open the list by clicking on the triangle and select the
> action.

If opening a new lowriter/localc window is an intended behavior of this button, then IMO it's better to remove it whatsoever. A user can open a new LO instance for example by clicking File → New inside already opened lowriter/local window. Having this button in IDE (and probably in math-editor and chart-editor) only creates a confusion. I don't know what chart-editor looks like, but from the hearing of that I see no reason why I would expect a "New" button not to create a new chart but rather to create an LO instance.

Suppose you clicked "New" button inside localc. Do you expect it to open an lowriter instance or localc? If the latter, then this is because buttons inside any given program window should match the functional that this window is intended to provide. I see no reason why it should hold for localc but not for macros-editor or chart-editor.
Comment 9 Buovjaga 2020-05-01 18:16:58 UTC
Then let's submit this to the UX jury
Comment 10 Heiko Tietze 2020-05-04 14:02:34 UTC
All modules place the shortcut (and default action) on the current module except the macro editor. How about adding Organize Macros (.uno:ScriptOrganizer) in this case?
Comment 11 Konstantin Kharlamov 2020-05-04 14:26:02 UTC
(In reply to Heiko Tietze from comment #10)
> All modules place the shortcut (and default action) on the current module
> except the macro editor. How about adding Organize Macros
> (.uno:ScriptOrganizer) in this case?

I am not sure what dialog you're referring to. I found a submenu like:

    Tools → Organize Macros → Basic…
                             → BeanShell…
                             → JavaScript…
                             → Python…

Did you mean, showing one of the four dialogs here, depending on what language is currently chosen? If yes, then doesn't sound bad to me. I see the dialogs has a "Create" button. Although I don't like the fact that this "Create" button would duplicate functional of the "New" button in the usecase being discussed (i.e. because a user already showed desire to create a new document by pressing "New", there's no need for them to press "Create" in addition to that), but I guess working around that would requires to create a whole new dialog, lots of work.


So, I'd say, while not ideal, this is definitely better than the current behavior.
Comment 12 Heiko Tietze 2021-05-31 13:23:14 UTC
Let's update menu and toolbar and replace the New/Open functions by something that suits better the Basic IDE. 

Code pointer are:

 basctl/uiconfig/basicide/menubar/menubar.xml
 basctl/uiconfig/basicide/toolbar/standardbar.xml
Comment 13 Roman Kuznetsov 2021-05-31 14:58:50 UTC
(In reply to Heiko Tietze from comment #12)
> Let's update menu and toolbar and replace the New/Open functions by
> something that suits better the Basic IDE. 
> 
> Code pointer are:
> 
>  basctl/uiconfig/basicide/menubar/menubar.xml
>  basctl/uiconfig/basicide/toolbar/standardbar.xml

We already have .uno:MacroDialog and .uno:MacroOrganizer on Standard toolbar. We can just move it to the left side of the toolbar. And (possibly!) we can hide  .uno:AddDirect command there

And we can add .uno:MacroDialog and .uno:MacroOrganizer into File main menu for Basic IDE and do some reorganize for File menu too

What do you think?
Comment 14 Heiko Tietze 2021-05-31 18:32:50 UTC
(In reply to Roman Kuznetsov from comment #13)
> What do you think?

Sounds okay, I'd leave it to the doer to decide what functions are suited best on Basic's standard toolbar and main menu. Set difficulty to medium therefore, the hack itself is simple.
Comment 15 Regina Henschel 2021-05-31 19:16:21 UTC
If you have Basic IDE open and an document open, and when you then close the document, you do not get the splash screen, but you have only the Basic IDE. So the Basic IDE needs the options to open and to create new documents. Please keep that in mind, when changing the UI of Basic IDE.
Comment 16 Roman Kuznetsov 2021-07-18 13:42:28 UTC
I talked with people who uses Basic IDE every day. They don't have problem with current menu or toolbars. They want just addition useful tools, but it's another topic.

And I don't like those menu and toolbar changings that I tried do locally
Comment 17 Mike Kaganski 2023-08-26 11:41:16 UTC
IMO -> WF. The "New *Document*" button is consistent with all modules. Macros are not documents, and New Document does a correct job. A single complaint in all the LibreOffice history (were some similar requests ever in OOo?) does not justify the change.
Comment 18 Mike Kaganski 2023-08-26 11:42:24 UTC
One change could still possibly be, if the button tooltip changed dynamically to e.g. "New Text Document", "New Spreadsheet", etc. - so not be simply "New".
Comment 19 Konstantin Kharlamov 2023-08-26 14:25:43 UTC
(In reply to Mike Kaganski from comment #17)
> IMO -> WF. The "New *Document*" button is consistent with all modules.

There's no such button though, there's a button with a tooltip "New".

> Macros are not documents, and New Document does a correct job.

What in the world a "New document" button would do in a macro editor? Assuming there would be such button, that would just sound like a bad naming, where someone thought of a macro as a document, perhaps because the macro IDE is inside the Office suite.

> A single
> complaint in all the LibreOffice history (were some similar requests ever in
> OOo?) does not justify the change.

Okay, two things.

1. LO is by far not as popular as MS Office, and the auditory for office suites are mostly non-technical people. Many don't know (or just don't care) that you can go report bug for something that works wrong. And a design flaw in the office suite is not something you'd usually report bug for, because, well, it still works, right? So many people just wouldn't do that.
   This bug was reported when I was living with my ex-gf who had to use LO because MS Office just wouldn't work on Fedora, and you can't imagine HOW MANY complaints I've heard from her about the LO design being terrible. As a programmer I can distinguish complaints of "habitual" type from legit ones, and I'd say 50% of them were legitimate complaints. How many bugreports she created? Zero. I created a few on her behalf though, but wasn't it for me there would be none at all.
2. Let's not come down to that handwaving reasoning "nobody reported, hence it's untrue". If you are working with a macro in a window wholly dedicated to macro editing, what in the world a button for starting a new Spreadsheet would do there? This is insconsistent. Although, if you really up for some overengineering and want to have such buttons in every possible place, at least please name it accordingly "New Spreadsheet" and not just "New".
Comment 20 Mike Kaganski 2023-08-26 15:34:30 UTC
(In reply to Konstantin Kharlamov from comment #19)
> > A single
> > complaint in all the LibreOffice history (were some similar requests ever in
> > OOo?) does not justify the change.
> 
> 1. LO is by far not as popular as MS Office, and the auditory for office
> suites are mostly non-technical people. Many don't know (or just don't care)
> that you can go report bug for something that works wrong. ...

This is irrelevant. We have so huge user base, that we see how many actual bug reports any *actual* problem gets multiple reports; one can judge the severity of a problem based on how many duplicates there are.

And any "people do not file bugs, that's why there's no duplicates" is wrong. If we had a thousand users, it could be justified, but not when they are hundreds of millions.

And my comment 18 suggests just that - make the tooltip more specific.
Comment 21 Heiko Tietze 2023-08-28 08:41:43 UTC
(In reply to Konstantin Kharlamov from comment #19)
> This bug was reported when I was living with my ex-gf...
> you can't imagine HOW MANY complaints I've heard from her
Good decision to rather stay with LibreOffice than the GF ;-)

I can follow her confusion and removing the "New" is pretty simple.
Comment 22 Konstantin Kharlamov 2023-08-28 09:16:28 UTC
(In reply to Heiko Tietze from comment #21)
> (In reply to Konstantin Kharlamov from comment #19)
> > This bug was reported when I was living with my ex-gf...
> > you can't imagine HOW MANY complaints I've heard from her
> Good decision to rather stay with LibreOffice than the GF ;-)

lol 😂

> I can follow her confusion and removing the "New" is pretty simple.

To be clear, this particular report wasn't created on her behalf but solely my initiative.
 I mentioned her rather as part of the discussion about design issues reports.