Bug 153248 - Insert Caption and Caption Options dialogs have a mix of settings affecting the whole category or only current caption (see comment 16)
Summary: Insert Caption and Caption Options dialogs have a mix of settings affecting t...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 154887 (view as bug list)
Depends on:
Blocks: Fields-Dialog Caption
  Show dependency treegraph
 
Reported: 2023-01-27 16:36 UTC by sdc.blanco
Modified: 2023-04-18 22:09 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test document for caption numbering (14.72 KB, application/vnd.oasis.opendocument.text)
2023-01-27 16:36 UTC, sdc.blanco
Details
Screenshot of the dialogs in question (52.83 KB, image/png)
2023-01-31 08:34 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2023-01-27 16:36:08 UTC
Created attachment 184962 [details]
test document for caption numbering

Note: need to test with LO prior to 7.5 because of bug 153244

1. For convenience, use attached document, or make a document with several captions.
2. Then open Insert - Caption - Options dialog to insert a new caption.
3. Change "level" and/or "separator" and click OK.

Actual: All captions are changed (even if a new caption is not inserted)
Expected: Only the current caption (to be inserted) is affected.

Additional information

Using the "Level" and "Separator" in the Edit Field dialog for Caption field also changes all the captions, not just the currently edited field.

Seems confusing in Insert - Caption - Options dialog for the Numbering Captions by Chapter section to have a global effect, when the other two options in that dialog only have an effect on the current caption being inserted.  Maybe need some way in UI indicate this behavior.

Question to UX-Eval, what is the expected behavior here?

If current behavior is expected, then probably some mention should be included in help page. 
( https://help.libreoffice.org/7.6/en-US/text/swriter/01/04060100.html )
Comment 1 Stéphane Guillou (stragu) 2023-01-27 21:07:49 UTC
Issue first discussed in bug 153244 comment 3.

In the dialog, we have:
- Level
- Separator
- Character Style
- Apply border and shadow
- Caption order

The two first ones apply to all captions of the same category (those are the numbering field parameters that can be later edited by double-clicking the field), and the three last ones only to the one being edited. (Not 100% sure about "Apply border and shadow" because I could not see its effect.)

This is also an issue in the Insert Caption dialog: the numbering setting affects all fields in the captions of the same category.

The fact that the two dialogs have both "local" and "global" settings is very confusing, and there is no indication of if in the dialogs or in the help pages.
The documentation is even wrong: for the Insert Caption dialog, it says "Set the caption options for the current selection", which is incorrect for the Numbering field.
The user needs to poke in the dark to make sense of it.

What would make it better:

Reorganising the dialogs to have a distinct section, possibly called "Category options" which pertains to the common "Number Range" field used for one category.

Even better, it could be separated by dialog:
- "Insert Caption" dialog contains all the "local" options
- "Options..." dialog is renamed "Category options" and contains all the options that affect all captions for this category. The button could be more logically placed next to the Category combobox.
(- In my opinion, some of the current "local" options should become "global" options, for example the separators used around the field. This would make it easier to later change the structure of all captions for one category, but I think the limitation here is that these components are not part of a field, they're only simple text. Different issue.)

All this is not an issue for the autocaption dialog as it has all 10 settings in one dialog and all are supposed to apply automatically to all captions of one category.

Issue is inherited from OOo:

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)
Comment 2 Heiko Tietze 2023-01-31 08:34:22 UTC
Created attachment 185021 [details]
Screenshot of the dialogs in question

I don't see the problems, at most the documentation needs improvement.

Captions that belong to a category should be consistent. If you modify the newly created a category "Text" from the example, all attributes are applied to captions of this category. An example would be images named <chapter>.<number> (because your document has a lot) but tables just <number> (since it has a few).

The Insert Caption dialog has a separator for the caption name ("Text:" or "Text."...) while the caption Options' separator deals with the chapter ("Text 1.a:" or "Text 1-a:"). IMO no problem.

Per Character Style it is possible to use bold font, for example, at the numbering coming from a special character style. If this CS is using a border I cannot disable it by not checking the "Apply border and shadow" checkbox - smells like a bug. And I'm having a hard time to figure the use case where I set-up a CS but use not all attributes. My take: remove the checkbox.
Comment 3 Heiko Tietze 2023-01-31 08:59:11 UTC
Proposal to change Options > Separator in bug 153242
Comment 4 sdc.blanco 2023-02-06 23:43:25 UTC
(In reply to Heiko Tietze from comment #2)
> I don't see the problems
Will let stragu elaborate if needed.

But as a mild query....
> Per Character Style it is possible to use bold font, for example, at the
> numbering coming from a special character style.
Present behavior is to apply this CS only to "category name and field number" for the caption to be inserted.  What is the use case justification here?

Seems better (and more useful) to have the change applied to all the captions, which would be consistent with the behavior of the "Numbering (Captions) by Chapter" section.

Same story for "Category" (category order) -- why would you switch order for one case, but not for all?  Seems more practical to be able to change all cases in this way (given that it is always possible to manually edit a single case).

> If this CS is using a border I cannot disable it by not checking the "Apply 
> border and shadow" checkbox - smells like a bug. 
Is it possible that (long ago) "caption" was placed in its own frame, instead of a frame? Otherwise, what is the meaning of "caption frame" (and what is the "object") in the help page [1].

And what is the meaning of the section title "Category and Frame Format"?  (if checkbox is removed, then probably need to improve the title).

(NB that the help for this section has not changed since its initial checkin in 2004.)

Would make more sense that all options in the options dialog were applied to all existing (and future) captions (which I think is also noted in comment 1).

In all cases, could probably simplify the interface of the options dialog by moving the Numbering by Chapter section to bottom, and then drop the section titles for "Category and Frame Format" and "Caption" (which do not seem to help much).


[1] https://help.libreoffice.org/7.6/en-US/text/swriter/01/04060100.html
Comment 5 sdc.blanco 2023-02-06 23:46:10 UTC
Clarification of  "placed in its own frame, instead of a frame" in comment 4.

Should be:  "placed in its own frame, INSIDE of a frame"
Comment 6 sdc.blanco 2023-02-07 15:37:41 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> (Not 100% sure about "Apply border and shadow" because I could not see 
> its effect.)
(In reply to Heiko Tietze from comment #2)
> Per Character Style it is possible to use bold font, for example, at the
> numbering coming from a special character style. If this CS is using a
> border I cannot disable it by not checking the "Apply border and shadow"
> checkbox - smells like a bug. 

I believe "Apply border and shadow" is relevant when Insert Caption is being used with Shapes, Charts, Images that already have a border/shadow applied to the object.  If the checkbox is enabled, then the border/shadow setting is removed from the selected object and applied to the frame (added with the caption).  If the box is not checked, then border/shadow remains on the object.  Iow, NAB, and gives an explanation for now section title includes Frame Format.

As suggested at end of comment 4, might be an advantage to drop the section title.
And maybe change control label to be more precise (but could not generate a plausible candidate). At the very least, I should be able to improve the help page a little.

Alternatively, bug 115318 suggesting dropping the addition of a frame when a caption is added to images and charts, which would then make this checkbox irrelevant.
Comment 7 Heiko Tietze 2023-02-10 13:53:41 UTC
Discussed the issue with Stephane.

1. While using term Separator on different dialogs is not a big issue we also have the auto caption and there all attributes are listed at once.

2. The "Numbering separator" becomes enabled if the setting "Caption order" in the options dialog is set to "Numbering first".

3. It is possible to include the chapter number per Edit Field "Numbering by Chapter" but any change in the caption dialog whether switching this option on or off fails.

4. Some options apply to the whole category other to only the current caption. For example, "Numbering first" vs. "Category First" is not applied to all items. It's also possible to change the field from Arabic numbers to Literals... Neither saving nor update (all fields) works but changing the caption style per #3 does.

I would handle #3 and #4 separately as individual bugs.

For the UI topic we could move Numbering and Position into the options dialog keeping the caption field, the caption type (should be renamed to Category or Type), and the Separator in the doalog. The options dialog needs a preview too.
"Numbering Separator" could become "Followed by" and placed next to caption order. The chapter separator maybe divider, just to have a different label.

I'll add a mockup to summarized the considerations.
Comment 8 sdc.blanco 2023-02-15 12:01:32 UTC
(In reply to Heiko Tietze from comment #7)
> I'll add a mockup to summarized the considerations.
Not sure if the mockup also includes the "Options" dialog for Insert Caption, but here are some comments in relation to that dialog.

(In reply to sdc.blanco from comment #4)
> And what is the meaning of the section title "Category and Frame Format"? 
It should be read as "Category Format and Frame Format" -- but the two controls in that section are completely unrelated -- the first is for applying a CS to the category and number (of the caption); the second is for applying a border to the frame where the caption is placed.

It might be better (or least more accurately) presented as:

----------------------------
Category and Number Format

  Character Style [None]

Frame Format

  [] Apply border and shadow
-----------------------------

Additional comments:

1.  For "Category and Number Format" could probably drop section title and just have the label with buddy control:

Category and number character style:  [None]

2. That proposed change would better indicate what character style is being set, while dropping the vague word "format".

3. If that change was made, then I would move this control to the top of the dialog, because applicable for all captions, not just when using Chapter numbering.  (principle: important things first)

4. Note also bug 48682, which complains that the value set for Character Style is not remembered the next time that the Insert dialog is started. Maybe bug 48682 is WF (because AutoCaption could be used for this purpose), but a plausible use case can be made for why AutoCaption alone is not sufficient.

5.  Maybe "Apply border and shadow" --> "Use border and shadow of selected object"  (is more informative)

6.  If the selected object is a Table or Frame, then the "Apply..." control should be greyed out.  (this is a bug, which could be filed as separate ticket).
Comment 9 Heiko Tietze 2023-03-15 10:07:32 UTC
(In reply to ajlittoz from bug 148597 comment #20)
> Created attachment 185881 [details]
> Ideas on captioning

The idea is basically to use tags as known from the ToC Entries tab to flexibly create captions. For example "[] CC [ ] C# [: ] CT []" to create "Figure 1: Lorem ipsum" or "[] CT [ (] CC [ ] C# [)]" for "Lorem ipsum (Figure 1)" with

CT = caption text
CC = caption category
CI = chapter info
C# = caption number
NL = new line
T = tab stop

Alternatives could be to a) not provide this flexibility and have a few layout options hard coded where the user can pick one, and b) not to use the Entries-like tag paradigm but a simple list along with a dropdown to add items from the available options (see https://design.blog.documentfoundation.org/2015/03/12/libreoffice-design-session-entries-at-indexes-and-tables/). I think a) is not what LibreOffice stands for and b) has some advantages on accessibility and maybe the use of available screen space but would be boring and less intuitive.

As a substantial improvement to the proposal I suggest to separate the caption style (rather a template) from the insertion. The style could be defined like heading numbering something like

Presets        Options
*Classic*      [][CT][][C#]
Brackets       Character Style
My Fancy C...  <more options>
[Add] [Delete]

This caption style could be used for the auto numbering as well as in the insert caption dialog, which would just allow to pick one of the presets and to enter the caption text. The shipped presets would contain of all current categories.

The propose newline tag sounds wrong to me as it adds another paragraph, which per definition is not the same caption number. Could be a soft aka manual row break, though. 

> The main rejection point is that they need a change in ODF XML markup so
> that needed data is available when generating indexes of tables, figures, …

Don't think so. If we abstain from fields it would be the same as manual editing a caption like done for "Inverted caption (Figure 2)". And even fields can be inserted right now and show up in the ToF.
Comment 10 Heiko Tietze 2023-03-15 10:21:54 UTC
(In reply to Heiko Tietze from comment #9)
> If we abstain from fields it would be the same as manual editing...

Changing the caption style would not apply to inserted captions in this case. So we have to use variables, at least to create proper cross-references (see bug 153903).
Comment 11 ajlittoz 2023-03-15 10:50:51 UTC
(In reply to Heiko Tietze from comment #9)

> The propose newline tag sounds wrong to me as it adds another paragraph, which per
> definition is not the same caption number. Could be a soft aka manual row break, though. 

My purpose is not to have a "multi-paragraph" caption. My "NL" tag inserts a "line break" (usually created with Shift+Enter) which is not a paragraph break. The goal is to offer the same possibility as with chapter numbering where you can have the number on its line and heading text on the next. Separating the number from the caption is required by some guidelines manual like APA.

(In reply to Heiko Tietze from comment #9)
> > The main rejection point is that they need a change in ODF XML markup so
> > that needed data is available when generating indexes of tables, figures, …
> 
> Don't think so. If we abstain from fields it would be the same as manual
> editing a caption like done for "Inverted caption (Figure 2)". And even
> fields can be inserted right now and show up in the ToF.
The markup in my proposal is necessary to "decouple" the caption from its layout in the ToF. Also I'd like to be able to apply a specific character style on different components of the caption text. Hence the necessity to split tag CT into smaller bits to format them individually (and my suggestion to make the tag an "array")

As an example of the difference in caption and ToC is tag NL. It makes sense in captioning (cf. APA manual) but not in ToF. The present way it is handled in chapter numbering => TOC doesn't satisfy me. NL is transformed into a SPACE which adds up to other TOC elements. This is because the NL is directly managed by chapter numbering without being "advertised" in any way in the heading paragraph.

Also, a heading is "unstructured" (and this is good for simplicity): it is a numbered list item and managed as such. It has 2 components, the number and heading text. Heading text can be styled per author's needs. But this styling , as far as character styles are concerned, doesn't propagate to TOC. Tag T can be styled as a whole and this doesn't reflect the real heading formatting.

My proposal for captioning aims to provide a solution to this. I think it is acceptable in captions but would be immediately rejected for headings by the majority of users because of unneeded (in the vast majority of cases) complexity and by developers because of its impact on list formatting (or creation of a separate feature for headings).
Comment 12 sdc.blanco 2023-03-19 12:38:05 UTC
Introduction of a CT tag is likely to be relevant for:

bug  36671  - caption to left or right of object
bug 112854  - add a "remove caption" command 
bug 115318  - make captions on images without frame
bug 118673  - comment on category name disrupts cross-reference variable
Comment 13 Heiko Tietze 2023-03-30 08:06:37 UTC
We discussed the proposal in the design meeting without further suggestions. Sounds like a good topic for a GSoC project.
Comment 14 Commit Notification 2023-04-01 11:01:35 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/4218a343f54af2dc10a9648a4e9b71bb346c16de

tdf#154214,tdf#153248 update/order sections; note global effect of numbering
Comment 15 Commit Notification 2023-04-04 12:24:33 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/562c29b9451c68b607d980b6011726bbf9de0247

tdf#153248 numbering is changed globally
Comment 16 sdc.blanco 2023-04-07 10:00:34 UTC
*STATUS*
This ticket has metamorphized from a query about the operation of Heading Numbering for Caption numbers to a general proposal (see attachment in comment 9) for a new way to construct captions in general. 

In relation to the other issues raised in this ticket: The issue in comment 8 was addressed in bug 154214 and the documentation problems identified here were also addressed. 

More generally, the UI (in terms of option labels, tooltips, section titles, and layout) for the existing Insert Caption dialog has been revised (see bugs in "See Also"). Hard to see what more can be done to improve the UI for the current functionality that underlies the dialog.

Meanwhile comment 9 through comment 13  introduce a different approach to constructing captions, which is now the focus of this ticket.  (And +1 for GSoC project).
Comment 17 Heiko Tietze 2023-04-11 11:08:07 UTC
I wonder if it makes sense to keep this ticket open for the dialog revamp task. Move the discussion to bug 153903?
Comment 18 Eyal Rozenberg 2023-04-18 22:09:34 UTC
*** Bug 154887 has been marked as a duplicate of this bug. ***