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

Open Beginner friendly
#6,203 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@BitPluto is already working on this.

Since Dec 3, 2026.

  • #6204 by @BitPluto — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, typescript
Domain
devops

Research direction

Read apps/dokploy/components/dashboard/docker/volumes/show-volumes.tsx and compare its Size column with the Images table’s Size column. Set a numeric accessor for the parsed volume size and use a consistent alphanumeric sorting function for the text columns. Done means Size sorts correctly in both directions and text column order stays consistent with 7 or 16 rows and while searching; the issue reports these checks in a local dev instance.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
38.8k
Forks
3.2k
Avg merge
1d 8h
Merged PRs (30d)
117

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Dokploy/dokploy

All issues in Dokploy/dokploy

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.