Skip to content

Conversation

frano-m
Copy link
Contributor

@frano-m frano-m commented Jul 9, 2025

Ticket

Closes #4528.

Reviewers

@NoopDog.

This pull request introduces a series of updates to improve the functionality, readability, and maintainability of the codebase, particularly focusing on the data export workflow, entity configurations, and dependencies. The most significant changes include refactoring entity configurations for better UI support, updating test cases to enhance clarity and reliability, and upgrading dependencies for improved performance and compatibility.

Refactoring and UI Enhancements:

  • Refactored entity configurations across multiple files (activitiesEntityConfig.ts, biosamplesEntityConfig.ts, datasetsEntityConfig.ts, donorsEntityConfig.ts, filesEntityConfig.ts) to replace listView with ui configurations that include support for tabs, export buttons, and summary features. This change improves modularity and enables more consistent UI behavior. [1] [2] [3] [4] [5]
  • Enabled tabs for consortia, studies, and workspace entity configurations in the AnVIL catalog by adding ui: { enableTabs: true }. [1] [2] [3]

Test Case Improvements:

  • Replaced the testIndexExportSummary function with a more detailed and robust test implementation in anvil-index-export-button.spec.ts. The new test verifies that summary labels and counts match between the index and export pages, improving test reliability and clarity. [1] [2]
  • Added helper functions (urlOrPredicate, waitForTestId) to streamline test logic and provide better abstraction for common operations.

Dependency Updates:

  • Upgraded @databiosphere/findable-ui to version ^38.1.0 and added @tanstack/react-virtual as a new dependency to enhance virtualized rendering capabilities. [1] [2]
  • Updated the ESM packages list in next.config.mjs to include @tanstack/react-virtual.

Code Cleanup:

  • Removed unused imports and outdated code related to summaries and heroes in entity configurations, simplifying the codebase. [1] [2] [3] [4] [5] [6]
  • Replaced the getSummaries function with mapSummary in indexTransformer.ts to return key-value pairs instead of objects, improving data structure consistency.

Miscellaneous Updates:

  • Removed the explorerTitle from configuration files where it was no longer needed, aligning with the updated UI design. [1] [2]
  • Updated the summary configuration in anvil-cmg/dev/config.ts to use buildSummaries for mapping API responses, enhancing modularity.
image

Copilot

This comment was marked as outdated.

@frano-m frano-m requested a review from Copilot July 9, 2025 10:09
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 PR updates the UI dependency, refactors how summary data is mapped, and enhances entity configurations with new UI options and slot replacements.

  • Refactored summary logic by removing the old Summaries component and introducing mapSummary with updated view builders.
  • Upgraded @databiosphere/findable-ui to v38.x and added @tanstack/react-virtual to ESM packages.
  • Added ui flags (enableTabs, enableExportButton, enableSummary) and replaced hero/list components with slot-based APIs across multiple entity configs.

Reviewed Changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
site-config/**/index/summaryViewModelBuilder.ts Replaced getSummariesmapSummary, removed React/Summaries references, updated return type.
app/components/Index/common/indexTransformer.ts Renamed getSummariesmapSummary, changed return from object[] to [string, string][].
site-config/**/index/*EntityConfig.ts Added ui sections with enableTabs, enableExportButton, enableSummary, and slot props.
package.json Bumped @databiosphere/findable-ui to ^38.1.0, added @tanstack/react-virtual.
next.config.mjs Included @tanstack/react-virtual in ESM_PACKAGES.
Comments suppressed due to low confidence (1)

package.json:35

  • The PR title and description refer to upgrading to v38.0.0, but package.json uses ^38.1.0. Consider aligning the documented target version and the actual dependency spec to avoid confusion.
    "@databiosphere/findable-ui": "^38.1.0",


// Get each summary span's inner text.
const innerTexts = await summaryLocator
.locator(MUI_CLASSES.TYPOGRAPHY) // Retrieves the count and label and omits the dot separator.
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

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

[nitpick] Relying on the generic .MuiTypography-root selector can make tests brittle if other typography elements are added. Consider adding or using a dedicated data-testid on the summary items to target them more reliably.

Suggested change
.locator(MUI_CLASSES.TYPOGRAPHY) // Retrieves the count and label and omits the dot separator.
.getByTestId(TEST_IDS.SUMMARY_ITEM) // Retrieves the count and label and omits the dot separator.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving it as, for now.

Copy link
Collaborator

@NoopDog NoopDog left a comment

Choose a reason for hiding this comment

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

Nice work @frano-m ! 🚀 🚀 🚀 🚀 🚀 🚀 🚀

@NoopDog NoopDog merged commit 50c56dd into main Jul 9, 2025
4 of 5 checks passed
@frano-m frano-m deleted the fran/4528-findable-ui branch August 19, 2025 02:27
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.

[HCA DCP][AnVIL DX] Update findable-ui to latest v38.0.0

2 participants