yari icon indicating copy to clipboard operation
yari copied to clipboard

fix(translations/dashboard): fix table sorting

Open leon-win opened this issue 1 year ago • 2 comments

Problem

Main problem: in table "List of direct subpages" only 4 columns supports sorting ("Slug", "Popularity rank (en-US", "Popularity rank ({locale}" and "Date delta"). If user clicks on any other column, an error occurs that can only be resolved by clearing the browser data.

Secondary: active (sorted) column header looked unreadable when the dark theme was enabled (see screenshots). Also indicating of reverse sorting order implemented by flipping the text upside down, this is a fun solution))) but not very user-friendly because it's hard to read the column title when it's upside down.

Solution

Main problem: add sortable prop for columns that support sorting. It also helps to style sortable column headers (use custom cursor).

Secondary: replace hard-coded colors with variables and add icon 'small-arrow` (I haven't found a more suitable icon) instead of flipping the column title.


Screenshots

Before

before-dark before-light-reverse

After

after-dark after-light-reverse

leon-win avatar Oct 30 '23 23:10 leon-win

@peterbe, @SphinxKnight, @caugner, help me with review please :pray:

leon-win avatar Nov 26 '23 17:11 leon-win

Really sorry for the silence here @leon-win , I'll try to have a look in the coming days

cc @mdn/core-dev

SphinxKnight avatar Jan 13 '24 13:01 SphinxKnight

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Apr 04 '24 12:04 github-actions[bot]

@leon-win We merged some changes to the translations/differences page. Can you please take a look and resolve the merge conflicts? 🙏

@hochan222 @queengooborg Would you mind reviewing and testing this change locally? That would be awesome.

caugner avatar Apr 04 '24 12:04 caugner

@leon-win We merged some changes to the translations/differences page. Can you please take a look and resolve the merge conflicts? 🙏

@hochan222 @queengooborg Would you mind reviewing and testing this change locally? That would be awesome.

Conflicts resolved :ok_hand:

I also changed some the styles a little to make the content on the pages look better (indentation and stretching to fit the width).

Before (in main branch now): image image

After: image image

leon-win avatar Apr 04 '24 17:04 leon-win