Docker > Volumes: sorting by Size does nothing, and text columns sort inconsistently

Aperta Adatta ai principianti
#6,203 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@BitPluto ci sta già lavorando.

Dal 3/12/2026.

  • #6204 di @BitPluto — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
79/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, typescript
Ambito
devops

Direzione di ricerca

Leggi apps/dokploy/components/dashboard/docker/volumes/show-volumes.tsx e confronta la sua colonna Size con la colonna Size della tabella Images. Imposta un accessor numerico per la dimensione del volume analizzata e usa una funzione di ordinamento alfanumerico coerente per le colonne di testo. Il lavoro è completato quando Size viene ordinata correttamente in entrambe le direzioni e l’ordine delle colonne di testo rimane coerente con 7 o 16 righe e durante la ricerca; l’issue segnala queste verifiche in un’istanza di sviluppo locale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs-triage🔍
To Reproduce
  1. Open Docker → Volumes on a server with a few volumes of different sizes. Names like app2_data, app9_data, app10_data and one starting with an uppercase letter (Zeta_cache) make the problem easy to see.
  2. Wait for the Size column to finish loading.
  3. Click the Size header, then click it again.
  4. Look at the Name order. With 10 or fewer volumes, look at the default order. With more than 10, type into the search box until 10 or fewer are left (for example app) and compare.
Current vs. Expected behavior

Current (reproduced on a local dev instance of canary @ dbf8034, with 7 and with 16 volumes)

  • Clicking Size doesn't sort by size in either direction. The rows stay in the order docker volume ls prints them (by name), and the second click shows the same order as the first.
  • Name, Driver, Scope and Mountpoint compare values differently depending on how many rows the table holds:
    • 10 rows or fewer: plain string comparison. Zeta_cache comes before alpha_logs, and the order is app10_data, app2_data, app9_data.
    • More than 10 rows: case-insensitive and number-aware, so alpha_logs, app2_data, app9_data, app10_data, …, Zeta_cache.
    • So the order changes while you type: with 16 volumes, Name shows app2_data, app9_data, app10_data, and searching for app turns that into app10_data, app2_data, app9_data.

Expected
Size sorts by the actual size, and text columns always sort the same way, however many rows there are.

Cause (apps/dokploy/components/dashboard/docker/volumes/show-volumes.tsx, TanStack Table 8.21.3)

  • The Size column has an id and a sortingFn but no accessorFn. TanStack's column.getCanSort() requires an accessorFn, and getSortedRowModel drops sort entries whose column can't sort, so the Size sort is silently ignored.
  • The text columns use the default "auto" sorting function. TanStack picks it by sampling getFilteredRowModel().flatRows.slice(10), which is rows 11 onwards. With 10 or fewer rows nothing is sampled and it falls back to basic; otherwise it picks alphanumeric (or text if the sampled values contain no digits). The search box filters the data before it reaches the table, so the row count, and with it the sorting function, changes as you type.

Proposed fix

  • Size: do what the Images table already does (show-images.tsx#L262-L263): accessorFn: (row) => parseSize(sizeByName.get(row.Name) ?? undefined). Keep the cell showing the human-readable size and drop the custom sortingFn.
  • Name, Driver, Scope, Mountpoint: set sortingFn: "alphanumeric". That's the order users already get with more than 10 volumes, and it keeps app2_data before app10_data. "text" would also be consistent, but it compares character by character, so app10_data would stay before app2_data.

I've tested this change (5 lines added, 3 removed) in a local dev instance. Size now sorts correctly in both directions, and Name gives the same order with 7 rows, 16 rows and while searching.

Screenshots (current behaviour, local dev instance: 7 volumes in the default Name order, the same 7 after clicking Size, and 16 volumes while searching for app):

before-small-1-default before-small-2-size-click1 before-big-5-name-asc-search-app
Provide environment information
Operating System:
  OS: Ubuntu 26.04 (WSL2)
  Arch: x86_64
Dokploy version: v0.31.8 (canary @ dbf8034, local dev instance)
VPS Provider: none, local machine
What applications/services are you tying to deploy?
  Not service-specific: this is the Docker > Volumes page.
Which area(s) are affected? (Select all that apply)

Docker

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context
  • The Images and Disk Usage tables already give their Size column an accessorFn, so only the Volumes table has the first problem.
  • The "auto" sampling quirk also affects text columns in other tables (for example Images → Repository/Tag). I'd keep this fix to the Volumes table unless you want the others changed in the same PR.
  • The sort headers always show the same ↕ icon, so you can't tell which column is sorted or in which direction. I've left that out of the fix.
  • Related: #6192 (a volumes view on the compose page, which would reuse this table's sorting).
Will you send a PR to fix it?

Yes

Lingua principale
TypeScript
Stelle
38.8k
Fork
3.2k
Merge medio
1g 8h
PR unite (30g)
117

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Dokploy/dokploy

Tutte le issue di Dokploy/dokploy

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.