Skip to content

Sorting by clicking at column in Krokiet#1718

Merged
qarmin merged 22 commits into
masterfrom
xd
Dec 27, 2025
Merged

Sorting by clicking at column in Krokiet#1718
qarmin merged 22 commits into
masterfrom
xd

Conversation

@qarmin
Copy link
Copy Markdown
Owner

@qarmin qarmin commented Dec 24, 2025

  • Added sorting, by clicking at column header in Krokiet
  • Added, enabled by default, limit 500 lines of messages in Krokiet, to avoid slow TextEdit performance

Fixes #1614 in Krokiet

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds column header click-to-sort functionality to the Krokiet UI, replacing the previous dropdown-based sorting system with direct column interaction. The implementation introduces ascending/descending sort modes that toggle on repeated clicks.

Key changes:

  • Implemented clickable column headers with TouchArea in the table view that trigger sorting via the new change_sort_column_mode callback
  • Added SortColumnMode enum (None, Ascending, Descending) to track sorting state per column
  • Refactored sorting logic to use a unified connect_sort_column function that maps column indices to appropriate data sources (strings, integer pairs for size/date, or selection state)

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
krokiet/ui/selectable_tree_view.slint Added TouchArea to column headers for click-to-sort, added sort state properties (sort_column_mode, sort_column_idx, sort_available), and scan_started function to reset sorting
krokiet/ui/main_window.slint Passed working state to main_list and called scan_started on scan initiation
krokiet/ui/main_lists.slint Added working property and connected it to sort_available on all table views, implemented scan_started dispatcher
krokiet/ui/translations.slint Removed translation properties for deprecated sort modes (ItemName, ParentName, Size, ModificationDate, Checked)
krokiet/ui/gui_state.slint Removed sort model entries for deprecated modes and updated i64 workaround comment
krokiet/ui/common.slint Added SortColumnMode enum and removed deprecated SortMode enum values
krokiet/ui/callabler.slint Added change_sort_column_mode callback and imported SortColumnMode
krokiet/src/connect_sort.rs Implemented connect_sort_column function, added reverse parameter to common_sort_function, removed deprecated sort functions, and removed corresponding tests
krokiet/src/connect_translation.rs Removed translation setup for deprecated sort modes
krokiet/src/connect_scan.rs Converted model creation to use typed arrays with MAX_*_DATA constants for all entry types
krokiet/src/common.rs Added TryFromPrimitive derives to all data enums, added MAX_*_DATA constants, implemented get_str_int_sort_idx method, and added SortIdx enum
krokiet/src/main.rs Added connect_sort_column call during app initialization
krokiet/i18n/en/krokiet.ftl Removed translation strings for deprecated sort modes
krokiet/Cargo.toml Added num_enum dependency for TryFromPrimitive
Cargo.toml Added debug and strip settings to fast_release profile (unrelated to sorting feature)
Cargo.lock Updated with num_enum dependency
Changelog.md Added entry for column header sorting feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread krokiet/ui/gui_state.slint
Comment thread krokiet/src/common.rs
Comment thread krokiet/src/common.rs
Comment thread Cargo.toml
Comment thread krokiet/src/connect_sort.rs
Comment thread krokiet/ui/selectable_tree_view.slint
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Changelog.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 38 changed files in this pull request and generated 14 comments.

Comments suppressed due to low confidence (1)

czkawka_gui/src/gui_structs/gui_about.rs:146

  • The Krokiet button does not have a tooltip set, while all other buttons (repository, donation, instruction, translation) have tooltips. This creates an inconsistent user experience. Consider adding a tooltip to explain what the Krokiet button does.
        self.button_repository.set_tooltip_text(Some(&flg!("about_repository_button_tooltip")));
        self.button_donation.set_tooltip_text(Some(&flg!("about_donation_button_tooltip")));
        self.button_instruction.set_tooltip_text(Some(&flg!("about_instruction_button_tooltip")));
        self.button_translation.set_tooltip_text(Some(&flg!("about_translation_button_tooltip")));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread krokiet/src/connect_sort.rs
Comment thread krokiet/src/common.rs
Comment thread czkawka_core/src/tools/similar_videos/core.rs
Comment thread Cargo.toml
Comment thread krokiet/ui/selectable_tree_view.slint
Comment thread Changelog.md
Comment thread czkawka_gui/README.md
Comment thread krokiet/i18n/en/krokiet.ftl
Comment thread krokiet/ui/selectable_tree_view.slint
Comment thread czkawka_gui/src/gui_structs/gui_about.rs
@qarmin qarmin merged commit 66a70c6 into master Dec 27, 2025
32 checks passed
@qarmin qarmin deleted the xd branch December 27, 2025 16:44
SpeedyGX pushed a commit to SpeedyGX/czkawka that referenced this pull request Apr 29, 2026
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.

Enable sorting by clicking on column headers in search results

2 participants