Feature/vfb 240#225
Conversation
…dling and folder extraction from http request
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.
b8806c1 to
f23c6ae
Compare
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:
buildNeuroglassStateandbuildSingleInstanceLayerto async functions, enabling them to await the completion of URL building and layer configuration for each instance. [1] [2]NeuroglassViewercomponent to useuseEffectinstead ofuseMemofor setting the iframe source, allowing for async state updates as the viewer state is constructed.Dynamic URL Construction and Fetching:
NEUROGLASS_DATASOURCE.buildUrlandbuildNeuroglassLayerUrlto support async fetching and parsing of directory listings, especially for theneuroglancer-precomputedprotocol, including HTML parsing to locate the correct subfolders.React Component Updates:
NeuroglassViewer.jsxto use a newiframeSrcstate variable that is updated asynchronously, removing the use ofuseMemo. [1] [2]useMemoimport from the React component.