Distinguish viewer layers from image slices - #2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR clarifies viewer component placement semantics by introducing an explicit layer placement mode for components that map to separate Napari layers, while preserving slice specifically for Z-plane (Fiji/ImageJ-style) placement.
Changes:
- Add
ViewerComponentMode.LAYER = "layer"to the shared viewer protocol enum. - Preserve
ViewerComponentMode.SLICE = "slice"as a distinct mode for plane/Z-slice placement. - Add a regression test asserting the two wire values remain distinct and stable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/zmqruntime/viewer_protocol.py |
Adds the LAYER enum value to the shared viewer component placement modes. |
tests/test_viewer_protocol.py |
Adds a contract/regression test asserting the layer vs slice wire values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Risk Analysis 🛡️ · Low Risk
✅ Approved — Low-Risk Change
Details
Additive change: adds one enum member `ViewerComponentMode.LAYER = "layer"` and a test asserting `LAYER` and `SLICE` keep distinct wire values. No runtime dispatch enumerates the full member set — modes resolve by string value via `viewer_component_mode_value`, and unrecognized modes are handled gracefully in `component_mode_groups`. No existing tests were altered and no sensitive areas are touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Add the missing shared viewer placement term for components that route to separate Napari layers.
What changed
ViewerComponentMode.LAYER = "layer"ViewerComponentMode.SLICE = "slice"for genuine Fiji/ImageJ Z-slice placementVerification
No package version or release is included.