Skip to content

local prod fix#569

Merged
TheJeran merged 1 commit intomainfrom
la/local_prod
Mar 2, 2026
Merged

local prod fix#569
TheJeran merged 1 commit intomainfrom
la/local_prod

Conversation

@lazarusA
Copy link
Member

@lazarusA lazarusA commented Mar 2, 2026

You can inspect production by doing

  • npm run build
  • npx serve@latest out

without fetchNC:true attributes for netcdf are void. Using it gives
Screenshot 2026-03-02 at 11 42 25

even though is still looking for the Attributes in the zarr path

Screenshot 2026-03-02 at 11 41 23

the logic for fetchNC:true, useNC: true maybe 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.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • Production Asset Prefix: Adjusted the assetPrefix configuration in next.config.ts for production builds, ensuring that when basePath is empty, the prefix is an empty string instead of './'. This change likely resolves issues with asset loading in specific local production environments.
  • NetCDF Attribute Fetching: Enabled fetchNC:true when setting the useZarrStore state in LocalNetCDF.tsx. This is critical for correctly fetching and utilizing NetCDF attributes, which were previously void without this flag, as indicated by the PR description.

🧠 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
  • next.config.ts
    • Modified the assetPrefix assignment logic to use an empty string instead of './' when isProd is true and basePath is empty.
  • src/components/ui/MainPanel/LocalNetCDF.tsx
    • Added fetchNC:true to the useZarrStore.setState call when initializing NetCDF data.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 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})

Choose a reason for hiding this comment

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

medium

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.

@lazarusA
Copy link
Member Author

lazarusA commented Mar 2, 2026

Screenshot 2026-03-02 at 12 21 22

in addition to #568 , latest is also broken when actually fetching the data.

@TheJeran TheJeran merged commit 55a3a06 into main Mar 2, 2026
6 checks passed
@TheJeran
Copy link
Collaborator

TheJeran commented Mar 2, 2026

I think I split useNC and fetchNC because there was some interference with looking at variables in other datasets vs actually fetching them. Like if you have a NC plot open and then look at a zarr dataset, the fetchNC becomes false. But if you still need to get info from the current netcdf the useNC is still true and doesn't break the logic.

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.

2 participants