Bug 153770 - Proposal to modify "Create Index or Table of Contents" and Type-dependent "Create From" sections in Type tab of ToC/Index
Summary: Proposal to modify "Create Index or Table of Contents" and Type-dependent "C...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillCpp, topicDesign
Depends on:
Blocks: TableofContents-Indexes-Dialog
  Show dependency treegraph
 
Reported: 2023-02-20 23:54 UTC by sdc.blanco
Modified: 2023-02-22 22:30 UTC (History)
3 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 sdc.blanco 2023-02-20 23:54:39 UTC
Discussion in bug 153637, comment 6, raised the question of "how does the naive user read [one of the labels] - which gave a useful perspective for looking at the dialog. 

Here is an attempt to simplify/streamline, make meanings of sections more explicit.

The focus is on the two lower sections, with the titles:

Create Index or Table of Contents
Create From

-------------

Scope (of ToC or Index)

  ( ) Entire Document
  ( ) Chapter 

   [depending on selected Type]

Create ToC From 

   Evaluate up to level []  (underneath the 3 checkboxes)  

Create Table (of Figures) From

Create Index (of Tables) From

Create Index From             (User-defined)

Create Table (of Objects) From

no change for Alphabetical Index and Bibliography

------------------
Some explanations.

1.  Instead of "Create" appearing twice, "Scope" should be meaningful, and why have a dropdown with 2 items?  (optional whether "Index and TOC" should be mentioned.)

2.  The current "Create From" section changes, depending on the selected Type.

  a. It should be possible to identify the specific kind of Index or TOC that is being created, as illustrated above (i.e., much more specific than "Create From")

  b.  The "Evaluate up to level" in Type TOC is always index level (but as discussed in bug 153596, can be left unspecified for now), so it can be moved
meaningful down.
Comment 1 Heiko Tietze 2023-02-21 09:14:31 UTC
(In reply to sdc.blanco from comment #0)
> Scope (of ToC or Index)
>   ( ) Entire Document
>   ( ) Chapter 

LGTM

 
> Create ToC From 
> 
>    Evaluate up to level []  (underneath the 3 checkboxes)  
> 
> Create Table (of Figures) From
> 
> Create Index (of Tables) From
> 
> Create Index From             (User-defined)
> 
> Create Table (of Objects) From

Don't get this, at least it does not match the current situation.
Comment 2 sdc.blanco 2023-02-21 12:57:53 UTC
(In reply to Heiko Tietze from comment #1)
> Don't get this
Fair enough.  Easier to explain now that "Scope" is not involved.

In Type tab, select Type according to first column below. Second column shows what is proposed as the Section title that should replace the current "Create From"

Select Type            Current "Create From" title should show
-----------            ----------------------------------------

Table of Contents      Create Table of Context From

Table of Figures       Create Table (of Figures) From

Index of Tables        Create Index (of Tables) From

User-Defined           Create Index From

Table of Objects       Create Table (of Objects) From

Additional comments:

1. The parts in parentheses could possibly be dropped.
2. possibly "Index of Tables" -> "Table Index"  
   (probably "Table of Tables" did not work)
3. For Type "Table of Contents", the option
      Evaluate up to level []  also appears in the "Scope" section.
      I believe this option can be meaningfully placed underneath the 3
      options (Headings, Additional Styles, Index Marks) for the
      "Create Table of Contents From" section. Where the option would be
       indented (like the "Use level from source" option in the 
       Used-defined type)
4. This change should give a much cleaner interface. Instead of current interface that is somewhat generic, proposal makes the section titles
appropriate and specific to its Type context, and draws attention to the section that decides what to include in the index.
Comment 3 RGB 2023-02-21 16:19:27 UTC
(In reply to sdc.blanco from comment #0)
> 
> Scope (of ToC or Index)
> 
>   ( ) Entire Document
>   ( ) Chapter 
> 

Notice that in recent versions partial TOCs will be build from the current heading level (for example, if using the chapter option while on a level 3 heading, the index will show only level 4 and lower) and that mean that the "Chapter" label (that only refers to a level 1 heading) is not valid anymore, it should be "Current heading level" or something like that.
Comment 4 sdc.blanco 2023-02-21 21:35:36 UTC
(In reply to RGB from comment #3)
Thanks for this useful comment. Have known about the function, but your comment has resulted in my first experiments.

> Notice that in recent versions partial TOCs will be build from the current
> heading level 
Just to be sure that I have interpreted "build from the current heading level" correctly.

The partial index is created from the immediately prior heading in relation to where the cursor is placed, and only indexes headings have a higher outline level than the immediately prior heading, stopping at (and not including) a subsequent heading that has the same outline level as the "prior heading".  (at least that is what my experiments show)

> using the chapter option while on a level 3 heading
just to be sure:  "on a heading" means that the cursor is placed AFTER the heading (not in/on the paragraph with a heading PS).

> (the index will show only level 4 and lower) 
depending on what is set in "Evaluate up to level"

> that mean that the "Chapter" label (that only refers to a level 1 heading) is 
> not valid anymore, it should be "Current heading level" or something like that.
Good point!  Perhaps "Heading" is enough. 

Also this makes me realise that "Evaluate up to level" would benefit from being called "Show up to level" (in line with bug 105628 for "Chapter No." in the Entries tab)
Comment 5 Heiko Tietze 2023-02-22 10:21:36 UTC
(In reply to sdc.blanco from comment #2)
> In Type tab, select Type according to first column below. Second column
> shows what is proposed as the Section title that should replace the current
> "Create From".

So just the label... How about simply going with "Create %s From" and replacing %s by what is selected in the dropdown? Only drawback I see is for "User-Defined", which we could rename to "User-Defined Table".

OTOH, replacing the label by some other string is also not a big deal.
Comment 6 sdc.blanco 2023-02-22 10:49:27 UTC
(In reply to Heiko Tietze from comment #5)
> So just the label... How about simply going with "Create %s From" and
> replacing %s by what is selected in the dropdown? 
Elegant -- and easier to maintain.

Including the "type" name with "Create From" should make the section's purpose more explicit. 

> "User-Defined", which we could rename to "User-Defined Table".
Change "type" to "User-defined Index" 

I can make a patch to change:
"Chapter" to "Heading" 
"Evaluate up to level" to "Show up to level".
"Create Index or Table of Contents" to "Scope"
"User-defined" -> "User-defined index"
(and update help pages)

Maybe the other changes (radio buttons, the %s in Create, and moving "Show up to level") can be an EasyHack?
Comment 7 Heiko Tietze 2023-02-22 11:04:20 UTC
(In reply to sdc.blanco from comment #6)
> Maybe the other changes (radio buttons, the %s in Create, and moving "Show
> up to level") can be an EasyHack?

Yes, those are not too difficult. 

* Change "Create From" into "Create %s From" at sw/uiconfig/swriter/ui/tocindexpage.ui (ideally with a comment for translators that %s will be replaced by the type)
* add a string variable with the same name sw/inc/strings.hrc, eg. SID_CREATEFROM
* add a weld::label to sw/source/uibase/inc/swuicnttab.hxx, eg. m_xCreateFromLB
* instantiate this label in sw/source/ui/index/cnttab.cxx SwTOXSelectTabPage() (it is named label2 in the ui file)
* add to the TOXTypeHdl: m_xCreateFromLB->set_label(SwResId(SID_CREATEFROM).replaceAll(%s, m_xTypeLB->get_active_text())
Comment 8 Heiko Tietze 2023-02-22 11:07:08 UTC
(In reply to sdc.blanco from comment #2)
> Table of Objects       Create Table (of Objects) From

Table of Objects shows a different part of the UI with the string "Create From the Following Objects"; either we change it into "Create Table of Objects From the Following Objects" or in this case just "Create Table From the Following Objects". In any case it has to be done directly in the UI file.
Comment 9 sdc.blanco 2023-02-22 22:30:06 UTC
(In reply to Heiko Tietze from comment #8)
> Table of Objects shows a different part of the UI with the string "Create
> From the Following Objects";
Implicit in the proposal in comment 2 was that "the Following Objects" should be deleted from the section title for "Table of Objects"  (Given that a list of objects are shown, there is little or no information value in "the Following Objects").