Skip to content

Feature/vfb 240#225

Open
jrmartin wants to merge 9 commits intodevelopmentfrom
feature/VFB-240
Open

Feature/vfb 240#225
jrmartin wants to merge 9 commits intodevelopmentfrom
feature/VFB-240

Conversation

@jrmartin
Copy link
Copy Markdown
Collaborator

@jrmartin jrmartin commented Apr 27, 2026

Change the datasource for the NG widget to file serve here Index of /data/VFB/i/

@ddelpiano Not all IDs have neuroglancer data in the VFB server, I used this one to test it out https://vfb.dev.metacell.us/?i=VFB_00101567&id=VFB_001012vj

Major changes by theme:

Asynchronous Layer and State Construction:

  • Converted buildNeuroglassState and buildSingleInstanceLayer to async functions, enabling them to await the completion of URL building and layer configuration for each instance. [1] [2]
  • Updated the React NeuroglassViewer component to use useEffect instead of useMemo for setting the iframe source, allowing for async state updates as the viewer state is constructed.

Dynamic URL Construction and Fetching:

  • Refactored NEUROGLASS_DATASOURCE.buildUrl and buildNeuroglassLayerUrl to support async fetching and parsing of directory listings, especially for the neuroglancer-precomputed protocol, including HTML parsing to locate the correct subfolders.
  • Added logic to transform instance IDs into the correct path format for URL construction, and included console logging for debugging.

React Component Updates:

  • Changed the state management in NeuroglassViewer.jsx to use a new iframeSrc state variable that is updated asynchronously, removing the use of useMemo. [1] [2]
  • Removed the unused useMemo import from the React component.

@jrmartin jrmartin requested a review from Copilot April 27, 2026 18:22
@jrmartin jrmartin marked this pull request as ready for review April 27, 2026 18:22
Copy link
Copy Markdown

@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: f23c6ae373

ℹ️ 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".

Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Copy link
Copy Markdown
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

Updates the Virtual Fly Brain frontend’s Neuroglass integration to construct layer URLs against the new file-server datasource (/data/VFB/i/) and to support asynchronous state construction so URLs can be resolved before building the embedded viewer state.

Changes:

  • Made buildNeuroglassState / per-instance layer construction async and updated the viewer to build the iframe source in an effect.
  • Refactored datasource URL building to support fetch-and-parse of directory listings for neuroglancer-precomputed.
  • Added additional console logging for debugging during URL/layer construction.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Async URL + layer/state building; adds fetch-based directory parsing to locate Neuroglancer subfolders.
applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Switches from useMemo to useEffect to support async state building and iframe src updates.

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

Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Comment thread applications/virtual-fly-brain/frontend/src/components/NeuroglassViewer.jsx Outdated
Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
Comment thread applications/virtual-fly-brain/frontend/src/utils/neuroglassStateConfig.js Outdated
@jrmartin jrmartin requested a review from ddelpiano April 27, 2026 21:00
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