Description: In the sorting dialog, there isn't a mode picker for paragraphs and headings. In terms of splitting sections, this could be done up to where the next heading is found (maybe this could be specified by the dialog as well). Steps to Reproduce: 1. Apply Level 1 heading style to lines of text 2. Add text beneath the headings 3. Click "Tools", "Sort". Actual Results: Both the headings and the contents within them are sorted; the original contents are not kept with the headings. Expected Results: Expected to see more options in the dialog, to control which styles control the sorting, and being able to sort headings, without affecting the order of the content in between them. Reproducible: Always User Profile Reset: No Additional Info: Version: 25.8.3.2 (X86_64) / LibreOffice Community Build ID: 580(Build:2) CPU threads: 12; OS: Linux 6.17; UI render: default; VCL: gtk3 Locale: en-NZ (en_NZ.UTF-8); UI: en-US 25.8.3-2 Calc: CL threaded
I confirm the current behaviour with Version: 26.8.0.0.alpha0+ (X86_64) Build ID: 680(Build:0) CPU threads: 12; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL threaded Not sure about a solution. I thought outline folding could be a solution, but sort commant is not available with outline folding. cc: Design-Team
Took me a while to understand that Tools > Sort as well as Table > Sort requires some selection to work (but are also enabled on fields like the current date). And both .uno:SortDialog and .uno:TableSort seem to start the dialog. I would not expect any paragraph sorting. However, a new command was implemented recently for bug 167491, which sorts the document chapters alphabetically. You need to enable experimental features and customize the command Sort Chapters / .uno:SortChapters manually into the UI. And this function keeps the text within the sorted chapter. STR: <H1>Beta> 123 <H1>Alpha> 456 select all, run tools > sort results in 123 456 <H1>Alpha</H1> <H1>Beta</H1> My take: One sort function for tables, another for text. With clear naming (we have four "Sort" available for customization). Some options to define what level should be sorted sounds reasonable. But it complicates the workflow as you may ask for the level (eg. sort level 2 and 3 but not 1 and 4) or scope (eg. sort all levels in the current chapter). I suggest to not add these options and run the command from the Navigator either on Headings (sorting all chapters) or the "First Chapter" sorting all items below. This clashes with the current "Sort Alphabetically" that could become a toggle on the header. Or just renamed to "Sort List Alphabetically" (vs "Order Chapters Alphabetically"). Or consider radio buttons like bug 160951. Table sort should (virtually) auto-select the table. For text sort I would always run the function on the entire text or parts if defined in some options dialog.
No further input, removing UX. (In reply to Heiko Tietze from comment #2) > run the command from the Navigator either on Headings > (sorting all chapters) or the "First Chapter" sorting all > items below. This clashes with the current "Sort Alphabetically" that could > become a toggle on the header. Or just renamed to "Sort List Alphabetically" > (vs "Order Chapters Alphabetically"). Or consider radio buttons like bug > 160951. Is this feasible, Jim? Is this acceptable, edition?
(In reply to Heiko Tietze from comment #3) > No further input, removing UX. > > (In reply to Heiko Tietze from comment #2) > > run the command from the Navigator either on Headings > > (sorting all chapters) or the "First Chapter" sorting all > > items below. This clashes with the current "Sort Alphabetically" that could > > become a toggle on the header. Or just renamed to "Sort List Alphabetically" > > (vs "Order Chapters Alphabetically"). Or consider radio buttons like bug > > 160951. > Is this feasible, Jim? Is this acceptable, edition? Note: changed name from "edition" to "Ben Cottrell" No, keep it under the "Tools" menu. If we want feature parity with Word, just sort the highest level headings. We could also include a "Sorting" button, which Word has on the "Paragraph" tab group, under the "Home" tab. I suggest meeting the basic requirements for user expectations first, followed by more advanced features later.
Created attachment 205041 [details] Demo of Navigator approach to do this I was able to adapt what was done for the similar request in Bug 167491 for use by both that and this proposed approach using the Navigator. To test, the enable experiment features needs to be checked in the Options dialog LibreOffice-Advanced tab page. (Menu > Tools > Options > LibreOffice > Advanced options) The patch that does what is shown in the demo is here: https://gerrit.libreoffice.org/c/core/+/197230
(In reply to Jim Raykowski from comment #5) > Created attachment 205041 [details] > Demo of Navigator approach to do this > > I was able to adapt what was done for the similar request in Bug 167491 for > use by both that and this proposed approach using the Navigator. > Could this be adapted to the sort dialog, accessed under the tools menu?
(In reply to Jim Raykowski from comment #5) > Demo of Navigator approach to do this Awesome! (In reply to Ben Cottrell from comment #6) > Could this be adapted to the sort dialog, accessed under the tools menu? Please don't. What we have now as Sort under Tool should become Table > Sort, run unconditionally, meaning not depending on a selection, for the whole table. The Navigator approach is simple, easy to use and to understand by average users. Having the sort by chapter function in a dialog requires some kind of interface for the chapters which would be over-engineering.
(In reply to Heiko Tietze from comment #7) > (In reply to Jim Raykowski from comment #5) > > Demo of Navigator approach to do this > Awesome! > > (In reply to Ben Cottrell from comment #6) > > Could this be adapted to the sort dialog, accessed under the tools menu? > Please don't. What we have now as Sort under Tool should become Table > > Sort, run unconditionally, meaning not depending on a selection, for the > whole table. > > The Navigator approach is simple, easy to use and to understand by average > users. Having the sort by chapter function in a dialog requires some kind of > interface for the chapters which would be over-engineering. OK, how about a separate dialog for sorting headers instead, say, in the edit menu, in the short term? As there may be lots of users coming from Microsoft Word, I think it would be helpful to ease the learning curve. It's also useful to have things accessible in fewer clicks as possible.
Jim Raykowski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9be7dacd773ee32a3d50dba77115fbee92506cea tdf#169674 Sort headings and retain their contents while moving them It will be available in 26.8.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.
@Ben: Thanks for the ideas! I didn't know of the Sort dialog until seeing your request here. I agree with Heiko that there should be separate dialogs for tables and text: "My take: One sort function for tables, another for text." How would a text sort dialog look? Maybe a mock-up would be a good place to start?
(In reply to Jim Raykowski from comment #10) > @Ben: Thanks for the ideas! > > I didn't know of the Sort dialog until seeing your request here. I agree > with Heiko that there should be separate dialogs for tables and text: "My > take: One sort function for tables, another for text." > > How would a text sort dialog look? Maybe a mock-up would be a good place to > start? Could just borrow the design from Word, like this screenshot: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.extendoffice.com%2Fimages%2Fstories%2Fdoc-word%2Fsort-by-last-name%2Fdoc-sort-by-last-name-4.png&f=1&nofb=1&ipt=6277cf682af417399f7012e35716f4e5b92b5cf6a6ea080f56ff9bd18b4870f5