rill icon indicating copy to clipboard operation
rill copied to clipboard

Show sorting icon in pivot table

Open lovincyrus opened this issue 1 year ago • 7 comments

closes #5428

This PR adds a desc sorting icon to the sorted first dimension and tweaks the delayed loading rows.

  • [x] https://rilldata.slack.com/archives/C01A9DYP013/p1726521277917949?thread_ts=1726269952.735399&cid=C01A9DYP013

lovincyrus avatar Sep 13 '24 22:09 lovincyrus

I should've commented on the original issue, but these unset states feel a little funky to me. The data is always sorted somehow, so IMO we should always indicate how the data is sorted.

In the leaderboard case, it looks like the "unset" case is for the dimensional values to be sorted alphabetically Z->A. We should indicate that & we should make it possible to sort the data A->Z. (Well, this is possible today by entering into the Dimension Detail Table.)

In the pivot case, it looks like the "unset" case is for the data to be sorted by the measure in descending order. I would rather we indicate that than not.

But that's just my opinion! I'll defer to Product on the call. If this is the way we want to go, it looks well implemented :).

ericpgreen2 avatar Sep 13 '24 23:09 ericpgreen2

I greenlit the original suggestion to unset a sort in Pivot (https://github.com/rilldata/rill/issues/5428), where the initial state has no arrow indicating sort (perhaps it should have an arrow on the totals column).

But on leaderboards, the UX is different, because the default sort should be the value column, and reverting to a default of alphabetical sort doesn't serve much use. You could argue that one shouldn't really ever need to see a leaderboard sorted by anything other than value.

Seeking input from @mindspank and @ericokuma . We could either get rid of the unsetting function altogether, or keep it but communicate the default sort state better.

jkhwu avatar Sep 16 '24 17:09 jkhwu

Is this a valid use case: "I would like to see my customers in ASC order on the leaderboard regardless of value"?

Feels like one but just wanted to double check with folks here

ericokuma avatar Sep 16 '24 18:09 ericokuma

Is this a valid use case: "I would like to see my customers in ASC order on the leaderboard regardless of value"?

I think it's a valid use case to sort alphabetically by dimension values. It's very closely related to wanting to search for a dimension value.

I'm just not confident that this functionality belongs on a "leaderboard" (in which case the word "leaderboard" kind of loses its meaning), and maybe we should just keep it on the expanded Dimension Detail Table.

ericpgreen2 avatar Sep 16 '24 19:09 ericpgreen2

Reverted and addressed the changes based on https://rilldata.slack.com/archives/C01A9DYP013/p1726521277917949?thread_ts=1726269952.735399&cid=C01A9DYP013 @ericpgreen2

lovincyrus avatar Sep 17 '24 16:09 lovincyrus

Latest demo:

https://github.com/user-attachments/assets/cd008d02-9751-4687-9839-ffe5cbf58e20

lovincyrus avatar Sep 17 '24 22:09 lovincyrus

Two things possibly related:

  1. I'm frequently hitting a bug when I put a dimension and a measure in the Columns section
  2. I'm not seeing a sort arrow when I have a dimension and measure in the Columns section (even when the bug is not triggered) image

ericpgreen2 avatar Sep 20 '24 15:09 ericpgreen2