Skip to content

do only groups#37

Merged
lazarusA merged 43 commits intomainfrom
la/groups_only
Feb 15, 2026
Merged

do only groups#37
lazarusA merged 43 commits intomainfrom
la/groups_only

Conversation

@lazarusA
Copy link
Member

No description provided.

@lazarusA
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a significant pull request that introduces major new features and refactors the demo application. The core change is the addition of support for NetCDF groups, which enables hierarchical data navigation. This is reflected throughout the codebase, from the C wrapper and build script to the TypeScript API and the frontend components.

The demo application has been substantially improved with a new DataTree abstraction, providing a much richer and more interactive user experience for exploring NetCDF files, including group browsing, variable search, and detailed inspection panels. The UI has been modernized with new components and a cleaner layout.

Overall, this is a fantastic enhancement. I've identified a few issues, including a critical bug in the WASM wrapper's memory handling that needs to be addressed, along with some opportunities to improve robustness and adhere to React best practices.

@lazarusA
Copy link
Member Author

/gemini summary

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request introduces a major refactor of the NetCDF4 data exploration interface, transitioning from a flat metadata display to a hierarchical, interactive view that leverages newly exposed group functionalities in the underlying WebAssembly module. It also expands the supported data types for data retrieval and refines the build process for better filter support and documentation synchronization.

Highlights

  • Refactored NetCDF4 Data Exploration UI: The LocalNetCDFMeta component has been significantly overhauled to provide a more interactive and hierarchical view of NetCDF4 file contents. This includes group browsing, variable selection, search functionality, and collapsible displays for variable info, attributes, and dimensions.
  • Enhanced NetCDF4 WASM Module with Group Support: The underlying netcdf4-wasm library has been updated to expose NetCDF4 group functions, allowing for hierarchical navigation within NetCDF files. This includes new C wrappers and corresponding TypeScript API methods for inquiring about groups, their names, paths, and parent NCIDs.
  • Improved Data Type Handling and Slicing: The WASM module and its TypeScript wrappers now support a wider range of NetCDF data types, including unsigned integers (u8, u16, u32, u64) and strings, for both attribute and variable data retrieval. Sliced variable array retrieval has also been enhanced to handle these new types.
  • UI/UX Improvements: The main application page (docs/next-js/app/page.tsx) has been updated with a new TopNav component, a persistent footer, and a more streamlined layout. The BrowzarrCTA component now uses tooltips for a cleaner look, and the GitHubButton has improved styling.
  • Build Process Enhancements: The build-wasm.sh script has been modified to enable comprehensive filter support for HDF5 and NetCDF4, including ZLIB and SZIP, and to create a plugin directory. New npm scripts (clean:docs, copy:docs-dist, copy:docs-wasm, sync-docs, build-and-sync) have been added to streamline the documentation build process.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/next-js/app/page.tsx
    • Replaced GithubButton with TopNav component.
    • Adjusted main layout for a fixed top navigation and added a persistent footer.
    • Updated styling for main content area.
  • docs/next-js/components/loading/BrowzarrCTA.tsx
    • Refactored to use Tooltip component for message display.
    • Removed className prop from interface.
    • Updated button styling.
  • docs/next-js/components/loading/GitHubButton.tsx
    • Modified button styling for hover and focus states.
  • docs/next-js/components/loading/LocalNetCDFMeta.tsx
    • Implemented hierarchical data display using DataTree.
    • Added group browsing, variable selection, and search functionality.
    • Introduced collapsible sections for variable info, attributes, and dimensions.
    • Updated state management for various UI elements and data loading.
    • Restored and enhanced URL validation logic.
    • Removed MetaNetCDFButtons component usage.
    • Added useEffect and useCallback hooks for managing state and side effects.
    • Introduced formatDataPreview utility.
    • Added new UI components: Card, Badge, Tooltip.
    • Integrated Lucide-React icons for better visual cues.
  • docs/next-js/components/loading/MetaNetCDFButtons.tsx
    • Adjusted ObjectViewer width and styling for text wrapping.
    • Widened DialogContent for better display of metadata.
  • docs/next-js/components/loading/TopNav.tsx
    • Added new component for fixed top navigation, including BrowzarrCTA and GithubButton.
  • docs/next-js/components/ui/badge.tsx
    • Added new UI component for badges.
  • docs/next-js/components/ui/card.tsx
    • Added new UI component for cards.
  • docs/next-js/components/ui/dropdown-menu.tsx
    • Added new UI component for dropdown menus.
  • docs/next-js/package.json
    • Added radix-ui dependency.
  • package.json
    • Updated clean script to use rimraf.
    • Added cross-env for test scripts.
    • Added cpx2, cross-env, rimraf dependencies.
    • Added new npm scripts: clean:docs, copy:docs-dist, copy:docs-wasm, sync-docs, build-and-sync for documentation synchronization.
  • scripts/build-wasm.sh
    • Removed "✅" and "⚠️" from log messages.
    • Added mkdir -p "$INSTALL_DIR/lib/netcdf/plugins" for filter plugins.
    • Enabled HDF5 High-Level library, ZLIB, SZIP, and NCZarr filter support during HDF5 and NetCDF4 builds.
    • Added detailed logging about filter support configuration.
    • Removed nc_inq_var_deflate_wrapper and nc_def_var_deflate_wrapper from C wrapper.
    • Added C wrappers for NetCDF group inquiry functions.
    • Added C wrappers for variable-length string attributes.
    • Added C wrappers for unsigned integer attributes.
    • Added C wrappers for variable-length string variables.
    • Added C wrappers for full variable string data.
    • Added HEAPU64 to EXPORTED_RUNTIME_METHODS.
  • src/constants.ts
    • Added NC_ERANGE error code.
    • Added new NetCDF data types: NC_UINT, NC_UINT64, NC_INT64, NC_UBYTE, NC_USHORT, NC_STRING.
    • Updated DATA_TYPE_MAP and CONSTANT_DTYPE_MAP to include new types.
    • Updated DATA_TYPE_SIZE for new types.
  • src/group.ts
    • Modified Group constructor to accept an optional parent group.
    • Updated createGroup to pass this as the parent.
    • Refactored path getter to correctly build hierarchical paths.
    • Added load method to recursively load dimensions, variables, subgroups, and attributes.
  • src/index.ts
    • Exported the new DataTree class and GroupNode type.
  • src/netcdf-getters.ts
    • Renamed getVariables to getGroupVariables and updated its logic to handle group paths and coordinate variables.
    • Modified getDims to accept groupPath.
    • Updated getDimIDs to optionally include parent dimensions.
    • Introduced findCoordinateVariable to search for coordinate variables in the hierarchy.
    • Enhanced getAttributeValues to use a dispatch table for various attribute types, including unsigned integers and strings.
    • Modified getGlobalAttributes to accept groupPath.
    • Modified getFullMetadata to accept groupPath.
    • Updated getVariableInfo to accept groupPath and correctly populate dimensions array.
    • Refactored getVariableArray and getSlicedVariableArray to use dispatch tables for various data types and accept groupPath.
    • Added new group-related functions: getGroupNCID, getGroups, getGroupsRecursive, getGroupName, getGroupPath, getGroupPathLength, getGroupParent, findDimInHierarchy, getCompleteHierarchy, and getVariables (recursive).
  • src/netcdf-worker.ts
    • Updated locateFile logic to remove console logs.
    • Changed mod.FS.mkdir(mountPoint) to mod.FS.mkdirTree(mountPoint).
    • Updated worker message handling to include groupPath for various getter functions.
    • Added new worker message types for group-related functions.
  • src/netcdf4.ts
    • Modified NetCDF4 constructor to call this.load() if not in test mode.
    • Updated various getter methods to accept optional groupPath or ncid parameters and pass them to worker/module calls.
    • Added new methods for group management: getGroups, getGroupsRecursive, getGroupNCID, getGroupName, getGroupPath, getCompleteHierarchy, and getVariables (recursive).
    • Introduced DataTree class for hierarchical navigation, including methods for building the tree, navigating groups, listing variables, and summarizing dataset statistics.
  • src/types.ts
    • Updated EmscriptenModule interface to include HEAP8, HEAP16, HEAPU16, HEAPU32, HEAPU64.
    • Extended NetCDF4Module interface with new attribute getter types.
    • Extended NetCDF4Module interface with new variable getter types.
    • Extended NetCDF4Module interface with new sliced variable getter types.
    • Added new group-related function types to NetCDF4Module interface.
  • src/wasm-module.ts
    • Updated nc_inq_var_wrapper to include nattsp.
    • Added new C wrappers for attribute getters.
    • Added new C wrappers for sliced variable getters.
    • Added new C wrappers for full variable getters.
    • Added new C wrappers for group inquiry functions.
    • Adjusted memory allocation for nc_get_vara_short and nc_get_vara_int to use correct type sizes.
    • Updated nc_get_var_text to use TextDecoder for string conversion.
    • Implemented logic for new attribute and variable getters to handle different data types and string arrays.
    • Implemented logic for new group inquiry functions.
Activity
  • lazarusA requested a Gemini review.
  • Gemini Code Assist provided a high-priority comment regarding a useEffect dependency issue, recommending useCallback for component-scoped functions.
  • Gemini Code Assist provided a medium-priority comment about weakened URL validation in LocalNetCDFMeta.tsx and a usability regression regarding the 'Enter' key.
  • Gemini Code Assist provided a medium-priority comment about the use of -s ERROR_ON_UNDEFINED_SYMBOLS=0 in the build script, suggesting a more targeted approach for handling undefined symbols.
  • lazarusA requested a Gemini summary.

@lazarusA lazarusA merged commit cd6a747 into main Feb 15, 2026
1 check passed
@gemini-code-assist gemini-code-assist bot mentioned this pull request Feb 15, 2026
@lazarusA lazarusA mentioned this pull request Feb 15, 2026
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.

1 participant