Skip to content

Better sorting#2

Open
tkroening wants to merge 9 commits intomasterfrom
better-sorting
Open

Better sorting#2
tkroening wants to merge 9 commits intomasterfrom
better-sorting

Conversation

@tkroening
Copy link
Owner

Description

Implements a new multi-sort UI and algorithm to allow sorting on an arbitrary combination of columns (and their biases and orderings) to address the need for sorting improvements.

image
Video demo

  • The new "Multi-Sort" popup allows the user to build and edit a custom sort-order, and then have it applied on the "main page".
  • The back-end has been updated with a new function that can sort based on a user-defined ordering of the columns. The original column sorting functionality has been left intact.

Fixes Kubis10#29

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a readme update

How Has This Been Tested?

This PR successfully implements the sort described in the original issue (Kubis10#29):

add option to sort by chat type and messages count in the same time

Test A

  1. Load sample data
  2. Click the "Multi-sort" button in the sidebar to open the new pop-up
  3. To add the message type to the sort order: click "type" in "Available columns", click "Add", then click "Reverse" (to sort in descending order.
  4. Do the same for the message count ("msg")
  5. Click "Apply"

Result: the data is successfully sorted by chat type first, and message count second, both in descending order.

Test B

  1. Load sample data
  2. Click the "Multi-sort" button in the sidebar
  3. Add just one column to the sort order, say "name"
  4. Click "Apply"

Result: the data is successfully sorted by name

Test C

  1. Load sample data
  2. Click "name" column header

Result: the data is successfully sorted by name, as in the current version of the app.

Test Configuration:

  • App version: 0.1.7 (with my changes added)
  • Hardware: Framework Laptop 13 (Intel) running Debian Trixie

Checklist:

  • My code follows the style guidelines of this project
    • Some small changes still remain (there is camelCase in some places)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
    • Not yet - this feature builds on a Linux fix I needed to add to run the app.

- Adds new "Multi-sort" popup that lets you customize the sort.
- Also adds a new sorting function that lets you sort based on any
  arbitrary combination of columns.
- Tested on example given in the original issue (sort by chat type then number
  of messages) and on single column sorts.
- Only supports English for now.
- Listboxes now use full column titles rather than abbreviations
- Listboxes fill the width of the window to accomodate larger titles
- Only restores sort order if one is stored in MainPage
- Still gets overwritten if the user does a one-column sort
@tkroening
Copy link
Owner Author

New updates:

  • Listboxes now display the full column titles and take up the full width of the window to accommodate them.
  • The app initializes the multi-sort popup with the current sort ordering if it hasn't been cleared. The app clears the sort order if the user clicks on a column, but this behavior could be disabled with minimal changes.

Screenshot:
image
Video demo

The popup now tries to read selections from both listboxes when the
"reverse" and "remove" buttons are clicked
- Added translations for all the included languages. These translations
  were generated using an LLM (Google Gemini).
@tkroening tkroening marked this pull request as ready for review April 23, 2024 21:53
@tkroening
Copy link
Owner Author

It may be helpful to merge this in so that people can work on top these changes more easily

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.

Add better sorting

1 participant