Skip to content

25 add history sort order preference#36

Merged
rodolakis merged 2 commits into
mainfrom
25-add-history-sort-order-preference
Jan 15, 2026
Merged

25 add history sort order preference#36
rodolakis merged 2 commits into
mainfrom
25-add-history-sort-order-preference

Conversation

@rodolakis

Copy link
Copy Markdown
Contributor
  • close Add history sort order preference #25: Add user-configurable history sort order preference

    • Default behavior: newest items appear first (True)
    • Add menu action 'Sort newest history item first' in View menu
    • Implement settings methods to save/load sort preference
  • close Console messages #34: commented out the print(txt) from setMessage(txt) (method to set status in the main window status bar)

  • close Save history to file #20:

    • Add 'Save History' menu action in File menu
    • Add save button in history widget toolbar
    • Implement doSaveHistory() method in MainWindow to save history as CSV
    • Extract data with separate columns for Status, Name, Detector, Arguments, Metadata, User
    • Apply current sort setting to saved data (matches display)
    • Include sort order indication at end of CSV file

- Default behavior: newest items appear first (True)
- Add menu action 'Sort newest history item first' in View menu
- Implement settings methods to save/load sort preference:
  * getHistorySortNewestFirst() - returns True by default (newest first)
  * setHistorySortNewestFirst() - saves user preference
- Add _apply_sort_setting() method in HistoryWidget to reverse data when needed
- Apply sort setting in all history data update paths:
  * _on_history_changed() - when history changes
  * _on_toggle_view() - when switching between static/dynamic views
  * _on_copy_to_queue_clicked() - when copying items (fixes row index mapping)
  * onStatusChanged() - when plans become available
- Connect menu action in MainWindow to toggle sort direction
- Update menu action checked state to reflect current setting
- Add 'Save History' menu action in File menu
- Add save button in history widget toolbar
- Implement doSaveHistory() method in MainWindow to save history as CSV
- Extract data with separate columns for Status, Name, Detector, Arguments, Metadata, User
- Apply current sort setting to saved data (matches display)
- Include sort order indication at end of CSV file
- Add writeHistoryFile() method to handle file dialog and CSV writing
- Add extract_row_data() and extract_arguments() helper methods
@rodolakis rodolakis linked an issue Jan 14, 2026 that may be closed by this pull request
@rodolakis rodolakis requested a review from prjemian January 14, 2026 19:19
@rodolakis rodolakis self-assigned this Jan 14, 2026
@rodolakis

rodolakis commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

Accessible via File/Save History menu or Save button:

image image

In excel:

image

In text editor:

image

@prjemian prjemian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Works for me. What's the difference between the placement of the sort order in the View menu v. File menu Preferences?

Image

Good enough for now. Might reconsider if a dialog for Preferences is implemented.

@rodolakis rodolakis merged commit 087de31 into main Jan 15, 2026
1 check passed
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.

Console messages Add history sort order preference Save history to file

2 participants