Repository navigation
feat: restore a sortable size column on the anvil files index (#4986) - #4989
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the stated requirements and includes appropriate unit and end-to-end coverage.
0 open findings
What changed in this PR
Restores sortable file-size visibility in the AnVIL Files table while removing duplicate size chips.
Changes:
- Adds the Size column and category metadata.
- Restores
buildFileSizeand removes size from file identity chips. - Updates unit and end-to-end expectations.
| File | Description |
|---|---|
site-config/anvil-cmg/dev/index/filesEntityConfig.ts |
Adds the sortable Size column. |
site-config/anvil-cmg/category.ts |
Restores the size key and label. |
e2e/anvil/constants.ts |
Adds Size to expected file columns. |
app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx |
Restores the size builder and updates identity chips. |
__tests__/viewModelBuilders/file-identity.test.tsx |
Tests identity and size rendering. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
NoopDog
approved these changes
Oct 12, 2026
- add the size column back after the file identity column, sorted on files.file_size, with the buildfilesize builder and the file size category key and label - remove the size chip from the file identity cell so size is shown once - update the anvil e2e column constants and the file identity and file size unit tests Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
frano-m
force-pushed
the
frano-m/4986-file-size-column
branch
from
October 12, 2026 22:16
63381f8 to
ec20d4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4986
What changed
site-config/anvil-cmg/dev/index/filesEntityConfig.tshas a sortable Size column again, placed straight after the pinned File identity column and before DRS URI. It sorts server-side onfiles.file_size.FILE_FILE_SIZEcategory key (files.file_size) and itsSizelabel (site-config/anvil-cmg/category.ts), and thebuildFileSizeview builder (app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx).buildFileIdentitynow renders only the Format and Data Modality chips, so size isn't shown twice.e2e/anvil/constants.ts) now include a Size column.__tests__/viewModelBuilders/file-identity.test.tsxno longer expects a size chip, and it addsbuildFileSizecases:2 kB,0 B, andUnspecifiedfor a missing size.Why
#4983 moved file size into a chip in the files identity cell and removed the Size column, so the files table could no longer be sorted by size. We sort by size to find the largest and smallest files, for example when testing downloads. @NoopDog asked for this in the #4983 review, but the PR merged without it.
Assumptions I made
files.file_size), header (Size),BasicCellcomponent and width ({ max: "auto", min: "120px" }). It's visible by default, and the default sort stays on File name.sort=files.file_size(largest first: ~100 GB, ~98 GB, ~81 GB).Unspecifiedin the column, usinggetFileSize's behaviour since feat: reorganize anvil files index columns with consolidated identity column (#4966) #4983.{ max: "1.5fr", min: "340px" }, unchanged even though the cell now has one chip fewer.humanFileSizemis-formats files of 1 PiB or more, and negative or fractional sizes.files.file_sizeis in megabytes, but it's bytes.How to verify
npm run dev:anvil-cmg(or open this branch's AnVIL dev deployment) and go to the Files tab.npx jest __tests__/viewModelBuilders/file-identity.test.tsx. All tests pass.npm run test:anvil-cmg -- --project chromium. The Files tab sort and column tests pass with the Size column.Definition of done from #4986:
buildFileSizeand theFILE_FILE_SIZEcategory key and label are restored → steps 3 and 5buildFileIdentity; Format and Data Modality stay as chips → steps 4 and 5buildFileIdentityunit tests are updated → steps 5 and 6🤖 Generated with Claude Code
🐦 Built with cc-claude-tools