-
Notifications
You must be signed in to change notification settings - Fork 29
Use mags instead of resolutions in datasource #8958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughRename and reshape magnification fields across the frontend: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/javascripts/viewer/view/action-bar/download_modal_view.tsx (1)
310-327
: Use fallback layer mags when exporting fallback data.For traced volumes we export the fallback layer (
selectedLayerInfos.layerName
), but the magnification info is now taken fromselectedLayer.mags
. Before the refactor this was acceptable because both tracing and fallback sharedresolutions
. After the rename, only the fallback layer is guaranteed to expose the correctmags
. If a tracing layer no longer carries identicalmags
,getMagInfo(selectedLayer.mags)
will either see an empty array or the wrong values, leading to wrong defaults in the slider and possibly invalid requests. Please derivemagnificationInfo
from the fallback (selectedLayer.fallbackLayerInfo?.mags ?? selectedLayer.mags
) so export continues to use the mags of the actual layer we pass to the backend.To address it, guard the lookup like this:
- const selectedLayerMagInfo = getMagInfo(selectedLayer.mags); + const sourceMags = selectedLayer.fallbackLayerInfo?.mags ?? selectedLayer.mags; + const selectedLayerMagInfo = getMagInfo(sourceMags);
🧹 Nitpick comments (5)
frontend/javascripts/viewer/model/bucket_data_handling/wkstore_adapter.ts (1)
202-202
: Confirm mags availability here; add guard or temporary fallback.Switching to
layerInfo.mags
is consistent with the PR. Please verify this adapter never receives layers withoutmags
(including old cached state/annotations). If not guaranteed, add a fast‑fail or a temporary back‑compat fallback.Option A (fail fast):
- const magInfo = getMagInfo(layerInfo.mags); + if (!layerInfo.mags || layerInfo.mags.length === 0) { + throw new Error(`Missing mags for layer "${layerInfo.name}"`); + } + const magInfo = getMagInfo(layerInfo.mags);Option B (back‑compat until full migration):
- const magInfo = getMagInfo(layerInfo.mags); + const mags = layerInfo.mags ?? (layerInfo as any).resolutions; + if (!mags || mags.length === 0) { + throw new Error(`Missing mags for layer "${layerInfo.name}"`); + } + const magInfo = getMagInfo(mags);Note: Some places intentionally keep
resolutions
(e.g., specific sagas). Ensure this change doesn’t affect those code paths. Based on learningsfrontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx (1)
258-262
: Avoid recomputing MagInfo twice; hoist to a constMinor perf/readability improvement; keeps memoization effective.
- const adhocMagIndex = getMagInfo(layer.mags).getClosestExistingIndex( - preferredQualityForMeshAdHocComputation, - ); - const adhocMag = getMagInfo(layer.mags).getMagByIndexOrThrow(adhocMagIndex); + const magInfo = getMagInfo(layer.mags); + const adhocMagIndex = magInfo.getClosestExistingIndex( + preferredQualityForMeshAdHocComputation, + ); + const adhocMag = magInfo.getMagByIndexOrThrow(adhocMagIndex);frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (1)
1126-1131
: Fallback mags source change — verify availabilityUsing fallbackLayerInfo.mags is semantically correct with the new API. Please verify that fallbackLayerInfo is always populated with mags for legacy datasets; otherwise guard against undefined.
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx (1)
50-56
: Select best mag across all dims (not only X) for closer matchCurrently, selection compares only diff[0]. Consider using the max (or sum) across dimensions to choose the closest match more robustly.
Apply this tweak:
- let bestDifference = [ - Number.POSITIVE_INFINITY, - Number.POSITIVE_INFINITY, - Number.POSITIVE_INFINITY, - ]; + let bestDifference: number[] = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]; for (const mag of colorLayer.mags) { const diff = datasetScaleInNm.map((dim, i) => Math.abs(Math.log(dim * mag[i]) - Math.log(modelScale[i])), ); - if (bestDifference[0] > diff[0]) { + if (Math.max(...bestDifference) > Math.max(...diff)) { bestDifference = diff; closestMagOfCurrentDS = mag; } }Also applies to: 59-67
frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts (1)
151-152
: Validate getMagInfo & getDataForBoundingBox zoomStep semanticsSwitching to
mags
here looks correct, but verify:
getMagInfo
takes an array of mags (Vector3[]
)—some code still usesresolutions
.- The zoomStep returned by
MagInfo
(from the intersection) matches the_zoomStep
parameter ofapi.data.getDataForBoundingBox
.Run:
rg -nP -C3 'function _getMagInfo\b' --type=ts rg -nP -C3 'export const getMagInfo\b' --type=ts rg -nP -C3 'getDataForBoundingBox' --type=tsOptional: replace
_.intersectionBy(colorLayer.mags, volumeLayer.mags, mag => mag.join("-"))with
_.intersectionWith(colorLayer.mags, volumeLayer.mags, _.isEqual)to avoid string allocations.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (36)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
(1 hunks)frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx
(2 hunks)frontend/javascripts/test/fixtures/dataset_server_object.ts
(2 hunks)frontend/javascripts/test/fixtures/hybridtracing_object.ts
(1 hunks)frontend/javascripts/test/fixtures/volumetracing_object.ts
(1 hunks)frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
(2 hunks)frontend/javascripts/test/model/binary/cube.spec.ts
(3 hunks)frontend/javascripts/test/model/binary/pullqueue.spec.ts
(1 hunks)frontend/javascripts/test/model/model_resolutions.spec.ts
(6 hunks)frontend/javascripts/test/model/volumetracing/volume_annotation_sampling.spec.ts
(2 hunks)frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts
(2 hunks)frontend/javascripts/types/api_types.ts
(1 hunks)frontend/javascripts/viewer/api/api_latest.ts
(5 hunks)frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
(1 hunks)frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
(4 hunks)frontend/javascripts/viewer/model/accessors/flycam_accessor.ts
(3 hunks)frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts
(2 hunks)frontend/javascripts/viewer/model/bucket_data_handling/layer_rendering_manager.ts
(2 hunks)frontend/javascripts/viewer/model/bucket_data_handling/wkstore_adapter.ts
(1 hunks)frontend/javascripts/viewer/model/data_layer.ts
(1 hunks)frontend/javascripts/viewer/model/sagas/dataset_saga.ts
(1 hunks)frontend/javascripts/viewer/model/sagas/flycam_info_cache_saga.ts
(1 hunks)frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts
(1 hunks)frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts
(1 hunks)frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts
(1 hunks)frontend/javascripts/viewer/model_initialization.ts
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/forms/train_ai_model_form.tsx
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/tabs/train_ai_model_tab.tsx
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
(2 hunks)frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
(2 hunks)frontend/javascripts/viewer/view/action-bar/download_modal_view.tsx
(1 hunks)frontend/javascripts/viewer/view/context_menu.tsx
(1 hunks)frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
(2 hunks)frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx
(1 hunks)frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx
(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/proofread_saga.ts:1039-1039
Timestamp: 2024-11-22T17:18:04.217Z
Learning: In `frontend/javascripts/oxalis/model/sagas/proofread_saga.ts`, when calling `getMagInfo`, the use of `volumeTracingLayer.resolutions` is intentional and should not be changed to `volumeTracingLayer.mags`.
Learnt from: knollengewaechs
PR: scalableminds/webknossos#8266
File: frontend/javascripts/components/mag_selection.tsx:51-60
Timestamp: 2024-12-16T15:48:37.065Z
Learning: In the `MagSelection` component (`frontend/javascripts/components/mag_selection.tsx`), the selected magnification `value` will always be present in `allMags` because only existing values can be selected by the user.
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/volumetracing_saga.tsx:433-434
Timestamp: 2024-11-22T17:19:07.947Z
Learning: In the codebase, certain usages of `segmentationLayer.resolutions` are intentionally retained and should not be changed to `segmentationLayer.mags` during refactoring.
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/reducers/skeletontracing_reducer_helpers.ts:125-125
Timestamp: 2024-11-22T17:17:39.914Z
Learning: In the `createNode` function within `skeletontracing_reducer_helpers.ts`, the property `resolution` is intentionally kept even when the parameter is renamed to `mag`.
📚 Learning: 2024-11-22T17:18:04.217Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/proofread_saga.ts:1039-1039
Timestamp: 2024-11-22T17:18:04.217Z
Learning: In `frontend/javascripts/oxalis/model/sagas/proofread_saga.ts`, when calling `getMagInfo`, the use of `volumeTracingLayer.resolutions` is intentional and should not be changed to `volumeTracingLayer.mags`.
Applied to files:
frontend/javascripts/test/fixtures/volumetracing_object.ts
frontend/javascripts/types/api_types.ts
frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts
frontend/javascripts/test/model/model_resolutions.spec.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
frontend/javascripts/viewer/model/bucket_data_handling/wkstore_adapter.ts
frontend/javascripts/viewer/model/sagas/flycam_info_cache_saga.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx
frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts
frontend/javascripts/test/model/binary/cube.spec.ts
frontend/javascripts/viewer/view/action-bar/download_modal_view.tsx
frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts
frontend/javascripts/viewer/model/sagas/dataset_saga.ts
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
frontend/javascripts/test/fixtures/hybridtracing_object.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/tabs/train_ai_model_tab.tsx
frontend/javascripts/viewer/api/api_latest.ts
frontend/javascripts/viewer/view/context_menu.tsx
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx
frontend/javascripts/viewer/model/accessors/flycam_accessor.ts
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts
frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/forms/train_ai_model_form.tsx
frontend/javascripts/test/fixtures/dataset_server_object.ts
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
frontend/javascripts/viewer/model/data_layer.ts
frontend/javascripts/viewer/model_initialization.ts
frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts
frontend/javascripts/test/model/binary/pullqueue.spec.ts
frontend/javascripts/test/model/volumetracing/volume_annotation_sampling.spec.ts
frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx
frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx
frontend/javascripts/viewer/model/bucket_data_handling/layer_rendering_manager.ts
📚 Learning: 2024-11-22T17:18:43.411Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/geometries/materials/plane_material_factory.ts:568-585
Timestamp: 2024-11-22T17:18:43.411Z
Learning: In the file `frontend/javascripts/oxalis/geometries/materials/plane_material_factory.ts`, the uniform name `allResolutions` should remain unchanged to maintain consistency with the shader code.
Applied to files:
frontend/javascripts/test/fixtures/volumetracing_object.ts
frontend/javascripts/types/api_types.ts
frontend/javascripts/test/model/model_resolutions.spec.ts
frontend/javascripts/test/fixtures/hybridtracing_object.ts
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
frontend/javascripts/test/fixtures/dataset_server_object.ts
📚 Learning: 2024-11-22T17:17:39.914Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/reducers/skeletontracing_reducer_helpers.ts:125-125
Timestamp: 2024-11-22T17:17:39.914Z
Learning: In the `createNode` function within `skeletontracing_reducer_helpers.ts`, the property `resolution` is intentionally kept even when the parameter is renamed to `mag`.
Applied to files:
frontend/javascripts/test/fixtures/volumetracing_object.ts
frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
frontend/javascripts/viewer/model/sagas/flycam_info_cache_saga.ts
frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts
frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts
frontend/javascripts/viewer/model/sagas/dataset_saga.ts
frontend/javascripts/test/fixtures/hybridtracing_object.ts
frontend/javascripts/viewer/view/context_menu.tsx
frontend/javascripts/viewer/model/accessors/flycam_accessor.ts
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts
frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
frontend/javascripts/test/fixtures/dataset_server_object.ts
frontend/javascripts/viewer/model_initialization.ts
frontend/javascripts/test/model/volumetracing/volume_annotation_sampling.spec.ts
📚 Learning: 2024-11-22T17:19:07.947Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/volumetracing_saga.tsx:433-434
Timestamp: 2024-11-22T17:19:07.947Z
Learning: In the codebase, certain usages of `segmentationLayer.resolutions` are intentionally retained and should not be changed to `segmentationLayer.mags` during refactoring.
Applied to files:
frontend/javascripts/test/fixtures/volumetracing_object.ts
frontend/javascripts/types/api_types.ts
frontend/javascripts/test/model/model_resolutions.spec.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
frontend/javascripts/viewer/model/bucket_data_handling/wkstore_adapter.ts
frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts
frontend/javascripts/viewer/model/sagas/dataset_saga.ts
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
frontend/javascripts/test/fixtures/hybridtracing_object.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/tabs/train_ai_model_tab.tsx
frontend/javascripts/viewer/api/api_latest.ts
frontend/javascripts/viewer/view/context_menu.tsx
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx
frontend/javascripts/viewer/model/accessors/flycam_accessor.ts
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
frontend/javascripts/test/fixtures/dataset_server_object.ts
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
frontend/javascripts/viewer/model/data_layer.ts
frontend/javascripts/viewer/model_initialization.ts
frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx
frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx
frontend/javascripts/viewer/model/bucket_data_handling/layer_rendering_manager.ts
📚 Learning: 2024-12-16T15:48:37.065Z
Learnt from: knollengewaechs
PR: scalableminds/webknossos#8266
File: frontend/javascripts/components/mag_selection.tsx:51-60
Timestamp: 2024-12-16T15:48:37.065Z
Learning: In the `MagSelection` component (`frontend/javascripts/components/mag_selection.tsx`), the selected magnification `value` will always be present in `allMags` because only existing values can be selected by the user.
Applied to files:
frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx
frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts
frontend/javascripts/viewer/view/action-bar/download_modal_view.tsx
frontend/javascripts/viewer/api/api_latest.ts
frontend/javascripts/viewer/view/context_menu.tsx
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx
frontend/javascripts/viewer/model/accessors/flycam_accessor.ts
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts
frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts
frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx
frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx
📚 Learning: 2025-05-12T13:07:29.637Z
Learnt from: frcroth
PR: scalableminds/webknossos#8609
File: app/models/dataset/Dataset.scala:753-775
Timestamp: 2025-05-12T13:07:29.637Z
Learning: In the `updateMags` method of DatasetMagsDAO (Scala), the code handles different dataset types distinctly:
1. Non-WKW datasets have `magsOpt` populated and use the first branch which includes axisOrder, channelIndex, and credentialId.
2. WKW datasets will have `wkwResolutionsOpt` populated and use the second branch which includes cubeLength.
3. The final branch is a fallback for legacy data.
This ensures appropriate fields are populated for each dataset type.
Applied to files:
frontend/javascripts/viewer/model/sagas/dataset_saga.ts
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
📚 Learning: 2025-09-08T13:33:47.097Z
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8824
File: frontend/javascripts/viewer/view/context_menu.tsx:1033-1039
Timestamp: 2025-09-08T13:33:47.097Z
Learning: In frontend/javascripts/viewer/view/context_menu.tsx, the segmentIdLabel intentionally shows the unmapped segment ID (maybeUnmappedSegmentId) in the "within Segment ${id}" text when proofreading is active, as this can be helpful for users. The mapped segment ID (segmentIdAtPosition) is only used as a fallback when the unmapped ID is not available.
Applied to files:
frontend/javascripts/viewer/view/context_menu.tsx
🧬 Code graph analysis (26)
frontend/javascripts/types/api_types.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts (2)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/volume/VolumeTracingService.scala (1)
volumeTracingLayer
(641-660)
frontend/javascripts/test/model/model_resolutions.spec.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx (3)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)frontend/javascripts/viewer/view/action-bar/ai_job_modals/constants.ts (1)
MEAN_VX_SIZE
(31-35)
frontend/javascripts/viewer/model/bucket_data_handling/wkstore_adapter.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/sagas/flycam_info_cache_saga.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx (1)
frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)
frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/test/model/binary/cube.spec.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/view/action-bar/download_modal_view.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/sagas/dataset_saga.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/tabs/train_ai_model_tab.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/api/api_latest.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (2)
getMagInfo
(39-39)getLayerByName
(145-164)
frontend/javascripts/viewer/view/context_menu.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/accessors/flycam_accessor.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (2)
getMagInfo
(39-39)getLayerByName
(145-164)
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx (2)
frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/forms/train_ai_model_form.tsx (2)
frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts (1)
frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)
frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/model/bucket_data_handling/layer_rendering_manager.ts (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-smoketest-push
- GitHub Check: backend-tests
🔇 Additional comments (46)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx (1)
35-35
:mags[0]
swap looks correct
colorLayer.mags
already provides the same triple the validator needs, so pulling the first entry keeps the export-size checks working while aligning with the new naming.frontend/javascripts/viewer/view/action-bar/ai_job_modals/tabs/train_ai_model_tab.tsx (1)
21-21
: Ensure segmentation layers exposemags
before swapping fromresolutions
.
getSegmentationLayerByHumanReadableName
still returns layer objects that (as of the previous rollout) only surfacedresolutions
. Switching this call tosegmentationLayer.mags
will handgetMagInfo
anundefined
argument until the store/backend payload is updated, which would blow up the modal. Please confirm that the layer DTOs in the dataset/tracing store already exposemags
, or keep theresolutions
fallback until that migration lands. Based on learningsfrontend/javascripts/viewer/model/bucket_data_handling/layer_rendering_manager.ts (3)
193-193
: LGTM: Correct migration from resolutions to mags.The change from
layer.resolutions
tolayer.mags
aligns with the broader refactoring effort and maintains the same functionality for calculatingmaximumMagIndex
.
202-202
: LGTM: Consistent use of mags for getDenseMags call.The change from
layer.resolutions
tolayer.mags
in thegetDenseMags()
call is correct and maintains consistency with the previous change on line 193.
193-202
: All getMagInfo calls now use layer.mags
Search across the codebase found zero instances of getMagInfo with .resolutions.frontend/javascripts/viewer/model/sagas/flycam_info_cache_saga.ts (1)
110-110
: Switch to layer.mags when computing dense mags — looks goodChange aligns with the repo‑wide migration and the worker’s intent.
Please double‑check that AsyncGetMaximumZoomForAllMags (and _getMagInfo) now uniformly expect mags arrays across viewer modules to avoid mixed inputs.
frontend/javascripts/viewer/view/right-border-tabs/segments_tab/segment_statistics_modal.tsx (1)
102-103
: Use mags for finest mag selection — OKConsistent with API/types migration; no control‑flow changes.
Based on learnings
frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx (1)
66-70
: Use colorLayer.mags in texture mag selection — OKThis keeps the heuristic unchanged while sourcing from the new mags field.
frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts (2)
24-35
: Tests: migrate resolutions → mags for layer[0] — OKMatches the new data shape; comment explains the need for more mags.
38-49
: Tests: migrate resolutions → mags for layer[1] — OKConsistent with the updated fixtures and accessors.
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts (1)
29-35
: LGTM - Test fixture property update aligned with PR objective.The change from
resolutions
tomags
in the test fixture correctly aligns with the broader codebase migration. The magnification arrays remain identical, ensuring test behavior consistency while updating to the new property naming convention.Also applies to: 43-47
frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts (2)
205-205
: LGTM - Consistent mag data source update.The change from
segmentationLayer.resolutions
tosegmentationLayer.mags
properly aligns with the project-wide migration while maintaining identical functionality forgetMagInfo
calls.
539-539
: LGTM – Mag data source consistently updated. Change aligns with the broader refactoring andgetMagInfo
behavior remains unchanged.frontend/javascripts/test/model/binary/cube.spec.ts (1)
54-63
: LGTM - Test mock property renamed consistently.The change from
resolutions
tomags
in the mocked layer objects correctly reflects the API change while maintaining identical test data and behavior. The MagInfo instantiation properly uses the updated property name.Also applies to: 278-280
frontend/javascripts/test/fixtures/volumetracing_object.ts (1)
62-66
: LGTM - Test fixture updated to match API changes.The property rename from
resolutions
tomags
in the test fixture data layers correctly aligns with the broader API migration while preserving the same magnification values for test consistency.frontend/javascripts/viewer/view/context_menu.tsx (1)
1699-1699
: LGTM - Context menu mag data source updated.The change from
visibleSegmentationLayer.resolutions
tovisibleSegmentationLayer.mags
correctly updates the magnification data source while maintaining the samegetMagInfo
functionality for segment volume calculations.frontend/javascripts/viewer/model/data_layer.ts (1)
40-40
: LGTM - Data layer initialization updated for mags property.The change from
layerInfo.resolutions
tolayerInfo.mags
correctly updates the magnification data source during DataLayer construction. The downstream usage throughgetMagInfo(this.mags)
remains consistent.frontend/javascripts/test/model/volumetracing/volume_annotation_sampling.spec.ts (1)
71-80
: LGTM - Test setup updated for mags property.The change from
resolutions
tomags
in the mocked layer correctly aligns the test with the API migration. The MagInfo instantiation and test behavior remain identical.frontend/javascripts/dashboard/advanced_dataset/create_explorative_modal.tsx (1)
97-97
: LGTM - Modal mag data sources updated consistently.Both changes from
selectedSegmentationLayer.resolutions
toselectedSegmentationLayer.mags
correctly align with the project-wide migration:
- Line 97: RestrictMagnificationSlider mag info derivation
- Line 200: CreateExplorativeModal mag info computation
The magnification functionality and UI behavior remain unchanged.
Also applies to: 200-200
frontend/javascripts/test/model/binary/pullqueue.spec.ts (1)
42-42
: LGTM: test mock migrated to magsThe mocked layer now exposes mags, consistent with API types and consumers.
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (1)
298-300
: Use mags for tooltip mag list — OKSwapping to getMagInfo(layer.mags) aligns with the type change and downstream helpers.
frontend/javascripts/viewer/model/sagas/dataset_saga.ts (1)
117-120
: Switch to mags for downsampling warning — OKgetMagInfo(dataLayer.mags) matches the new layer shape. Ensure all dataLayers now provide mags at runtime (incl. legacy paths) to avoid null/undefined access.
frontend/javascripts/viewer/model/sagas/volume/min_cut_saga.ts (1)
287-289
: Use mags for min-cut mag selection — OKSelecting magInfo from volumeTracingLayer.mags is consistent with the type migration.
frontend/javascripts/viewer/model/sagas/volume/proofread_saga.ts (1)
1239-1247
: Proofreading now bases magInfo on mags — double-check intentPreviously, certain proofreading paths intentionally used resolutions. With the global type change, using mags is likely required, but please verify the chosen agglomerateFileMag/zoomstep mirrors prior behavior (finest vs. current mag) and doesn’t regress operations.
Based on learnings
frontend/javascripts/test/model/model_resolutions.spec.ts (5)
7-7
: Test suite rename to mags — OK
25-35
: Test fixtures use mags — OKShapes align with Vector3[] and convertToDenseMag inputs.
59-59
: Helper updated to mags — OK
81-94
: getMagUnion test data migrated — OK
108-121
: Mixed mags union test migrated — OKfrontend/javascripts/viewer/model/accessors/flycam_accessor.ts (3)
418-425
: getCurrentMag now reads mags — OKMatches dataset layer shape and MagInfo API.
631-633
: Unrenderable-layer check uses mags — OKmagInfo(layer.mags) keeps logic intact.
679-681
: Active mag info derived from mags — OKConsistent with global migration.
frontend/javascripts/types/api_types.ts (1)
95-101
: No.resolutions
references remain
Scanning returned zero hits; please confirm parsing/serialization populatesmags
for WKW, Zarr, and legacy formats before merging.frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
21-27
: Fixture migrated to mags correctlyProperty rename to mags with same triplets looks consistent with APIColorLayer and wider PR.
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (4)
44-46
: Use mags for per-layer MagInfoSwitch to layer.mags for getMagInfoByLayer is correct and consistent with the new API shape.
69-71
: Magnification union now based on magsIterating over layer.mags and grouping by max axis preserves previous behavior under the new field name.
Also applies to: 86-91
94-96
: Widest mags computed from magsconvertToDenseMag(layer.mags) aligns with the refactor; no issues.
139-140
: Visible segmentation layer MagInfo via magsGood use of mags; empty fallback remains handled above.
frontend/javascripts/viewer/geometries/materials/plane_material_factory.ts (1)
920-921
: Vertex alignment MagInfo derived from magsUsing getMagInfo(layer.mags) is consistent with dataset_accessor and the PR direction.
frontend/javascripts/viewer/model_initialization.ts (2)
615-617
: Robust conversion of tracing magsMapping ServerVolumeTracing.mags {x,y,z} -> Vector3[] with fallback [[1,1,1]] covers legacy tracings.
625-633
: Tracing layer now exposes magsSetting mags on the synthesized APISegmentationLayer matches downstream consumers.
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx (1)
46-48
: Mitochondria infers on finest mag via magsgetMagInfo(colorLayer.mags).getFinestMag() is the right source after the rename.
frontend/javascripts/test/fixtures/dataset_server_object.ts (2)
13-20
: Color layer fixture: mags migration LGTMTriplets retained, unsorted comment preserved.
36-43
: Segmentation layer fixture: mags migration LGTMProperty rename aligns with types and other fixture changes.
frontend/javascripts/viewer/api/api_latest.ts (1)
689-696
: API paths now consistently source MagInfo from magsAll updated call sites (segment registration, getDataValue, getDataForBoundingBox, getViewportData, raw download URL) correctly use layer.mags.
Also applies to: 1875-1877, 1932-1941, 1978-1983, 2139-2141
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx (1)
148-152
: Switch to mags is safe. APISegmentationLayer defines onlymags
(noresolutions
), and all calls togetMagInfo
already expect amags
array—no interim guard required.
frontend/javascripts/viewer/view/action-bar/ai_job_modals/forms/train_ai_model_form.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (1)
1143-1143
: Fix type mismatch in _.differenceWith comparison.
possibleMags
isVector3[]
, butvolumeTracingMags
isArray<{ mag: Vector3; path?: string }>
. Comparing these with_.isEqual
will never find matches because the shapes differ. Extract themag
property before comparison.Apply this diff:
- const magsToDownsample = _.differenceWith(possibleMags, volumeTracingMags, _.isEqual); + const magsToDownsample = _.differenceWith(possibleMags, volumeTracingMags.map(m => m.mag), _.isEqual);
♻️ Duplicate comments (1)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (1)
155-157
: Verify mags availability on dataset segmentation layers.A previous review flagged that
getSegmentationLayerByName
might return dataset segmentation layers that only exposeresolutions
, notmags
. If the migration is incomplete, accessingsegmentationLayer.mags
could passundefined
togetMagInfo
, causing a runtime failure.Consider adding a fallback until all dataset layers are confirmed to have the
mags
field:- return getMagInfo(segmentationLayer.mags); + return getMagInfo(segmentationLayer.mags ?? segmentationLayer.resolutions ?? []);Run the following script to check if any dataset segmentation layers in the codebase still use
resolutions
:#!/bin/bash # Search for segmentation layer definitions that might still use resolutions field rg -nP --type=ts -C3 'category.*segmentation|segmentation.*category' | rg -A10 -B10 'resolutions'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
(1 hunks)frontend/javascripts/test/fixtures/dataset_server_object.ts
(2 hunks)frontend/javascripts/test/fixtures/hybridtracing_object.ts
(1 hunks)frontend/javascripts/test/fixtures/volumetracing_object.ts
(1 hunks)frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts
(2 hunks)frontend/javascripts/test/model/model_resolutions.spec.ts
(5 hunks)frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts
(1 hunks)frontend/javascripts/types/api_types.ts
(1 hunks)frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
(5 hunks)frontend/javascripts/viewer/model/data_layer.ts
(2 hunks)frontend/javascripts/viewer/model/helpers/mag_info.ts
(2 hunks)frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts
(1 hunks)frontend/javascripts/viewer/model_initialization.ts
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/annotations_csv_input.tsx
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx
(1 hunks)frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
(3 hunks)frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
(2 hunks)frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- frontend/javascripts/test/model/model_resolutions.spec.ts
- frontend/javascripts/types/api_types.ts
- frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/bounding_box_selection_form_item.tsx
- frontend/javascripts/viewer/view/action-bar/create_animation_modal.tsx
- frontend/javascripts/viewer/model/sagas/volume/quick_select/quick_select_heuristic_saga.ts
- frontend/javascripts/viewer/model_initialization.ts
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/reducers/skeletontracing_reducer_helpers.ts:125-125
Timestamp: 2024-11-22T17:17:39.914Z
Learning: In the `createNode` function within `skeletontracing_reducer_helpers.ts`, the property `resolution` is intentionally kept even when the parameter is renamed to `mag`.
📚 Learning: 2024-11-22T17:18:04.217Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/proofread_saga.ts:1039-1039
Timestamp: 2024-11-22T17:18:04.217Z
Learning: In `frontend/javascripts/oxalis/model/sagas/proofread_saga.ts`, when calling `getMagInfo`, the use of `volumeTracingLayer.resolutions` is intentional and should not be changed to `volumeTracingLayer.mags`.
Applied to files:
frontend/javascripts/test/fixtures/volumetracing_object.ts
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
frontend/javascripts/test/fixtures/hybridtracing_object.ts
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/annotations_csv_input.tsx
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
frontend/javascripts/viewer/model/helpers/mag_info.ts
frontend/javascripts/test/fixtures/dataset_server_object.ts
frontend/javascripts/viewer/model/data_layer.ts
📚 Learning: 2024-11-22T17:19:07.947Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/volumetracing_saga.tsx:433-434
Timestamp: 2024-11-22T17:19:07.947Z
Learning: In the codebase, certain usages of `segmentationLayer.resolutions` are intentionally retained and should not be changed to `segmentationLayer.mags` during refactoring.
Applied to files:
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
frontend/javascripts/test/fixtures/dataset_server_object.ts
frontend/javascripts/viewer/model/data_layer.ts
📚 Learning: 2024-12-16T15:48:37.065Z
Learnt from: knollengewaechs
PR: scalableminds/webknossos#8266
File: frontend/javascripts/components/mag_selection.tsx:51-60
Timestamp: 2024-12-16T15:48:37.065Z
Learning: In the `MagSelection` component (`frontend/javascripts/components/mag_selection.tsx`), the selected magnification `value` will always be present in `allMags` because only existing values can be selected by the user.
Applied to files:
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts
🧬 Code graph analysis (8)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (2)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (2)
getMagInfo
(39-39)getSegmentationLayerByName
(167-178)
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (1)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/annotations_csv_input.tsx (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx (4)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (1)
getMagInfo
(39-39)frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
colorLayer
(12-31)frontend/javascripts/viewer/view/action-bar/ai_job_modals/constants.ts (1)
MEAN_VX_SIZE
(31-35)frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (2)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)frontend/javascripts/viewer/model/helpers/mag_info.ts (2)
MagInfo
(11-225)convertToDenseMags
(227-257)
frontend/javascripts/viewer/model/helpers/mag_info.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
frontend/javascripts/viewer/model/data_layer.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
🔇 Additional comments (26)
frontend/javascripts/test/sagas/annotation_tool_disabled_info.spec.ts (1)
24-47
: LGTM! Test fixture correctly updated to mags structure.The test fixture has been properly updated to use the new
mags: [{ mag: Vector3 }]
structure instead of the oldresolutions: Vector3[]
format. The comment on line 24 has also been appropriately updated to reference "mags" instead of "resolutions".frontend/javascripts/test/fixtures/volumetracing_object.ts (1)
62-62
: LGTM! Fixture correctly updated to mags structure.The test fixture has been properly updated to use the new
mags: [{ mag: Vector3 }]
structure.frontend/javascripts/viewer/model/data_layer.ts (2)
19-19
: LGTM! Property type correctly updated.The
mags
property type has been correctly updated fromArray<Vector3>
toArray<{ mag: Vector3 }>
to match the new data structure.
40-40
: LGTM! Initialization source updated correctly.The initialization has been properly updated to read from
layerInfo.mags
instead of the oldlayerInfo.resolutions
field.frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (1)
152-152
: LGTM! Fallback mags structure correctly updated.The fallback value has been properly updated to use the new
mags: [{ mag: Vector3 }]
structure.frontend/javascripts/test/model/accessors/flycam_accessors.spec.ts (3)
11-11
: LGTM!The Vector3 type assertion for
topLeft
correctly matches the expected type definition.
28-36
: LGTM!The migration from
resolutions
tomags
is consistent with the PR's objective to reshape magnification data. Each magnification is correctly wrapped in an object with amag
property, and theadditionalAxes
property has been properly added.
42-44
: LGTM!The
mags
property correctly replacesresolutions
with the new object-wrapped structure, andadditionalAxes
has been appropriately added.frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
21-27
: LGTM!The
mags
property correctly replacesresolutions
with each magnification wrapped in an object containing themag
property. The values remain unchanged, ensuring backward compatibility.frontend/javascripts/test/fixtures/dataset_server_object.ts (2)
13-20
: LGTM!The
mags
property correctly replacesresolutions
with each magnification wrapped in an object. The intentional unsorted ordering (with the "unsorted on purpose" comment) is properly preserved for testing edge cases.
36-43
: LGTM!The
mags
property correctly replacesresolutions
with the same object-wrapped structure as the color layer, maintaining the intentional unsorted ordering for test coverage.frontend/javascripts/viewer/model/helpers/mag_info.ts (2)
45-45
: LGTM!The call site correctly uses the renamed
convertToDenseMags
function, maintaining consistency with the plural naming convention.
227-227
: LGTM!The function rename from
convertToDenseMag
toconvertToDenseMags
uses the plural form, which better reflects that it operates on an array of magnifications. The function body remains unchanged, preserving the existing logic.frontend/javascripts/viewer/model/accessors/dataset_accessor.ts (6)
31-31
: LGTM!The import statement correctly references the renamed
convertToDenseMags
function from the mag_info helper.
33-34
: LGTM!The
_getMagInfo
function correctly adapts to the newmags
data structure by acceptingArray<{ mag: Vector3 }>
and mapping to extract themag
property for theMagInfo
constructor.
45-45
: LGTM!The call site correctly uses
layer.mags
instead oflayer.resolutions
, aligning with the new data model.
70-71
: LGTM!The
getMagnificationUnion
function correctly adapts to the newmags
structure by iterating overlayer.mags
and extracting themag
property from each object.
96-96
: LGTM!The
getWidestMags
function correctly adapts to uselayer.mags
and calls the renamedconvertToDenseMags
function, properly extracting themag
property from each object.
140-140
: LGTM!The
_getMagInfoOfVisibleSegmentationLayer
function correctly usessegmentationLayer.mags
instead ofsegmentationLayer.resolutions
, consistent with the broader data model migration.frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (2)
298-298
: LGTM! Migration to mags correctly applied.The change from
layer.resolutions
tolayer.mags
aligns with the PR's objective to replace resolutions with the new mags structure.
1127-1127
: LGTM! Correctly extracts mag values.The destructuring and mapping correctly adapts to the new
mags
structure by extracting themag
property.frontend/javascripts/viewer/view/action-bar/ai_job_modals/utils.tsx (3)
50-67
: LGTM! Magnification selection logic correctly migrated.The loop properly extracts
mag
from eachmags
array element and maintains the same selection logic. All accesses tomagInfo.mag
are consistent throughout the calculation.
128-128
: No occurrences of volumeTracingMags found; manually verify that any constructors, consumers, and tests handling AnnotationInfoForAITrainingJob are updated to the new{ mag: Vector3 }[][]
signature.
46-46
: EnsuregetMagInfo
memoization handles newmags
references
Default lodash memoize uses reference equality, so ifcolorLayer.mags
arrays are recreated on each render, the cache will always miss. Verify how and wherecolorLayer.mags
is constructed and consider supplying a custom resolver or stabilizing its reference before callinggetMagInfo
.frontend/javascripts/viewer/view/action-bar/ai_job_modals/components/annotations_csv_input.tsx (2)
112-112
: LGTM! Improved clarity by extracting the transformation.Extracting
volumeTracingMags
into a separate variable improves readability and aligns with the broader migration fromresolutions
tomags
.
103-107
: Verify emptymags
handling
The current fallback ([{ mag: [1,1,1] }]
) only applies whenmags
isundefined
, not when it’s an empty array—sovolumeTracingMags
may contain empty arrays ifmags: []
. Confirm whether downstream consumers expect at least one magnification level or if empty arrays are acceptable; adjust the check to treat[]
likeundefined
if needed.
frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
frontend/javascripts/test/model/model_resolutions.spec.ts (2)
77-102
: Minor formatting inconsistency in object literal.Line 83 has
{mag: [4, 4, 1]}
without a space after the colon, while lines 84-86, 91-93 use{mag:
with a space. Consider consistent spacing for readability.Apply this diff to fix the spacing:
mags: [ - {mag: [4, 4, 1]}, + {mag: [4, 4, 1]}, {mag: [8, 8, 1]}, {mag: [16, 16, 2]}, {mag: [32, 32, 4]},
104-139
: Minor formatting inconsistency in object literal.Line 110 has
{mag: [4, 4, 1]}
without a space after the colon, while lines 111-113, 118-120 use{mag:
with a space. Consider consistent spacing for readability.Apply this diff to fix the spacing:
mags: [ - {mag: [4, 4, 1]}, + {mag: [4, 4, 1]}, {mag: [8, 8, 1]}, {mag: [16, 16, 2]}, {mag: [32, 32, 4]},
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
frontend/javascripts/test/model/model_resolutions.spec.ts
(5 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-22T17:18:04.217Z
Learnt from: dieknolle3333
PR: scalableminds/webknossos#8168
File: frontend/javascripts/oxalis/model/sagas/proofread_saga.ts:1039-1039
Timestamp: 2024-11-22T17:18:04.217Z
Learning: In `frontend/javascripts/oxalis/model/sagas/proofread_saga.ts`, when calling `getMagInfo`, the use of `volumeTracingLayer.resolutions` is intentional and should not be changed to `volumeTracingLayer.mags`.
Applied to files:
frontend/javascripts/test/model/model_resolutions.spec.ts
🧬 Code graph analysis (1)
frontend/javascripts/test/model/model_resolutions.spec.ts (1)
frontend/javascripts/viewer/constants.ts (1)
Vector3
(14-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-smoketest-push
- GitHub Check: backend-tests
🔇 Additional comments (3)
frontend/javascripts/test/model/model_resolutions.spec.ts (3)
1-18
: LGTM! Import and test names properly updated.The import statement and test suite names have been correctly updated to reflect the rename from
convertToDenseMag
toconvertToDenseMags
. The simple test case correctly exercises the function with a direct array of Vector3 values.
20-64
: LGTM! Data structure correctly updated to new mags format.The test properly reflects the new data structure where
resolutions: Vector3[]
becomesmags: { mag: Vector3 }[]
. Thedensify
helper correctly extracts themag
property before passing toconvertToDenseMags
, and test expectations remain accurate.
66-75
: LGTM! Empty case test remains valid.This test correctly verifies the behavior with an empty dataset and requires no changes related to the mags refactoring.
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)
[ ] Added changelog entryirrelevant to end user