Skip to content

feat: Add column sorting to all TUI DataTable screens (Fixes #74) - #198

Open
Bhagyashri77777 wants to merge 1 commit into
0-Shimanshu:mainfrom
Bhagyashri77777:feat-datatable-sorting
Open

feat: Add column sorting to all TUI DataTable screens (Fixes #74)#198
Bhagyashri77777 wants to merge 1 commit into
0-Shimanshu:mainfrom
Bhagyashri77777:feat-datatable-sorting

Conversation

@Bhagyashri77777

Copy link
Copy Markdown

What does this PR do?

This PR adds column sorting functionality to all the Textual DataTable screens in the TUI, solving Issue #74 under GSSoC 2026!

Implementation Details

Instead of hardcoding the sorting logic into every single screen file, I created a reusable custom component to keep the codebase clean and modular:

  • Created a new SortableDataTable class in adiuvare/tui/sortable_table.py.
  • The logic supports 3 states on header click: Ascending (A-Z) -> Descending (Z-A) -> Default/None.
  • Replaced the standard DataTable with our new SortableDataTable in:
    • adiuvare/tui/screens/audit.py
    • adiuvare/tui/screens/changes.py
    • adiuvare/tui/screens/events.py

Acceptance Criteria Met

  • All DataTable column headers are clickable for sorting.
  • Ascending and descending sort both work correctly.
  • Sorting applied consistently across all screens.
  • Default order restored on the third click.

@github-actions github-actions Bot added the enhancement New feature or request label Jun 18, 2026
@Bhagyashri77777

Copy link
Copy Markdown
Author

Hi @0-Shimanshu

My end-semester exams are finally over, and I've successfully completed the feature as promised!

I created a central SortableDataTable class and injected it into the various screens to make sure the codebase stays clean and easy to maintain. I have tested it locally using the TUI and everything works perfectly.

Could you please review this PR when you have some time? Let me know if any changes are needed. Happy to be contributing to ADIUVARE for GSSoC 2026!

@Wahid7852

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. Before review, please get the branch back to a clean state:

Remove the accidentally committed adiuvare.yaml.
Fix all failing CI checks.
The current implementation does not appear to restore the original row order on the third click; it only resets the internal sort state.
Please add tests covering ascending, descending, and reset behavior.
Keep unrelated UI/content changes out of the PR unless they are required for the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants