Added the ability to sort installed applications. by rowanchen-com · Pull Request #11936 · 1Panel-dev/1Panel

What this PR does / why we need it?

Add drag-and-drop sorting for installed apps in the App Store > Installed tab.

Currently, users cannot customize the display order of installed applications. This PR adds a "Sort" button that enters a sort mode where users can drag app cards to reorder them. Favorites and non-favorites are kept in separate groups (fence/barrier) — favorites always stay on top and can only be reordered among themselves, same for non-favorites.

Summary of your change

Backend:

  • Added sort_order field to app_installs table with DB migration
  • Added POST /apps/installed/sort/update API endpoint to persist sort order
  • Modified query ordering: favorite DESC, sort_order ASC
  • When toggling favorite, automatically set sort_order to max+1 of the target group so newly favorited/unfavorited apps appear at the end of their group

Frontend:

  • Added sortablejs dependency for drag-and-drop
  • Added "Sort" button in the installed apps toolbar, with confirm/cancel buttons in sort mode
  • Sort mode hides pagination and loads all apps for cross-page reordering
  • Implemented onMove fence: favorites can only reorder among favorites, non-favorites among non-favorites
  • Added .sortable-ghost style for drag visual feedback
  • Added sortMode i18n key for all 10 languages (zh, zh-Hant, en, es-es, ja, ko, ms, pt-br, ru, tr)

Files changed: 23 files (9 backend, 14 frontend)

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.