Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue encountered in local production environments where NetCDF attributes were not being correctly fetched and assets might have been misloaded. By modifying the Next.js asset prefix configuration and explicitly enabling NetCDF attribute fetching, the changes ensure proper data handling and asset resolution, improving the reliability of local production builds. Highlights
🧠 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
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue with loading local NetCDF files in a production build. The changes adjust the Next.js asset prefix configuration and correctly set the fetchNC state when a file is loaded, which resolves the problem of missing attributes. My review includes a suggestion to refactor the state management for NetCDF-related flags in your Zustand store to improve maintainability, based on your own observations in the PR description.
| ]) | ||
| useGlobalStore.setState({variables: Object.keys(variables), zMeta: metadata, initStore:`local_${file.name}`}) | ||
| useZarrStore.setState({useNC: true, ncModule: data}) | ||
| useZarrStore.setState({ fetchNC:true, useNC: true, ncModule: data}) |
There was a problem hiding this comment.
While setting fetchNC: true here fixes the issue, you've raised a good point in the PR description about unifying the logic for fetchNC and useNC. To improve maintainability and prevent inconsistent states, you could encapsulate this logic in a dedicated action within your ZarrStore.
For example, an action like setNetCDFModule(data) could handle setting ncModule, useNC, and fetchNC together:
// In ZarrStore.ts
setNetCDFModule: (data) => set({ ncModule: data, useNC: !!data, fetchNC: !!data })
// In LocalNetCDF.tsx
// Then you could call it like this, replacing the current setState call:
useZarrStore.getState().setNetCDFModule(data)This would centralize the state transition logic, making it more robust and easier to reason about. This would require changes in ZarrStore.ts.
in addition to #568 , |
|
I think I split |

You can inspect
productionby doingnpm run buildnpx serve@latest outwithout

fetchNC:trueattributes for netcdf are void. Using it giveseven though is still looking for the Attributes in the zarr path
the logic for
fetchNC:true, useNC: truemaybe could be unified? somehow? It seems like is not consistent in the sense of which one comes first or when should they be triggered, hence the logs.