Skip to content

Conversation

frano-m
Copy link
Contributor

@frano-m frano-m commented Oct 6, 2025

Closes #4495.

This pull request enhances how summary data is displayed by introducing support for showing total file size and improving the formatting of summary counts. The main changes include adding a new summary type for total file size, updating how summary counts are formatted for display, and ensuring these changes are reflected in both shared and site-specific configuration files.

Summary display improvements:

  • Added a new summary type TOTAL_FILE_SIZE to the SUMMARY enum and included it in summary key and label mappings, allowing the UI to display total file size information. [1] [2] [3]
  • Updated the BIND_SUMMARY_RESPONSE mapping in constants.ts to use formatCountSize for all count values and formatFileSize specifically for total file size, ensuring consistent and user-friendly formatting of summary data.
  • Modified the summary display order in the site-specific config (site-config/anvil-cmg/dev/index/common/constants.ts) to include the new total file size summary.

Codebase consistency and cleanup:

  • Removed redundant formatting from the mapSummary function, since formatting is now handled by the binder functions in BIND_SUMMARY_RESPONSE. [1] [2]
  • Imported the necessary formatting utilities (formatCountSize, formatFileSize) in constants.ts to support the new summary formatting logic.
image

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds total file size information to the summary statistics display in the anvil explorer, enhancing how data summaries are presented to users. The changes introduce a new summary type for displaying total file size and improve the formatting consistency across all summary statistics.

  • Added a new TOTAL_FILE_SIZE summary type to the existing summary enumeration and related mappings
  • Updated the summary response binding to format all counts consistently using appropriate formatters
  • Modified the site-specific configuration to include the new total file size in the summary display order

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
site-config/anvil-cmg/dev/index/common/constants.ts Added TOTAL_FILE_SIZE to the destructured constants and summary display order
app/components/Index/common/indexTransformer.ts Removed redundant formatting logic since formatting is now handled in the binder functions
app/components/Index/common/entities.ts Added TOTAL_FILE_SIZE enum value to the SUMMARY enumeration
app/components/Index/common/constants.ts Added formatting imports, updated BIND_SUMMARY_RESPONSE with proper typing and formatting, and added mappings for the new summary type

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

): [string, string][] {
return summaries.map((summary) => {
const summaryBinderFn = BIND_SUMMARY_RESPONSE[summary];
const count = formatCountSize(summaryBinderFn(summaryResponse));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

formatCountSize removed and added to each summaryBinderFn so that formatFileSize able to used for totalFileSize formatting.

[key in SUMMARY]: (r: AzulSummaryResponse) => string;
} = {
[BIOSAMPLES]: (r: AzulSummaryResponse): string =>
formatCountSize(getSummaryCount(r, SUMMARY_KEY.BIOSAMPLES)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

formatCountSize added to each binder fn to allow totalFileSize to be formatted by formatFileSize. See https://github.com/DataBiosphere/data-browser/pull/4571/files#r2408973202.

@frano-m frano-m force-pushed the fran/4495-anvil-summary branch from 11c285a to 4b89157 Compare October 7, 2025 00:01
@NoopDog NoopDog merged commit cd8b42e into main Oct 7, 2025
3 checks passed
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.

Add a total file size summary to the summary statistics line for the AnVIL Data Explorer.

2 participants