Docker > Volumes: sorting by Size does nothing, and text columns sort inconsistently
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 79/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, typescript
- 領域
- devops
調査の方向性
apps/dokploy/components/dashboard/docker/volumes/show-volumes.tsxを読み、そのSize列をImagesテーブルのSize列と比較します。解析済みのボリュームサイズに数値のaccessorを設定し、テキスト列には一貫した英数字ソート関数を使用します。Sizeが両方向で正しくソートされ、7行または16行の場合と検索中にテキスト列の順序が一貫していることを確認できたら完了です。issueでは、ローカルの開発インスタンスでこれらの確認を行ったと報告します。
索引モデルが issue の本文から書いたものです。
説明
To Reproduce
- Open Docker → Volumes on a server with a few volumes of different sizes. Names like
app2_data,app9_data,app10_dataand one starting with an uppercase letter (Zeta_cache) make the problem easy to see. - Wait for the Size column to finish loading.
- Click the Size header, then click it again.
- 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 lsprints 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_cachecomes beforealpha_logs, and the order isapp10_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 forappturns that intoapp10_data,app2_data,app9_data.
- 10 rows or fewer: plain string comparison.
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
idand asortingFnbut noaccessorFn. TanStack'scolumn.getCanSort()requires anaccessorFn, andgetSortedRowModeldrops 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 samplinggetFilteredRowModel().flatRows.slice(10), which is rows 11 onwards. With 10 or fewer rows nothing is sampled and it falls back tobasic; otherwise it picksalphanumeric(ortextif 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 customsortingFn. - Name, Driver, Scope, Mountpoint: set
sortingFn: "alphanumeric". That's the order users already get with more than 10 volumes, and it keepsapp2_databeforeapp10_data."text"would also be consistent, but it compares character by character, soapp10_datawould stay beforeapp2_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):
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
- 主要言語
- TypeScript
- スター
- 38.8k
- フォーク
- 3.2k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 117
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Dokploy/dokploy のほかの issue
-
needs-triage🔍
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Dokploy/dokploy#6197 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Healthy Swarm task shows an empty `(Error:)` suffix on the last row of the Containers tab対応中かも @AyhamJo7 が 7 日前に担当しました。 オープンneeds-triage🔍
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Dokploy/dokploy#6115 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
MongoDB with Replica Sets enabled: container exits with code 0 and restarts in a loop (generated startup script never waits on mongod)対応中かも @ghazy2001 が 13 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Dokploy/dokploy#6051 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Dokploy monitoring API returns partial container metrics with HTTP 200 when a row read fails対応中かも @PAtreju が 15 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Dokploy/dokploy#6029 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Volume backup silently uploads an empty tar when the volume does not exist on the host (stack prefix missing / service on swarm worker)対応中かも @PAtreju が 15 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Dokploy/dokploy#6022 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
Dokploy/dokploy の issue をすべて見る
似ている issue
-
🔨 tool 🧰 library
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Orange-OpenSource/Orange-Boosted-Bootstrap#4035 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
DISIC/teleservice-conformite#230 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
rothgar/rabble.radio#410 ·
メンテナーはふだん 1 日以内に返信
-
area/webapp comp/desktop P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#163341 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
smart-village-solutions/smart-speech-flow#765 ·
メンテナーはふだん 1 日以内に返信