Skip to content

#VFB-233 - Refactor Neuroglass state management and viewer configuration#218

Open
jrmartin wants to merge 13 commits intodevelopmentfrom
feature/VFB-233
Open

#VFB-233 - Refactor Neuroglass state management and viewer configuration#218
jrmartin wants to merge 13 commits intodevelopmentfrom
feature/VFB-233

Conversation

@jrmartin
Copy link
Collaborator

@jrmartin jrmartin commented Mar 13, 2026

Changes Neuroglassviewer component to match design described on VFB-232. The changes enable dynamic construction of Neuroglass viewer state based on loaded VFB instances selected from the Layers Component. The Neuroglassviewer will display in a layer each of the selected instances toggled from the Layers Component, as well as delete and show/hide instances as selected from Layers Component. Allows updating the VFB data server as a configuration instead of hardcoding location.

Variables added to the Codefresh for storing these configuration values:
Screenshot 2026-03-18 at 5 16 22 PM

…ion; add layout handling and datasource parameters for external server configuration
Copy link
Contributor

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

Refactors the Virtual Fly Brain frontend’s Neuroglass integration to dynamically generate Neuroglancer viewer state from loaded instances, support layout selection via Redux + ?layout=..., and make the Neuroglass datasource configurable at build/deploy time.

Changes:

  • Replaced static Neuroglass state mappings with a buildNeuroglassState builder + shared shader/datasource config.
  • Added neuroglassView to Redux, plus middleware to read/write the layout URL parameter.
  • Introduced Docker/CI build args intended to configure Neuroglass datasource protocol/base URL.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
deployment/codefresh-dev.yaml Passes Neuroglass datasource build args into the image build step.
applications/virtual-fly-brain/Dockerfile Adds build args and exports datasource config during the Vite build.
applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Implements dynamic viewer state builder, datasource URL builder, shader, and layout resolver.
applications/virtual-fly-brain/frontend/src/utils/neuroglassActions.js Removes legacy state lookup helpers tied to static mappings.
applications/virtual-fly-brain/frontend/src/utils/constants.js Defines known layouts, defaults, and URL parameter name.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js Syncs ?layout into Redux on first load and writes it back on state change.
applications/virtual-fly-brain/frontend/src/reducers/actions/types/GlobalTypes.js Adds SET_NEUROGLASS_VIEW action type.
applications/virtual-fly-brain/frontend/src/reducers/actions/globals.js Adds setNeuroglassView action creator.
applications/virtual-fly-brain/frontend/src/reducers/GlobalReducer.js Stores neuroglassView in global reducer state.
applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Switches viewer to builder-based state, responsive layout selection, and debounced iframe reload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jrmartin jrmartin marked this pull request as ready for review March 13, 2026 22:13
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6d19fcced

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jrmartin jrmartin requested a review from ddelpiano March 18, 2026 21:57
@jrmartin jrmartin requested a review from Copilot March 18, 2026 23:56
Copy link
Contributor

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

Refactors the Neuroglass viewer integration to dynamically build Neuroglancer viewer state from loaded VFB instances, add Redux/URL-driven layout selection, and make the Neuroglass datasource configurable via build/deploy-time variables.

Changes:

  • Replaced hardcoded Neuroglass state mappings with a dynamic buildNeuroglassState builder and shared datasource/shader config.
  • Added neuroglassView to global Redux state and synchronized it with the URL ?layout parameter via middleware.
  • Plumbed NEUROGLASS_DATA_PROTOCOL / NEUROGLASS_DATA_BASE_URL through build/deploy config and Vite defines.

Reviewed changes

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

Show a summary per file
File Description
deployment/codefresh-dev.yaml Passes Neuroglass datasource variables into the build pipeline.
applications/virtual-fly-brain/frontend/vite.config.js Injects Neuroglass datasource env into the frontend build (and logs build config).
applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Implements dynamic Neuroglass state generation and layout resolution.
applications/virtual-fly-brain/frontend/src/utils/neuroglassActions.js Removes legacy state lookup utilities tied to static state maps.
applications/virtual-fly-brain/frontend/src/utils/constants.js Adds known layouts and layout URL param/defaults.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js Reads/writes ?layout and syncs it with Redux state.
applications/virtual-fly-brain/frontend/src/reducers/actions/types/GlobalTypes.js Adds SET_NEUROGLASS_VIEW action type.
applications/virtual-fly-brain/frontend/src/reducers/actions/globals.js Adds setNeuroglassView action creator.
applications/virtual-fly-brain/frontend/src/reducers/GlobalReducer.js Stores neuroglassView in global state.
applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Rebuilds iframe state dynamically, supports layout switching, and debounces reloads.
applications/virtual-fly-brain/Dockerfile Exposes Neuroglass datasource build args and exports them for the Vite build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…vironment variables and improve error handling
@jrmartin jrmartin requested a review from Copilot March 19, 2026 00:18
Copy link
Contributor

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

Refactors the Neuroglass viewer integration to dynamically build Neuroglancer state from the currently loaded VFB instances and adds configurable Neuroglass datasource settings (protocol/base URL), plus URL/Redux syncing for viewer layout selection.

Changes:

  • Replaced static Neuroglass state presets with dynamic state generation (buildNeuroglassState) and layout resolution (resolveNeuroglassLayout).
  • Added Neuroglass datasource configuration via environment variables and propagated them through Vite build configuration and the Docker build.
  • Introduced globalInfo.neuroglassView in Redux and middleware syncing of ?layout= between URL and store.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
deployment/codefresh-dev.yaml Passes Neuroglass datasource env vars into Codefresh build context.
applications/virtual-fly-brain/frontend/vite.config.js Inlines Neuroglass config into the frontend bundle via define and logs build config.
applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Implements dynamic layer/state generation and configurable datasource URL building.
applications/virtual-fly-brain/frontend/src/utils/neuroglassActions.js Removes legacy helpers tied to static Neuroglass state maps.
applications/virtual-fly-brain/frontend/src/utils/constants.js Adds known Neuroglass layout constants and URL param key.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js Syncs layout URL param into Redux and updates URL when view changes.
applications/virtual-fly-brain/frontend/src/reducers/actions/types/GlobalTypes.js Adds a new global action type for Neuroglass view updates.
applications/virtual-fly-brain/frontend/src/reducers/actions/globals.js Adds setNeuroglassView(view) action creator.
applications/virtual-fly-brain/frontend/src/reducers/GlobalReducer.js Stores neuroglassView in global Redux state.
applications/virtual-fly-brain/frontend/src/components/queryBuilder/FullscreenSlider.jsx Removes a file-level eslint disable comment.
applications/virtual-fly-brain/frontend/src/components/configuration/VFBToolbar/vfbtoolbarHTML.jsx Removes a file-level eslint disable comment.
applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Refactors viewer to use dynamic state/layout and debounced iframe src updates.
applications/virtual-fly-brain/Dockerfile Wires Neuroglass datasource vars into the Vite build step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jrmartin jrmartin requested a review from Copilot March 19, 2026 00:47
Copy link
Contributor

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 refactors the Neuroglass viewer integration to dynamically generate Neuroglancer state from currently loaded VFB instances, and makes the Neuroglass datasource/viewer endpoints configurable via build-time environment variables. It also introduces Redux + URL synchronization for selecting the Neuroglass layout.

Changes:

  • Build Neuroglass viewer state dynamically from allLoadedInstances (layers, colors, visibility) and resolve layout based on URL/Redux + mobile/desktop.
  • Add NEUROGLASS_DATA_PROTOCOL, NEUROGLASS_DATA_BASE_URL, and NEUROGLASS_URL configuration plumbing through Codefresh, Docker build, and Vite define.
  • Add globalInfo.neuroglassView Redux state and middleware support to sync ?layout= between URL and Redux.

Reviewed changes

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

Show a summary per file
File Description
deployment/codefresh-dev.yaml Pass Neuroglass-related build args into the app image build step.
applications/virtual-fly-brain/frontend/vite.config.js Load + inject Neuroglass env vars into import.meta.env.* via Vite define.
applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Replace static state maps with datasource config, layout resolution, and dynamic state/layer builders.
applications/virtual-fly-brain/frontend/src/utils/neuroglassActions.js Remove legacy helpers tied to static Neuroglass state maps.
applications/virtual-fly-brain/frontend/src/utils/constants.js Add known Neuroglass layouts + URL param + defaults.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js Read/write ?layout= and sync it to/from Redux.
applications/virtual-fly-brain/frontend/src/reducers/actions/types/GlobalTypes.js Add SET_NEUROGLASS_VIEW action type.
applications/virtual-fly-brain/frontend/src/reducers/actions/globals.js Add setNeuroglassView(view) action creator.
applications/virtual-fly-brain/frontend/src/reducers/GlobalReducer.js Store neuroglassView in global reducer state.
applications/virtual-fly-brain/frontend/src/components/queryBuilder/FullscreenSlider.jsx Remove file-level eslint disable comment.
applications/virtual-fly-brain/frontend/src/components/configuration/VFBToolbar/vfbtoolbarHTML.jsx Remove file-level eslint disable comment.
applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Rebuild iframe URL from dynamic state, add debounced updates, and handle mobile/desktop layout selection.
applications/virtual-fly-brain/Dockerfile Export Neuroglass build-time env vars into the Vite build step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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