#VFB-228 - Fix loading scene from URL (load instances correctly with id on focus) and fix Slice Viewer Behavior.#210
#VFB-228 - Fix loading scene from URL (load instances correctly with id on focus) and fix Slice Viewer Behavior.#210jrmartin wants to merge 13 commits intodevelopmentfrom
Conversation
… in ThreeDCanvas component
…lice viewer not loading instances when query params passed on URL. Centers canvas
There was a problem hiding this comment.
Pull request overview
This pull request enhances the Virtual Fly Brain application's handling of bulk instance loading from URL parameters and improves the user experience during initial loading. The changes introduce state management to prevent premature URL updates during loading, add UI feedback mechanisms, ensure proper instance ordering for correct selection behavior, and implement auto-zoom functionality when loading completes.
Changes:
- Added
isLoadingFromUrlstate flag to track URL-based loading and prevent URL updates during initial load - Implemented debouncing and progress tracking for instance rendering with loading indicators
- Added auto-zoom functionality that triggers when all URL-based instances finish loading
- Fixed instance sorting to ensure templates are processed first for correct click selection behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| urlUpdaterMiddleware.js | Adds URL loading state management, prioritizes id parameter for focus, blocks URL updates during initial load, and clears loading state with delay after bulk load completion |
| getInstancesTypes.js | Defines new action type CLEAR_URL_LOADING_STATE for clearing the URL loading flag |
| instances.js | Extends setBulkLoadingCount to accept isFromUrl parameter and adds clearUrlLoadingState action creator |
| InstancesReducer.js | Adds isLoadingFromUrl state field, handles new action types, and sets bulkLoadComplete flag in ADD_INSTANCE events |
| ThreeDCanvas.jsx | Implements auto-zoom logic that reads pending focus from URL, applies focus/select, and zooms to visible instances when bulk loading completes |
| StackViewerComponent.jsx | Adds instance update debouncing, loading indicator text, instance sorting to prioritize templates, improves buffer text condition check, and adds timeout cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/ThreeDCanvas.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
…erComponent; remove unused isBulkLoading state in urlUpdaterMiddleware
…mponent; update camera reset logic in ThreeDCanvas; enhance URL handling in urlUpdaterMiddleware
…vided in isFirstTimeLoad function
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
…ponent; improve camera reset logic in ThreeDCanvas; update URL handling in urlUpdaterMiddleware
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/ThreeDCanvas.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
…ic in ThreeDCanvas; update URL loading state management in urlUpdaterMiddleware; improve status text handling in StackViewerComponent
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/reducers/middleware/urlUpdaterMiddleware.js
Outdated
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
applications/virtual-fly-brain/frontend/src/components/StackViewerComponent.jsx
Show resolved
Hide resolved
…nent; remove redundant URL loading state management in urlUpdaterMiddleware
…mponent; streamline instance handling
…ate overwriting during initial load
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b822be8aaa
ℹ️ 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".
Test:
Url to Test on Dev
Fix:
Copilot Summary:
This pull request implements significant improvements to the bulk loading of instances from URLs and enhances the user experience during initial loading in the Virtual Fly Brain application. The changes ensure that the application correctly manages state and UI feedback when instances are loaded from URL parameters, prevents premature URL updates during loading, and improves the handling and ordering of instances for rendering and selection.
Key changes include:
Bulk Loading from URL & State Management:
isLoadingFromUrlstate in theInstancesReducerto track when instances are being loaded from URL parameters, and added actions and reducers to set and clear this state. This prevents the application from updating the URL while the initial load is in progress, ensuring a smoother user experience. [1] [2] [3] [4] [5] [6] [7]urlUpdaterMiddlewareto use the newisLoadingFromUrlflag, blocking URL updates during the initial load and clearing the flag after a short delay once loading is complete. [1] [2] [3]Instance Loading & UI Feedback:
StackViewerComponent, including a loading indicator and prevention of parallel rendering issues. This improves responsiveness and gives users clear feedback during loading. [1] [2] [3] [4] [5]3D Canvas Auto-Zoom Enhancement:
ThreeDCanvaswhen all instances from the URL have finished loading, focusing and selecting the relevant instance and zooming to all visible instances, or resetting the camera if none are visible.Miscellaneous Improvements:
idparameter for focus and selection, ensuring correct behavior when multiple IDs are present in the URL.These changes collectively make the application more robust when handling deep links and improve the initial user experience by managing loading states and UI feedback more effectively.