Skip to content

chore: sort agent /list-directory output #17218

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Apr 2, 2025

This sorts the contents list alphabetically, but with directories before everything else.
This is purely for UX on the Coder Desktop side, where the user only really cares about directories, and files are just for providing context in the file picker.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review April 2, 2025 11:35
Copy link
Contributor

@Copilot 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 refines the output of the /list-directory agent command by sorting the contents list alphabetically with directories prioritized for an improved UX on the Coder Desktop interface.

  • Updated the sorting logic in agent/ls.go to ensure directories appear first, followed by files in alphabetical order.
  • Modified the test in agent/ls_internal_test.go to validate the new order using require.Equal.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
agent/ls_internal_test.go Updated test expectations to check explicit sorted output.
agent/ls.go Introduced a sorting function with directories prioritized.

@ethanndickson ethanndickson merged commit 998724d into main Apr 3, 2025
43 checks passed
@ethanndickson ethanndickson deleted the ethan/sort-agent-list-directory branch April 3, 2025 01:31
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
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