Bug 141859 - Autotext-like cross-reference insertion
Summary: Autotext-like cross-reference insertion
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2021-04-23 19:33 UTC by Eyal Rozenberg
Modified: 2021-05-07 08:19 UTC (History)
2 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 2021-04-23 19:33:24 UTC
At the moment, if you want to insert a cross-reference, you have to go through the dialog. However, many documents have unique short phrases or unique numbering for headings or numbered paragraphs (e.g. B.1.5), it should be possible to type in the referenced number, and have it converted into a reference with a key combination: 

* User types, for example "B.1.5"
* User presses the magical shortcut key combination
* LO performs the equivalent of the filtering it would perform in the Cross-references insertion dialog, with Numbered Paragraphs selected.
* If the number of results is 0, nothing happens (or there is some error indication, e.g. a bell)
* If there are multiple results, either nothing happens; or the text disappears and the dialog comes up with the filter already applied; or one can "scroll" through the results with subsequent presses of the shortcut; etc.
* If there is a single result, the text is replaced by the reference to the numbered item, with the displayed text being the number (so that the display text will typically be the typed text).

One can also conceivably have this for Headings search, where again you type in a search term like in the insertion dialog; but perhaps a different shortcut will be used, to indicate something else is being searched; and that the reference text should be the heading text rather than the number.

For users working on long documents with numbered sections and many cross-references (manuals, legal briefs etc.) this would be a significant workflow improvement - allowing you to keep your typing rythm and not take your eyes off of the line.
Comment 1 Heiko Tietze 2021-05-04 17:25:43 UTC
But "B.1.5" could be anything, a heading, a figure caption, a bookmark... This reverse reference search would not work unless the term is very specific. Another shortcoming might be that you remember the chapter name "Foo" but not the number. And you want to insert the page number to this chapter.
Comment 2 Eyal Rozenberg 2021-05-04 18:03:41 UTC
(In reply to Heiko Tietze from comment #1)
> "B.1.5" could be anything, a heading, a figure caption, a bookmark...
> This reverse reference search would not work unless the term is very
> specific. 

Ok, fair point. Well, two options:

1. Unless the search string is unambiguous, don't create the reference. Easy-peasy, and in real life, if you have a B.1.5 heading, you are unlikely to have anything else with that exact number.

2. If multiple results match that string, open a context menu with the different options. More robust, but more work.

The neat thing here is that option (1) is easily upgradeable to option (2) with essentially nothing thrown away.

> Another shortcoming might be that you remember the chapter name
> "Foo" but not the number. And you want to insert the page number to this
> chapter.

Again, several options:

1. Just the number, no fancier search capability. Open the dialog if you like

2. Allow a slightly fuzzier match, i.e. try to match both the number and the name; insert reference on exact match only, otherwise do nothing.

3. Allow a slightly fuzzier match, i.e. try to match both the number and the name. If there are multiple matches, open a context menu to select from among them.

4. Allow a very fuzzy match - substring, "sounds like" etc. If there are multiple matches, open a context menu to select from among them.


And again, we could start with option (1) and upgrade later.

Notes:

* Continued typing could update the menu with the better-filtered search results, so that you can type until there's a single match or no match.
* It might be a good idea to indicate a single match has been found rather than no matches found.
Comment 3 Heiko Tietze 2021-05-05 07:25:49 UTC
In any case it would have a very limited functionality compared to what the dialog offers. My take: good for an extension but not inbuilt.