Skip to content

Comments

feat(tui): add sortable resume picker with created/updated timestamp toggle#10752

Merged
etraut-openai merged 5 commits intoopenai:mainfrom
fcoury:fix/resume-picker-sorting
Feb 5, 2026
Merged

feat(tui): add sortable resume picker with created/updated timestamp toggle#10752
etraut-openai merged 5 commits intoopenai:mainfrom
fcoury:fix/resume-picker-sorting

Conversation

@fcoury
Copy link
Contributor

@fcoury fcoury commented Feb 5, 2026

Summary

  • Add sorting support to the resume session picker with Tab key toggle
  • Sessions can now be sorted by either creation time or last updated time
  • Display the current sort mode in the picker header
  • Default to sorting by creation time (most recent first)

Changes

  • Add sort_key field to PickerState to track current sort order
  • Pass sort key to RolloutRecorder::list_threads() for proper backend sorting
  • Add Tab key handler to toggle between CreatedAt and UpdatedAt sorting
  • Show current sort mode ("Created at" / "Updated at") in header
  • Add "Tab to toggle sort" keyboard hint
  • Intelligently hide secondary date column when terminal is narrow
  • Reload session list when sort order changes

Test plan

  • Unit tests for sort key toggle functionality
  • Snapshot tests updated for new header format
  • Test that Tab key triggers reload with new sort key
  • Test column visibility adapts to narrow terminals

- Add Tab key to toggle between creation time and last updated sorting
- Default to creation time (CreatedAt) instead of last updated (UpdatedAt)
- Display current sort key in picker header
- Add keyboard hint for toggle functionality
Add comprehensive documentation for the resume picker's core mechanisms:
- Module-level overview explaining table display, sort toggling, and pagination
- Document the two-layer filtering approach (backend + picker)
- Explain toggle_sort_key's full reload behavior
- Add helper function and struct documentation for column metrics

This is a documentation-only change with no functional modifications.
Copilot AI review requested due to automatic review settings February 5, 2026 14:08
Copy link
Contributor

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 sortable resume picker functionality with a toggle between creation time and last-updated time sorting. The feature allows users to press Tab to switch between sort modes, displays the current sort mode in the header, and intelligently hides the secondary timestamp column when the terminal is narrow.

Changes:

  • Added sort_key field to track current sort order (defaults to CreatedAt)
  • Added Tab key handler to toggle between CreatedAt and UpdatedAt sorting
  • Modified UI to show both "Created at" and "Updated at" columns (hiding one on narrow terminals)
  • Updated page load requests to pass the current sort key to the backend
  • Added comprehensive unit tests and integration tests

Reviewed changes

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

File Description
codex-rs/tui/src/resume_picker.rs Main implementation: added sort_key state field, Tab key handler, column visibility logic, and helper functions for sorting and display
codex-rs/tui/src/snapshots/codex_tui__resume_picker__tests__resume_picker_screen.snap Updated snapshot to reflect new header format with sort indicator and new column layout
codex-rs/tui/src/snapshots/codex_tui__resume_picker__tests__resume_picker_table.snap Updated snapshot showing both created/updated columns in table view
codex-rs/tui/src/snapshots/codex_tui__resume_picker__tests__resume_picker_thread_names.snap Updated snapshot showing new column headers for named threads

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

@fcoury fcoury force-pushed the fix/resume-picker-sorting branch from 3aa9323 to 4e35b94 Compare February 5, 2026 14:20
Display both "Created at" and "Updated at" columns in the resume picker,
improving visibility of session history. When terminal width is limited,
intelligently hide the inactive timestamp column (whichever doesn't match
the current sort key) to preserve space for the conversation preview.

Changes:
- Add Created at column alongside Updated at
- Implement ColumnVisibility logic to show/hide columns based on width
- Update column labels from "Creation"/"Last updated" to "Created at"/"Updated at"
- Add format_created_label() helper function
- Add column_visibility_hides_extra_date_column_when_narrow() test
- Update snapshots to reflect new column layout

The picker now shows maximum information when space allows, while gracefully
degrading to a single timestamp column on narrow terminals.
@etraut-openai
Copy link
Collaborator

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25b77c6087

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai merged commit 22545bf into openai:main Feb 5, 2026
26 of 32 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
@fcoury fcoury deleted the fix/resume-picker-sorting branch February 5, 2026 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants