Skip to content

feat: restore a sortable size column on the anvil files index (#4986) - #4989

Merged
frano-m merged 1 commit into
mainfrom
frano-m/4986-file-size-column
Oct 12, 2026
Merged

frano-m merged 1 commit into
mainfrom
frano-m/4986-file-size-column

Conversation

@frano-m

@frano-m frano-m commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Closes #4986

What changed

  • Size column restored. site-config/anvil-cmg/dev/index/filesEntityConfig.ts has a sortable Size column again, placed straight after the pinned File identity column and before DRS URI. It sorts server-side on files.file_size.
  • Pieces feat: reorganize anvil files index columns with consolidated identity column (#4966) #4983 removed, now back. The FILE_FILE_SIZE category key (files.file_size) and its Size label (site-config/anvil-cmg/category.ts), and the buildFileSize view builder (app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx).
  • Size chip removed. buildFileIdentity now renders only the Format and Data Modality chips, so size isn't shown twice.
  • Tests. The AnVIL e2e constants (e2e/anvil/constants.ts) now include a Size column. __tests__/viewModelBuilders/file-identity.test.tsx no longer expects a size chip, and it adds buildFileSize cases: 2 kB, 0 B, and Unspecified for 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

How to verify

  1. Run npm run dev:anvil-cmg (or open this branch's AnVIL dev deployment) and go to the Files tab.
  2. Check the Size column appears right after the File column, before DRS URI.
  3. Click the Size header. Files sort by size, and clicking again reverses the order (largest first shows files of ~100 GB).
  4. Check the File identity cells show only Format and Data Modality chips, with no size chip.
  5. Run npx jest __tests__/viewModelBuilders/file-identity.test.tsx. All tests pass.
  6. Optional: run npm run test:anvil-cmg -- --project chromium. The Files tab sort and column tests pass with the Size column.

Definition of done from #4986:

  • Size is its own sortable column, placed first after the File identity column → steps 2 and 3
  • buildFileSize and the FILE_FILE_SIZE category key and label are restored → steps 3 and 5
  • The size chip is removed from buildFileIdentity; Format and Data Modality stay as chips → steps 4 and 5
  • The AnVIL e2e column constants and the buildFileIdentity unit tests are updated → steps 5 and 6

🤖 Generated with Claude Code
🐦 Built with cc-claude-tools

@frano-m
frano-m requested a balanced review from Copilot October 12, 2026 06:36
@frano-m
frano-m marked this pull request as ready for review October 12, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 buildFileSize and 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.

- 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
frano-m force-pushed the frano-m/4986-file-size-column branch from 63381f8 to ec20d4e Compare October 12, 2026 22:16
@frano-m
frano-m merged commit 8a18356 into main Oct 12, 2026
4 checks passed
@frano-m
frano-m deleted the frano-m/4986-file-size-column branch October 12, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: restore a sortable size column on the anvil files index

3 participants