Hi and hello everyone, first of all, I'm a great fan of Lyx and I use it for my productive work since many years! Thanks for all the work you've put into.
One feature I am missing for some time already is discussed in ticket https://www.lyx.org/trac/ticket/1624 It is about streamlining the "cross-reference" workflow. When writing a document often you think about referencing a section/table/image, but haven't created a label there yet. So the workflow right now involves: - click on "create reference" button - in dialog get dissappointed: no desired label yet -> close dialog - lookup section/image/table (usually involves a lot of scrolling) - click on the right spot - click on the "create label" button (or use shortcut) - enter/adjust label name - scroll back to insert position - re-open dialog for inserting cross reference - look-up and select label in dialog and finally create cross-reference I would like to contribute an improvement on this workflow: Proposed improvement: - open cross-reference dialog - select section/subsection/image/table etc. - if label exists already, choose this label -> otherwise create a new label - create cross-reference UI design/implementation ideas: 1. Button and sub-dialog approach: - add a button on the dialog "Create label" - sub-dialog opens and allows selecting existing sections/subections/images/tables in a tree-view or filtered list-view (with combo-box filter) - if a label exists for this section -> close dialog using button "Select label" - if no such label exist, enter/adjust suggested label name in line edit -> close dialog using button "Create and select"-button - in cross-reference dialog update list of labels and select newly created/selected label - create cross-reference as before 2. "switch selection list"-appraoch: This facilitates also the approach when users are not 100% sure which section to reference right now or when the choosen labels are not 100% clear in what they describe. In such cases the document structure and section captions can be a better way to select labels. Idea: the cross-reference dialog has two selection modes: a) as before, a groupable, filter-able list of existing labels b) a groupable list of all existing sections/subsections/images/tables, with highlighting (bold-face) for all list items that have already labels defined User can switch between both views via toggle-button/radio-button...Toolbox-Window..? When in mode b), user can click on a list view item. If it has already a label, the user can continue as in the current functionality. The label text is shown in a line edit below the list view (that is read-only in this case). If the selected item does not yet have a label associated, the read-only line edit becomes enabled, a default label text is composed (as in the "create label" dialog) and the button: create-label is enabled. User can click on the create label button and after a uniqueness check, the label is created in the respective section, image, table. The list view is then updated and the item with the newly created label (now also in bold-face) is selected. Then continue as above. What would be your favourite design? I personally like variant 2) better, but the first one is less intrusive (I wouldn't have to change as much existing code as for variant 2). But then again, besides a little reorganisation in ui/CreateRef.ui, it is probably not much to change. What are your thoughts? Right now I'm still investigating the code and trying to figure out how to modify the buffer correctly. Bye, Andreas