Bug 148320 - Explicit toggle for ToC/Index title
Summary: Explicit toggle for ToC/Index title
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Sohrab Kazak
URL:
Whiteboard: target:25.2.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: TableofContents-Indexes-Dialog
  Show dependency treegraph
 
Reported: 2022-04-02 08:48 UTC by Eyal Rozenberg
Modified: 2024-09-26 07:59 UTC (History)
4 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 Eyal Rozenberg 2022-04-02 08:48:08 UTC
The ToC/Index insertion dialog seems to force you to specify a title; and an empty title on the dialog removes the title paragraph from the ToC/Index. 

Instead, there should be an explicit toggle of whether or not a title should be used. Guessing that empty means no title is a bit onerous and, IIANM, this is not a common practice in LO dialogs.
Comment 1 Dieter 2022-04-18 03:24:37 UTC
I confirm the described behaviour, but I don't think, it's a bug. Preview also shows no title, if title-entry is empty.

cc: design-team for further input and decision
Comment 2 Eyal Rozenberg 2022-04-18 06:55:48 UTC
(In reply to Dieter from comment #1)
> Preview also shows no title, if title-entry is empty.

This is non-intuitive, and is not consistent with other behavior in LO. You can have an empty footer, an empty paragraph, or an empty caption. So you're not supposed to have to assume that "empty title" = "no title".
Comment 3 Heiko Tietze 2022-04-22 09:45:46 UTC
Better compare with caption and if you leave the field empty you get an empty caption. Wouldn't expect anything else. Admittedly, the checkbox is convenient (and we have space) but I don't see a pattern.
Comment 4 Eyal Rozenberg 2022-04-22 10:29:22 UTC
(In reply to Heiko Tietze from comment #3)
> I don't see a pattern.

Can you explain that phrase?
Comment 5 Heiko Tietze 2022-04-22 10:50:36 UTC
(In reply to Eyal Rozenberg from comment #2)
> ... is not consistent with other behavior in LO.

I don't see this pattern, meaning consistency in terms of input fields that are in use if a checkbox is checked or otherwise mean empty content.
Comment 6 Eyal Rozenberg 2022-04-22 11:04:06 UTC
(In reply to Heiko Tietze from comment #5)
> I don't see this pattern, meaning consistency in terms of input fields that
> are in use if a checkbox is checked or otherwise mean empty content.

Ah. So, I didn't mean consistency in terms of an input field, but rather consistency in terms of dichotomy between non-empty and non-existence:

Footer             can be empty
Header             can be empty
Footnote           can be empty, sort of
Endnote            can be empty, sort of
Heading paragraph  can be empty
Comment            can be empty
Caption            can be empty
ToC title          can't be empty

Given all the rest, the user is unlikely to realize that an empty title means no-title, and would waste time trying to look for a checkbox which doesn't exist.
Comment 7 Heiko Tietze 2022-04-22 11:10:26 UTC
(In reply to Eyal Rozenberg from comment #6)
> ... the user is unlikely to realize that an empty title means no-title

Don't think so. And, as Dieter pointed out, we have a preview.
Comment 8 Cor Nouws 2022-04-26 20:26:32 UTC
(In reply to Heiko Tietze from comment #7)

> Don't think so. And, as Dieter pointed out, we have a preview.

The preview helps me clearly, indeed.
Comment 9 Heiko Tietze 2022-04-28 05:59:22 UTC
The topic was on the agenda of the design meeting.

The alternative to just clearing the text field is to have a checkbox "[x] Use title" and enable the input respectively. It improves consistency, clarifies the behavior for novice user, and makes the label "Type and Title" more appropriate. Plus, we have enough space and the enhancement is an easy hack.

Code pointer:
* add the checkbox to sw/uiconfig/swriter/ui/tocindexpage.ui
* add variables and logic to sw/source/ui/index/cnttab.cxx; likely in FillTOXDescription() rDesc.SetTitle(m_xTitleED->get_text());
Comment 10 Commit Notification 2024-09-26 07:24:18 UTC
Sohrab Kazak committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/185899c145dba0c67e1d15e37dce206da8abc283

tdf#148320 Toggle ToC/Index Title

It will be available in 25.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 11 Mike Kaganski 2024-09-26 07:59:04 UTC
Nice!
As the commit message tells:

> Solution could use more work.

Here's my UX feedback:
Since we still have the (reasonable) difference in what "empty" means (detailed in comment 6), I feel it would be reasonable further enhancement, if:

1. When the checkbox is currently unchecked, and user checks it, the cursor would jump to the edit box automatically;
2. When the cursor leaves the edit box, then if it's kept empty, then the checkbox would uncheck itself automatically.

This would make the "enabled == non-empty" rule explicit in the UI.