Skip to content

feat: Add TUI improvements including task list sorting, dynamic column resizing, and performance optimizations #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vidishagawas121
Copy link

TUI (Text User Interface) Improvements

This pull request adds several improvements to make the console interface more user-friendly and efficient.

🎯 What's New

1. Task List Sorting

  • Added the ability to sort tasks by their names
  • Users can now click on column headers to sort tasks
  • The sorting order toggles between ascending and descending
  • Visual indicators show which column is being sorted

2. Dynamic Column Resizing

  • Added the ability to resize columns by dragging their edges
  • Users can now adjust column widths using the mouse
  • Columns maintain their new sizes until changed again
  • Minimum width limits prevent columns from becoming too narrow

3. Performance Improvements

  • Optimized how task updates are processed
  • Made the interface more responsive when handling many tasks
  • Reduced memory usage for task list rendering
  • Improved overall UI smoothness

4. New Integration Tests

Added comprehensive tests to ensure everything works reliably:

  • Tests for task sorting functionality
  • Tests for column resizing features
  • Performance tests for handling 1000+ task updates
  • Tests for multiple column interactions

🔍 Technical Details

Modified files:

  • tokio-console/src/input.rs: Added mouse event handling for column resizing
  • tokio-console/src/state/mod.rs: Added state management for sorting and column widths
  • tokio-console/src/state/tasks.rs: Implemented task sorting logic
  • tokio-console/src/view/mod.rs: Updated view management
  • tokio-console/src/view/table.rs: Added resizable column support
  • tokio-console/src/view/tasks.rs: Implemented sorted task rendering

🧪 Testing

All new features are covered by integration tests in tokio-console/tests/tui_integration.rs. The tests verify:

  • Correct task sorting behavior
  • Accurate column width adjustments
  • Performance under heavy load
  • Proper handling of user interactions

📝 Notes

  • No breaking changes
  • All new features are optional and don't affect existing functionality
  • Performance improvements benefit all users, especially those monitoring many tasks

@vidishagawas121 vidishagawas121 requested a review from a team as a code owner April 8, 2025 02:03
Copy link
Collaborator

@hds hds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

This one looks quite large. I think it would be better to have separate PRs. As a suggestion, perhaps split up along the lines of the 4 sections in the PR text:

  • Column sort selection with mouse (sorting is already implemented)
  • Column resizing
  • Performance improvements
  • TUI integration tests

@vidishagawas121
Copy link
Author

ok! Thanks! I will look into it

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.

2 participants