Skip to content

highlight the primary sort column#111

Merged
severo merged 1 commit intomasterfrom
highlight-primary-sorted-column
Apr 8, 2025
Merged

highlight the primary sort column#111
severo merged 1 commit intomasterfrom
highlight-primary-sorted-column

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented Apr 8, 2025

fixes #93

Use the aria-posinset attribute to style the column header depending on its sort order

  th[aria-posinset="0"]::after {
    color: inherit;
  }
Screencast.From.2025-04-08.11-59-24.webm.mp4

@severo severo requested review from bleakley and platypii April 8, 2025 10:00
@bleakley
Copy link
Copy Markdown
Contributor

bleakley commented Apr 8, 2025

Visually I think this is a great idea. It's pretty clear which column is primary and which are secondary.

In terms of the sort behavior I'm confused though. If I apply a sort to Count, it sorts correctly. Then if I apply a sort to Value1 (a column where each row has the same value) the rows get seemingly randomly scrambled. Even though by my understanding they should still be sorted by Count, because if the primary sort is just an arbitrary order if the values are the same, the rows should be in the order of the secondary sort column, right?

I'm seeing the same thing in both the gif and testing it out myself.

@severo
Copy link
Copy Markdown
Contributor Author

severo commented Apr 8, 2025

Indeed, if all the values are the same in the primary column, the rows should be sorted along the secondary column. If not, it's a bug!

Note that in this example, the columns Value1, Value2 and Value3 contain random integers between 0 and 100

@bleakley
Copy link
Copy Markdown
Contributor

bleakley commented Apr 8, 2025

Ok, good to know! I thought I was going crazy for a second. It's not really related to the styling changes here. So I'll approve this and open an bug.

@severo severo merged commit 9ccc20a into master Apr 8, 2025
8 checks passed
@severo severo deleted the highlight-primary-sorted-column branch April 8, 2025 14:43
@bleakley bleakley mentioned this pull request Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use style to better indicate the primary sort column

2 participants