Files
sim/apps
Waleed 22b3569627 fix(files): order file folders in SQL like every other folder list (#6599)
The list use case defaulted to a name sort whose defaults were written for the
new v2 contract, so the internal route — whose contract exposes no sort params —
could no longer reach the repository's sortOrder ASC, createdAt ASC ordering.
Surfaces that render the payload positionally (the @-mention Folders group, the
add-resource search results, Copilot's list_file_folders) silently flipped from
newest-first to alphabetical, and the Files browser's SSR prefetch hydrated a
different order than its own refetch.

Push the sort down to the query like the workflow, knowledge, and table folder
lists already do, reusing FOLDER_SORTS. Omitting sortBy keeps the position
ordering; v2 always sends one from its contract defaults. A name sort now also
uses the database collation and the shared createdAt tiebreak instead of a JS
comparator over UTF-16 code units.
2026-08-11 21:48:01 -07:00
..
…