Bug 150027 - Turn on "Range contains column labels" (for sorting) by default
Summary: Turn on "Range contains column labels" (for sorting) by default
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2022-07-17 19:39 UTC by Dan Haiduc
Modified: 2024-04-19 08:05 UTC (History)
5 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 Dan Haiduc 2022-07-17 19:39:24 UTC
Description:
I very rarely sort ranges without column labels.

Having "Range contains column labels" activated by default would improve my workflow a lot, and I'm sure others' as well.

I believe sort options (at least this one) should be remembered forever, across sheets, documents and restarts. Perhaps they should even be moved or copied to a new section "Tools -> Options -> LibreOffice Calc -> Sort" or somesuch.


Steps to Reproduce:
1. Open a TSV file with a header row, and numeric data afterwards.
2. Click the title of the column you want to sort.
3. Click the "Sort Ascending" button. 

When I have a new document with many sheets pasted in, I have to enable it for each sheet I want to sort.

Actual Results:
Headers are treated as data (and an alphabetic header is treated as the maximum value and sorted to the end of a numeric range).

Expected Results:
Functionality-wise I personally have no preference among the following 4 implementation options, but I suspect option A will be easier to implement (and therefore faster to release, and therefore I prefer it):

Option A: Set "Range contains column labels" on by default.

Option B: Ensure the user's "Range contains column labels" will be remembered forever, across sheets, documents and restarts, time, space, and multiverses.

Option C: Ensure all sort options will be remembered forever, across sheets, documents and restarts, time, space, and multiverses.

Option D: Move the sort option to a new Preferences section and remember them permanently ("Tools -> Options -> LibreOffice Calc -> Sort" or somesuch).


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.7.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 20; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-GB (en_US.utf8); UI: en-US
7.2.7-3
Calc: threaded
Comment 1 Brian 2023-01-03 17:15:32 UTC
If I may, I agree with the point made by the OP and the rationale, but I also think this issue could be more "intelligent".  In many of the cases I deal with, at least one of the columns has something in row 1 that differs greatly from every other value in that column.  This seems like something that one could leverage to "assume" that columns contain headers.  The most obvious case is if the first row has text and the remaining rows are numbers, dates, or something else.  But, even taking a snapshot of the first 10 rows and doing a few comparisons, you could make an educated guess as to whether the column has a first row that is different enough from all the other values that it's safe to assume it's a header.

IDK, maybe that's easier said than done, but it seems like something someone could do without too much trouble.
Comment 2 Cor Nouws 2024-04-10 10:59:48 UTC
Hi Dan,

(In reply to Dan Haiduc from comment #0)
> Description:
> I very rarely sort ranges without column labels.
> 
> Having "Range contains column labels" activated by default would improve my
> workflow a lot, and I'm sure others' as well.
I think for me, the option is always checked in case there are clear column labels?
Cheers,
Cor
Comment 3 Eyal Rozenberg 2024-04-16 22:46:44 UTC
I sometimes sort ranges with column headers/labels and sometimes columns which don't have them.

Long story short:

I OPPOSE option A, since IMHO it's more difficult to notice that non-column-headers have been misplaced, than to notice the column headers have been misplaced.

I SUPPORT option B, i.e. a persistent default choice.

I OPPOSE option C, but not on principle, just as exceeding the scope of this bug. I would expect a separate bug about other contexts, unless you can demonstrate that it's the same issue in specific other contexts.

I WEAKLY OPPOSE option D, since I don't want to go look for preferences to choose my sort options. But I don't mind if that existed _also_ in the preferences.

As for Brian's suggestion, of applying an intelligent heuristic instead of a fixed preference - that would be nice, if someone were to implement it; but perhaps that merits a separate bug, or at least - let option B be implemented as soon as possible, and a heuristic could be a potential extra. Perhaps a project for new developers?
Comment 4 Cor Nouws 2024-04-18 09:12:24 UTC
(In reply to Cor Nouws from comment #2)
> Hi Dan,
> 
> (In reply to Dan Haiduc from comment #0)
> > Description:
> > I very rarely sort ranges without column labels.
> > 
> > Having "Range contains column labels" activated by default would improve my
> > workflow a lot, and I'm sure others' as well.
> I think for me, the option is always checked in case there are clear column
> labels?

So short: I do not see a problem..
Can others clearly describe what happens for them in various situations?
Comment 5 Heiko Tietze 2024-04-19 08:05:49 UTC
We discussed the topic in the design meeting.

Tested the STR on various systems and in all cases we provide smart functionality. The range header is enabled if the top row contains text. => invalid (feel free to reopen with more precise STR)